X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=Makefile.rules;h=d58b118741772c4b65a9e998ca39d0ea1c4b1547;hb=d86deb689bfec6cd3f0f2a0003dbbf3214f3cd4d;hp=1b0dd594cc0c9eb712c2f8efa93cba4ed44fe46f;hpb=172b648cd4335d654edb432238d92547ffa0e362;p=oota-llvm.git diff --git a/Makefile.rules b/Makefile.rules index 1b0dd594cc0..d58b1187417 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -142,8 +142,10 @@ endif # By default, strip symbol information from executable ifdef KEEP_SYMBOLS STRIP = +WARN_MSG = else STRIP = -s +WARN_MSG = "(without symbols) " endif # Allow gnu extensions... @@ -161,7 +163,7 @@ CompileP := $(CompileO) $(PROFILE) # Compile a c file, don't link... CompileC := $(CC) -c $(CPPFLAGS) $(CCFLAGS) $(CompileCommonOpts) CompileCG := $(CompileC) -g -D_DEBUG -CompileCO := $(CompileC) -O3 -DNDEBUG -finline-functions -felide-constructors -fshort-enums ## DISABLE -freg-struct-return because of gcc3.2 bug +CompileCO := $(CompileC) -O3 -DNDEBUG -finline-functions -fshort-enums ## DISABLE -freg-struct-return because of gcc3.2 bug CompileCP := $(CompileCO) $(PROFILE) @@ -198,7 +200,9 @@ BISON = bison # source files... # The local Makefile can list other Source files via ExtraSource = ... # +ifndef Source Source := $(ExtraSource) $(wildcard *.cpp *.c *.y *.l) +endif Objs := $(sort $(patsubst Debug/%.o, %.o, $(addsuffix .o,$(basename $(Source))))) ObjectsO := $(addprefix $(BUILD_ROOT)/Release/,$(Objs)) @@ -333,6 +337,7 @@ $(LIBNAME_OBJP): $(ObjectsP) $(LibSubDirs) $(LIBPROFILE)/.dir $(VERB) $(Relink) -o $@ $(ObjectsP) $(LibSubDirs) $(LIBNAME_OBJG): $(ObjectsG) $(LibSubDirs) $(LIBDEBUG)/.dir + @echo "Linking $@" $(VERB) $(Relink) -o $@ $(ObjectsG) $(LibSubDirs) endif @@ -388,22 +393,23 @@ STATICUSEDLIBS := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS))) USED_LIB_PATHS_G := $(addprefix $(LIBDEBUG)/, $(STATICUSEDLIBS)) USED_LIB_PATHS_O := $(addprefix $(LIBRELEASE)/, $(STATICUSEDLIBS)) USED_LIB_PATHS_P := $(addprefix $(LIBPROFILE)/, $(STATICUSEDLIBS)) +LINK_OPTS := $(TOOLLINKOPTS) $(PLATFORMLINKOPTS) all:: $(TOOLEXENAMES) clean:: $(VERB) rm -f $(TOOLEXENAMES) $(TOOLEXENAME_G): $(ObjectsG) $(USED_LIB_PATHS_G) $(BUILD_ROOT_TOP)/tools/Debug/.dir - @echo ======= Linking $(TOOLNAME) debug executable ======= - $(VERB) $(LinkG) -o $@ $(ObjectsG) $(USED_LIBS_OPTIONS_G) $(TOOLLINKOPTS) + @echo ======= Linking $(TOOLNAME) debug executable $(WARN_MSG) ======= + $(VERB) $(LinkG) -o $@ $(ObjectsG) $(USED_LIBS_OPTIONS_G) $(LINK_OPTS) $(TOOLEXENAME_O): $(ObjectsO) $(USED_LIB_PATHS_O) $(BUILD_ROOT_TOP)/tools/Release/.dir @echo ======= Linking $(TOOLNAME) release executable ======= - $(VERB) $(LinkO) -o $@ $(ObjectsG) $(USED_LIBS_OPTIONS_O) $(TOOLLINKOPTS) + $(VERB) $(LinkO) -o $@ $(ObjectsO) $(USED_LIBS_OPTIONS_O) $(LINK_OPTS) $(TOOLEXENAME_P): $(ObjectsP) $(USED_LIB_PATHS_P) $(BUILD_ROOT_TOP)/tools/Profile/.dir @echo ======= Linking $(TOOLNAME) profile executable ======= - $(VERB) $(LinkP) -o $@ $(ObjectsP) $(USED_LIBS_OPTIONS_P) $(TOOLLINKOPTS) + $(VERB) $(LinkP) -o $@ $(ObjectsP) $(USED_LIBS_OPTIONS_P) $(LINK_OPTS) endif @@ -427,7 +433,7 @@ $(BUILD_ROOT)/Release/%.o: %.cpp $(BUILD_ROOT)/Release/.dir $(VERB) $(CompileO) $< -o $@ $(BUILD_ROOT)/Release/%.o: %.c $(BUILD_ROOT)/Release/.dir - $(VERB) $(CompileOC) $< -o $@ + $(VERB) $(CompileCO) $< -o $@ $(BUILD_ROOT)/Profile/%.o: %.cpp $(BUILD_ROOT)/Profile/.dir @echo "Compiling $<" @@ -464,12 +470,12 @@ $(BUILD_ROOT)/Debug/%.o: %.c $(BUILD_ROOT)/Debug/.dir # 'make clean' nukes the tree clean:: $(VERB) rm -rf $(BUILD_ROOT)/Debug $(BUILD_ROOT)/Release $(BUILD_ROOT)/Profile $(BUILD_ROOT)/Depend - $(VERB) rm -f core *.o *.d *.so *~ *.flc + $(VERB) rm -f core core.[0-9][0-9]* *.o *.d *.so *~ *.flc # If dependancies were generated for the file that included this file, # include the dependancies now... # SourceDepend := $(addsuffix .d,$(addprefix $(BUILD_ROOT)/Depend/,$(basename $(filter-out Debug/%, $(Source))))) ifneq ($(SourceDepend),) -include $(SourceDepend) +-include $(SourceDepend) endif