summaryrefslogtreecommitdiff
path: root/Makefile.rules
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-04-07 16:06:18 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-04-07 16:06:18 +0000
commitbac3ca2e376e8a84f2dbac0ad99479a796493b13 (patch)
tree056decdbebfe00c520ea85c62c8217b03bed379b /Makefile.rules
parent54d1448fcc4bfe8ee7635b3b76a080b7893de584 (diff)
downloadllvm-bac3ca2e376e8a84f2dbac0ad99479a796493b13.tar.gz
llvm-bac3ca2e376e8a84f2dbac0ad99479a796493b13.tar.bz2
llvm-bac3ca2e376e8a84f2dbac0ad99479a796493b13.tar.xz
For PR723:
1. Don't force debug builds to have assertion checking turned on always. Let the default (on) be taken, or overridden by the command line 2. Create two new BuildModes based on assertion checking: Release+Assert and Debug-Assert. 3. Ensure that when building a distribution we get a release build with assertions enabled, regardless of the tree's configuration. 4. (unrelated) Fix library name generation for llvm-config usage. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27488 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Makefile.rules')
-rw-r--r--Makefile.rules23
1 files changed, 13 insertions, 10 deletions
diff --git a/Makefile.rules b/Makefile.rules
index affd0fb359..c1225402c1 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -219,17 +219,21 @@ 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.
+# If ENABLE_ASSERTIONS=1 is specified (make command line or configured),
+# then enable assertions by defining the appropriate preprocessor symbols.
ifdef ENABLE_ASSERTIONS
+ ifdef ENABLE_OPTIMIZED
+ BuildMode := $(BuildMode)+Asserts
+ endif
CXX.Flags += -D_DEBUG
C.Flags += -D_DEBUG
else
+ ifndef ENABLE_OPTIMIZED
+ BuildMode := $(BuildMode)-Asserts
+ endif
CXX.Flags += -DNDEBUG
C.Flags += -DNDEBUG
endif
@@ -580,10 +584,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 +1532,7 @@ $(DistDir)/.makedistdir: $(DistSources)
$(EchoCmd) Removing old $(DistDir) ; \
$(RM) -rf $(DistDir); \
$(EchoCmd) Making 'all' to verify build ; \
- $(MAKE) all ; \
+ $(MAKE) ENABLE_OPTIMIZED=1 ENABLE_ASSERTIONS=1 all ; \
fi
$(Echo) Building Distribution Directory $(DistDir)
$(Verb) $(MKDIR) $(DistDir)
@@ -1590,8 +1593,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 ENABLE_ASSERTIONS=1 \
+ DistDir="$$new_distdir" distdir ) || exit 1; \
fi; \
done
$(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \