|
From: | Boris Godin |
Subject: | Re: When some files need special compilation flags, ... |
Date: | Tue, 08 Jul 2008 10:25:42 -0300 |
User-agent: | Thunderbird 2.0.0.14 (Windows/20080421) |
You can use defines with foreach function : SPECIAL1 = special1.c ... SPECIAL2 = special2.c ... OTHER_SRC = ... define SPECIAL1_DEPS $(patsubst %.c,%.o,$(1)): $(1) $(CC) -D_POSIX_PTHREAD_SEMANTICS -c $$< -o $$@ endef define SPECIAL2_DEPS $(patsubst %.c,%.o,$(1)): $(1) $(CC) -D_POSIX_C_SOURCE -c $$< -o $$@ endef $(foreach FILE,$(SPECIAL1), \ $(eval $(call SPECIAL1_DEPS,$(FILE))) \ ) $(foreach FILE,$(SPECIAL2), \ $(eval $(call SPECIAL2_DEPS,$(FILE))) \ ) ... x z wrote: I am compiling C programs using gcc on Solaris. Solaris need some special compilation flags to ensure POSIX conformance. For example, if one needs to call sigwait() with the POSIX syntax (and semantics too?), one needs to add a -D_POSIX_PTHREAD_SEMANTICS flag to the compilation command, according to sigwait()'s man page. In other cases, one may need to add -D_POSIX_C_SOURCE for multithreaded programs. --
Boris Godin Java Developer - Gameloft COR Paraná 560, Nueva Córdoba (CP 5000) Tel.: (+54 0351) 460 26 26 int. 111 MSN: address@hidden -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. |
[Prev in Thread] | Current Thread | [Next in Thread] |