Conditional sections in AIX Makefiles

How to create a makefile that works on AIX, Linux, and SunOS and has the ability to provide different compiler options for each environment?

I have access to an environment variable that describes the OS, but the AIX make utility does not like ifeq, so I cannot do something like:

ifeq($(OS), AIX)
    CFLAGS = $(CFLAGS) <IBM compiler options>
endif
+3
source share
2 answers

You can use the construct as follows:

CFLAGS_AIX =AIX
CFLAGS_Linux =Flags Linux
CFLAGS_SunOS =Flags SunOS Flags
CFLAGS = $(CFLAGS_$(OS))

+6
source

Makefile , make . ( , , make ( ) .) , , . , automake, make . unixen , ( ) " ". , , , , , . autoconf/automake - , CFLAGS , CONFIG_SITE , , CONFIG_SITE login script . ( , /make ). , . (, ).

+1

Source: https://habr.com/ru/post/1715982/


All Articles