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
You can use the construct as follows:
CFLAGS_AIX =AIXCFLAGS_Linux =Flags LinuxCFLAGS_SunOS =Flags SunOS FlagsCFLAGS = $(CFLAGS_$(OS))
CFLAGS_AIX =
CFLAGS_Linux =
CFLAGS_SunOS =
CFLAGS = $(CFLAGS_$(OS))
Makefile , make . ( , , make ( ) .) , , . , automake, make . unixen , ( ) " ". , , , , , . autoconf/automake - , CFLAGS , CONFIG_SITE , , CONFIG_SITE login script . ( , /make ). , . (, ).
Source: https://habr.com/ru/post/1715982/More articles:The problem with hand painting - c #How to add a bare CALayer as a "subview" in a UIView? - iphoneНе удается получить доступ к расположенному объекту. Сделка - c#How to set up a VB project? - installerjGrowl: How can I limit my interface to one message at a time? - jqueryChange the GCC version used by bjam - gccunderstanding methods in objective-c - methodsPerforming aggregate functions on large, frequently changing datasets - performanceКак преобразовать переменную функцию аргумента в макрос? - cSubSonic2.2 SharedDbConnectionScope and TransactionScope Transaction Confusion - transactionsAll Articles