How to write multiple conditions in Makefile.am with “else if”

前端 未结 5 517
隐瞒了意图╮
隐瞒了意图╮ 2021-02-02 05:29

I want to compile my project with autoconf/automake. There are 2 conditions defined in my configure.ac

AM_CONDITIONAL(HAVE_CLIENT, test $enable-client -eq 1)
AM_         


        
5条回答
  •  温柔的废话
    2021-02-02 05:55

    ptomato's code can also be written in a cleaner manner like:

    ifeq ($(TARGET_CPU),x86)
      TARGET_CPU_IS_X86 := 1
    else ifeq ($(TARGET_CPU),x86_64)
      TARGET_CPU_IS_X86 := 1
    else
      TARGET_CPU_IS_X86 := 0
    endif
    

    This doesn't answer OP's question but as it's the top result on google, I'm adding it here in case it's useful to anyone else.

提交回复
热议问题