Don't overload anchor names, silly browser's can't handle it.
[oota-llvm.git] / Makefile.rules
index affd0fb35989c2450c7242e4b7f947d2fd6164e9..115100ef2a95964cb53c4b9d5d5d061b13d44397 100644 (file)
@@ -219,19 +219,18 @@ else
     C.Flags   := -g
     LD.Flags  := -g 
     KEEP_SYMBOLS := 1
-    # Assertions default to ON for debug builds.
-    ENABLE_ASSERTIONS := 1
   endif
 endif
 
-# If this is a debug build or if ENABLE_ASSERTIONS=1 is specified on the make
-# command line, enable assertions.
-ifdef ENABLE_ASSERTIONS
-  CXX.Flags += -D_DEBUG
-  C.Flags   += -D_DEBUG
-else
+# If DISABLE_ASSERTIONS=1 is specified (make command line or configured),
+# then disable assertions by defining the appropriate preprocessor symbols.
+ifdef DISABLE_ASSERTIONS
+  BuildMode := $(BuildMode)-Asserts
   CXX.Flags += -DNDEBUG
   C.Flags   += -DNDEBUG
+else
+  CXX.Flags += -D_DEBUG
+  C.Flags   += -D_DEBUG
 endif
 
 CXX.Flags     += $(CXXFLAGS)
@@ -580,10 +579,9 @@ endif
 #---------------------------------------------------------
 ifeq ($(firstword $(LLVMLIBS)),config)
 LLVM_CONFIG := $(LLVM_SRC_ROOT)/utils/llvm-config/llvm-config 
-LLVMLIBS := $(shell $(LLVM_CONFIG) $(wordlist 2,9999,$(LLVMLIBS)))
-LLVMLIBS := $(patsubst $(PROJ_libdir)/%,%,$(LLVMLIBS))
+LLVMLIBS := $(shell $(LLVM_CONFIG) --libnames $(wordlist 2,9999,$(LLVMLIBS)))
+LLVMLIBS := $(patsubst lib%.a,%.a,$(LLVMLIBS))
 LLVMLIBS := $(patsubst %.o,%,$(LLVMLIBS))
-LLVMLIBS := $(patsubst -l%,%.a,$(LLVMLIBS))
 endif
 
 ifeq ($(LLVMLIBS),JIT)
@@ -1529,7 +1527,7 @@ $(DistDir)/.makedistdir: $(DistSources)
          $(EchoCmd) Removing old $(DistDir) ; \
          $(RM) -rf $(DistDir); \
          $(EchoCmd) Making 'all' to verify build ; \
-         $(MAKE) all ; \
+         $(MAKE) ENABLE_OPTIMIZED=1 all ; \
        fi
        $(Echo) Building Distribution Directory $(DistDir)
        $(Verb) $(MKDIR) $(DistDir) 
@@ -1590,8 +1588,8 @@ $(DistDir)/.makedistdir: $(DistSources)
          if test "$$subdir" \!= "." ; then \
            new_distdir="$(DistDir)/$$subdir" ; \
            test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \
-           ( cd $$subdir && $(MAKE) DistDir="$$new_distdir" distdir ) || \
-           exit 1; \
+           ( cd $$subdir && $(MAKE) ENABLE_OPTIMIZED=1 \
+             DistDir="$$new_distdir" distdir ) || exit 1; \
          fi; \
        done
        $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
@@ -1696,3 +1694,4 @@ printvars::
        $(Echo) "LexFiles     : " '$(LexFiles)'
        $(Echo) "Module       : " '$(Module)'
        $(Echo) "FilesToConfig: " '$(FilesToConfigPATH)'
+       $(Echo) "SubDirs      : " '$(SubDirs)'