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.
This commit is contained in:
Eelco Dolstra 2013-11-22 20:38:30 +01:00
parent 6b5f89f2cf
commit ea2f7df5fa
2 changed files with 4 additions and 3 deletions

View File

@ -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.

View File

@ -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