X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=Makefile.rules;h=cebf2d8d38c8b5dea8f57b752ec66e2f78702113;hb=7223f0275514a0605c8a1ba3752a5cffb0b821d6;hp=d83f2fa548b39f0adb795bc4e654e7a2e3791fc3;hpb=413f2f961af246ff6422726fb8071555c6cacb44;p=oota-llvm.git diff --git a/Makefile.rules b/Makefile.rules index d83f2fa548b..cebf2d8d38c 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -38,7 +38,7 @@ InternalTargets := preconditions distdir dist-hook VPATH=$(PROJ_SRC_DIR) #-------------------------------------------------------------------- -# Reset the list of suffixes we know how to build +# Reset the list of suffixes we know how to build. #-------------------------------------------------------------------- .SUFFIXES: .SUFFIXES: .c .cpp .cc .h .hpp .y .l .lo .o .a .bc .td .ps .dot .ll @@ -199,6 +199,7 @@ install-bytecode:: install-bytecode-local # Variables derived from configuration we are building #-------------------------------------------------------------------- +CPP.Defines := # OPTIMIZE_OPTION - The optimization level option we want to build LLVM with # this can be overridden on the make command line. ifneq ($(OS),MingW) @@ -212,6 +213,7 @@ ifdef ENABLE_PROFILING CXX.Flags := $(OPTIMIZE_OPTION) -pg -g C.Flags := $(OPTIMIZE_OPTION) -pg -g LD.Flags := $(OPTIMIZE_OPTION) -pg -g + KEEP_SYMBOLS := 1 else ifeq ($(ENABLE_OPTIMIZED),1) BuildMode := Release @@ -253,11 +255,17 @@ endif # then disable assertions by defining the appropriate preprocessor symbols. ifdef DISABLE_ASSERTIONS BuildMode := $(BuildMode)-Asserts - CXX.Flags += -DNDEBUG - C.Flags += -DNDEBUG + CPP.Defines += -DNDEBUG else - CXX.Flags += -D_DEBUG - C.Flags += -D_DEBUG + CPP.Defines += -D_DEBUG +endif + +# If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or +# configured), then enable expensive checks by defining the +# appropriate preprocessor symbols. +ifdef ENABLE_EXPENSIVE_CHECKS + BuildMode := $(BuildMode)+Checks + CPP.Defines += -D_GLIBCXX_DEBUG endif ifeq ($(ENABLE_PIC),1) @@ -267,7 +275,8 @@ endif CXX.Flags += $(CXXFLAGS) -Woverloaded-virtual C.Flags += $(CFLAGS) -CPP.BaseFlags += $(CPPFLAGS) +CPP.Defines += $(CPPFLAGS) +CPP.BaseFlags += $(CPP.Defines) LD.Flags += $(LDFLAGS) AR.Flags := cru LibTool.Flags := --tag=CXX @@ -1462,7 +1471,7 @@ ifneq ($(strip $(filter-out clean clean-local dist-clean,$(MAKECMDGOALS)))),) DependFiles := $(basename $(filter %.cpp %.c %.cc, $(Sources))) DependFiles := $(DependFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.d) --include /dev/null $(DependFiles) +-include $(DependFiles) "" endif