about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-11-22T19·38+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-11-22T19·38+0100
commitea2f7df5fac0b319b82a4a33ba8b992737fa8c56 (patch)
tree6ee87f0d521ebea06c01289265c79df44d9ccb1e
parent6b5f89f2cf954cae1623a6cd3a8f7eb78e19e85b (diff)
Introduce variables GLOBAL_CFLAGS and GLOBAL_CXXFLAGS
There are flags that must be set, so they shouldn't be overriden by
the user's CFLAGS or CXXFLAGS.
-rw-r--r--Makefile.lib4
-rw-r--r--Makefile.new3
2 files changed, 4 insertions, 3 deletions
diff --git a/Makefile.lib b/Makefile.lib
index 6c59c759695e..4df40c9d2cf4 100644
--- a/Makefile.lib
+++ b/Makefile.lib
@@ -24,10 +24,10 @@ dist_files :=
 QUIET = @
 
 %.o: %.cc
-	$(QUIET) $(CXX) -o $@ -c $< -g -fPIC $(CXXFLAGS) $($@_CXXFLAGS) -MMD -MF $(basename $@).dep -MP
+	$(QUIET) $(CXX) -o $@ -c $< -g -fPIC $(GLOBAL_CXXFLAGS) $(CXXFLAGS) $($@_CXXFLAGS) -MMD -MF $(basename $@).dep -MP
 
 %.o: %.c
-	$(QUIET) $(CC) -o $@ -c $< -g -fPIC $(CFLAGS) $($@_CFLAGS) -MMD -MF $(basename $@).dep -MP
+	$(QUIET) $(CC) -o $@ -c $< -g -fPIC $(GLOBAL_CFLAGS) $(CFLAGS) $($@_CFLAGS) -MMD -MF $(basename $@).dep -MP
 
 
 # Generate Make rules for libraries.
diff --git a/Makefile.new b/Makefile.new
index af2c4cec3c4d..1ae88d42fefc 100644
--- a/Makefile.new
+++ b/Makefile.new
@@ -10,6 +10,7 @@ SUBS = \
   src/nix-env/Makefile.new \
   src/nix-daemon/Makefile.new
 
+GLOBAL_CXXFLAGS = -I . -I src -I src/libutil -I src/libstore -I src/libmain -I src/libexpr
+
 include Makefile.lib
 
-CXXFLAGS += -I . -I src -I src/libutil -I src/libstore -I src/libmain -I src/libexpr -O0