Subj : Makefile question relating to conditional To : comp.programming From : hzmonte Date : Fri Sep 23 2005 11:40 pm I inherit a Makefile that has the following rule: target: main.c if ( `uname` == "SunOS" ) $(CC) $(CFLAGS) $(LDFLAGS_SOL) main.c $(DEBUGOBJ) -o main if ( `uname` == "Linux" ) $(CC) $(CFLAGS) $(LDFLAGS_LINUX) main.c $(DEBUGOBJ) -o main It is to be run by GNU gmake, and it does seem to run okay. But I am not able to see anywhere in the GNU Make manual that says gmake supports an if conditional with the above syntax. It supports ifeq, ifneq, etc, but not if(...==...). Is this an undocumented feature of gmake? And I am not able to find in the manual what 'xxx' and "xxx" means. Apparently 'uname' above returns the output of the uname command. But I am not able to see anywhere in the manual that documents that anything inside single quotes is to be expanded as a shell command. Is it another undocumented feature? And I want to factor out the LDFLAGS. So I try to do the following: ifeq ('uname', "SunOS") LDFLAGS = $(LDFLAGS_SOL) else ifeq ('uname', "Linux") LDFLAGS = $(LDFLAGS_SOL) endif endif It does NOT work. And it appears 'uname' returns "uname" in this case. Section 7.2 of the GNU Make manual gives the following ifeq syntax, without explaining what 'arg1' and "arg1" mean: ifeq (arg1, arg2) ifeq 'arg1' 'arg2' ifeq "arg1" "arg2" ifeq "arg1" 'arg2' ifeq 'arg1' "arg2" Indeed the manual says nothing about the difference among these five alternatives. Can anyone explain all the above? Thank you. .