From ea2f7df5fac0b319b82a4a33ba8b992737fa8c56 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 22 Nov 2013 20:38:30 +0100 Subject: [PATCH] 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. --- Makefile.lib | 4 ++-- Makefile.new | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile.lib b/Makefile.lib index 6c59c7596..4df40c9d2 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 af2c4cec3..1ae88d42f 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