diff options
-rw-r--r-- | c/src/make/compilers/gcc-target-default.cfg | 27 | ||||
-rw-r--r-- | make/compilers/gcc-target-default.cfg | 27 |
2 files changed, 38 insertions, 16 deletions
diff --git a/c/src/make/compilers/gcc-target-default.cfg b/c/src/make/compilers/gcc-target-default.cfg index c25744af39..4fc69721d7 100644 --- a/c/src/make/compilers/gcc-target-default.cfg +++ b/c/src/make/compilers/gcc-target-default.cfg @@ -17,9 +17,14 @@ # are used to add flags from the shell # cf. make.info ("Implicit rules/variables" for details) -CPPFLAGS = $(CPU_DEFINES) $(DEFINES) $(XCPPFLAGS) -CFLAGS = $(CPU_CFLAGS) -g -Wall -ansi -fasm $(XCFLAGS) -CXXFLAGS = $(CPU_CFLAGS) -g -Wall -ansi -fasm $(XCXXFLAGS) +# NOTE: Should these go to CPPFLAGS ? +CFLAGS_DEFAULT=-g -Wall -ansi -fasm + +# NOTE: CPU_CFLAGS should probably be renamed to CPU_CPPFLAGS +# NOTE: CPU_DEFINES should probably be merged with CPU_CFLAGS +CPPFLAGS = $(CPU_DEFINES) $(CPU_CFLAGS) $(DEFINES) $(XCPPFLAGS) +CFLAGS = $(CFLAGS_DEFAULT) $(XCFLAGS) +CXXFLAGS = $(CFLAGS_DEFAULT) $(XCXXFLAGS) ASFLAGS = $(CPU_ASFLAGS) $(XASFLAGS) # We only include the header files for networking if it is enabled. @@ -174,11 +179,13 @@ MKLIB=$(RANLIB) # # How to compile stuff into ${ARCH} subdirectory # -# NOTE: we override COMPILE.c +# NOTE: we override COMPILE.[c|cc|S] +# because gmake default rules use TARGET_ARCH for different purposes # COMPILE.c=$(CC) $(CPPFLAGS) $(CFLAGS) -c COMPILE.cc=$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c +COMPILE.S=$(CC) $(ASFLAGS) $(CPPFLAGS) -c ${ARCH}/%.o: %.c ${COMPILE.c} -o $@ $< @@ -186,11 +193,15 @@ ${ARCH}/%.o: %.c ${ARCH}/%.o: %.cc ${COMPILE.cc} -o $@ $< -# strip out C++ style comments. ${ARCH}/%.o: %.S - sed -e 's/\/\/.*$$//' < $< | \ - $(CPP) $(CPPFLAGS) -I. -I$(srcdir) -DASM - >$(ARCH)/$*.i - $(AS) $(ASFLAGS) -o $@ $(ARCH)/$*.i + ${COMPILE.S} -DASM -o $@ $< + +# OBSOLETE: the rule above should be equivalent. +# strip out C++ style comments. +# ${ARCH}/%.o: %.S +# sed -e 's/\/\/.*$$//' < $< | \ +# $(CPP) $(CPPFLAGS) -I. -I$(srcdir) -DASM - >$(ARCH)/$*.i +# $(AS) $(ASFLAGS) -o $@ $(ARCH)/$*.i # Make foo.rel from foo.o ${ARCH}/%.rel: ${ARCH}/%.o diff --git a/make/compilers/gcc-target-default.cfg b/make/compilers/gcc-target-default.cfg index c25744af39..4fc69721d7 100644 --- a/make/compilers/gcc-target-default.cfg +++ b/make/compilers/gcc-target-default.cfg @@ -17,9 +17,14 @@ # are used to add flags from the shell # cf. make.info ("Implicit rules/variables" for details) -CPPFLAGS = $(CPU_DEFINES) $(DEFINES) $(XCPPFLAGS) -CFLAGS = $(CPU_CFLAGS) -g -Wall -ansi -fasm $(XCFLAGS) -CXXFLAGS = $(CPU_CFLAGS) -g -Wall -ansi -fasm $(XCXXFLAGS) +# NOTE: Should these go to CPPFLAGS ? +CFLAGS_DEFAULT=-g -Wall -ansi -fasm + +# NOTE: CPU_CFLAGS should probably be renamed to CPU_CPPFLAGS +# NOTE: CPU_DEFINES should probably be merged with CPU_CFLAGS +CPPFLAGS = $(CPU_DEFINES) $(CPU_CFLAGS) $(DEFINES) $(XCPPFLAGS) +CFLAGS = $(CFLAGS_DEFAULT) $(XCFLAGS) +CXXFLAGS = $(CFLAGS_DEFAULT) $(XCXXFLAGS) ASFLAGS = $(CPU_ASFLAGS) $(XASFLAGS) # We only include the header files for networking if it is enabled. @@ -174,11 +179,13 @@ MKLIB=$(RANLIB) # # How to compile stuff into ${ARCH} subdirectory # -# NOTE: we override COMPILE.c +# NOTE: we override COMPILE.[c|cc|S] +# because gmake default rules use TARGET_ARCH for different purposes # COMPILE.c=$(CC) $(CPPFLAGS) $(CFLAGS) -c COMPILE.cc=$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c +COMPILE.S=$(CC) $(ASFLAGS) $(CPPFLAGS) -c ${ARCH}/%.o: %.c ${COMPILE.c} -o $@ $< @@ -186,11 +193,15 @@ ${ARCH}/%.o: %.c ${ARCH}/%.o: %.cc ${COMPILE.cc} -o $@ $< -# strip out C++ style comments. ${ARCH}/%.o: %.S - sed -e 's/\/\/.*$$//' < $< | \ - $(CPP) $(CPPFLAGS) -I. -I$(srcdir) -DASM - >$(ARCH)/$*.i - $(AS) $(ASFLAGS) -o $@ $(ARCH)/$*.i + ${COMPILE.S} -DASM -o $@ $< + +# OBSOLETE: the rule above should be equivalent. +# strip out C++ style comments. +# ${ARCH}/%.o: %.S +# sed -e 's/\/\/.*$$//' < $< | \ +# $(CPP) $(CPPFLAGS) -I. -I$(srcdir) -DASM - >$(ARCH)/$*.i +# $(AS) $(ASFLAGS) -o $@ $(ARCH)/$*.i # Make foo.rel from foo.o ${ARCH}/%.rel: ${ARCH}/%.o |