* llvm.spec.in: update blurb
[oota-llvm.git] / Makefile.rules
index 888c5bdf04069571ef42764bb01d6825f156f822..2852ac38bfc888a30464c4adc71407444eb1e70f 100644 (file)
@@ -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
@@ -1359,15 +1368,12 @@ all:: $(YaccFiles:%.y=$(PROJ_SRC_DIR)/%.cpp.cvs)
 %.h: %.y
 
 # Rule for building the bison based parsers...
-$(PROJ_SRC_DIR)/%.cpp $(PROJ_SRC_DIR)/%.h : $(PROJ_SRC_DIR)/%.y
 ifneq ($(BISON),)
+$(PROJ_SRC_DIR)/%.cpp $(PROJ_SRC_DIR)/%.h : $(PROJ_SRC_DIR)/%.y
        $(Echo) "Bisoning $*.y"
        $(Verb) $(BISON) -v -d -p $(<F:%Parser.y=%) -o $*.tab.c $<
        $(Verb) $(MV) -f $*.tab.c $(PROJ_SRC_DIR)/$*.cpp
        $(Verb) $(MV) -f $*.tab.h $(PROJ_SRC_DIR)/$*.h
-else
-       $(Echo) "Bison of $*.y SKIPPED -- bison not found"
-endif
 
 # IFF the .y file has changed since it was last checked into CVS, copy the .y
 # file to .y.cvs and the generated .cpp/.h file to .cpp.cvs/.h.cvs.  We use this
@@ -1380,6 +1386,16 @@ $(PROJ_SRC_DIR)/%.cpp.cvs: $(PROJ_SRC_DIR)/%.cpp
        $(CP) $(PROJ_SRC_DIR)/$*.y $(PROJ_SRC_DIR)/$*.y.cvs; \
        $(CP) $(PROJ_SRC_DIR)/$*.h $(PROJ_SRC_DIR)/$*.h.cvs)
 
+else
+$(PROJ_SRC_DIR)/%.cpp : $(PROJ_SRC_DIR)/%.cpp.cvs
+       $(Echo) "Bison of $*.y SKIPPED, bison not found -- copying .cpp.cvs"
+       $(Verb)$(CP) $(PROJ_SRC_DIR)/$*.cpp.cvs $(PROJ_SRC_DIR)/$*.cpp
+
+$(PROJ_SRC_DIR)/%.h : $(PROJ_SRC_DIR)/%.h.cvs
+       $(Echo) "Bison of $*.y SKIPPED, bison not found -- copying .h.cvs"
+       $(Verb)$(CP) $(PROJ_SRC_DIR)/$*.h.cvs $(PROJ_SRC_DIR)/$*.h
+endif
+
 
 $(YaccFiles:%.y=$(ObjDir)/%.o): $(ObjDir)/%.o : $(PROJ_SRC_DIR)/%.cpp