makefile中两重if判断

法一:

ifeq ($(GCC_MINOR),$(filter $(GCC_MINOR),4 5))

filter X, A B will return those of A,B that are equal X.

A variation of this is

ifneq (,$(filter $(GCC_MINOR),4 5))

where a negative comparison against an empty string is used instead (filter will return en empty string if GCC_MINOR doesn't match the arguments)

法二:

You can introduce another variable. It doesnt consolidate both checks, but it at least avoids having to put the body in twice:

do_it =

ifeq ($(GCC_MINOR), 4)

do_it = yes

endif

ifeq ($(GCC_MINOR), 5)

do_it = yes

endif

ifdef do_it

CFLAGS += -fno-strict-overflow

endif

原文:

http://stackoverflow.com/questions/7656425/makefile-ifeq-logical-or

相关文章:

  • 2021-04-17
  • 2021-08-17
  • 2022-01-03
  • 2021-12-30
  • 2022-01-27
  • 2021-06-21
  • 2021-12-17
  • 2021-10-18
猜你喜欢
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2021-10-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案