aboutsummaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-03-01 13:08:14 +0100
committerGitHub <noreply@github.com>2021-03-01 13:08:14 +0100
commit99b93773de73426a2952b53962652b830e1739e1 (patch)
treea52b33f69eede8ca72462bdce2915e04187f5cb1 /mk
parentc32a7c3404702b1f4d216ccc46802951f3801136 (diff)
parentbd0b0f9ab7655553f64f158d5d9a9445f5604abd (diff)
Merge pull request #4582 from puckipedia/cppflags
mk: add support for CPPFLAGS
Diffstat (limited to 'mk')
-rw-r--r--mk/lib.mk1
-rw-r--r--mk/patterns.mk6
2 files changed, 4 insertions, 3 deletions
diff --git a/mk/lib.mk b/mk/lib.mk
index 6a1c465b6..975102531 100644
--- a/mk/lib.mk
+++ b/mk/lib.mk
@@ -143,4 +143,5 @@ endif
@echo " CFLAGS: Flags for the C compiler"
@echo " CXX ($(CXX)): C++ compiler to be used"
@echo " CXXFLAGS: Flags for the C++ compiler"
+ @echo " CPPFLAGS: C preprocessor flags, used for both CC and CXX"
@$(print-var-help)
diff --git a/mk/patterns.mk b/mk/patterns.mk
index 7319f4cdd..86a724806 100644
--- a/mk/patterns.mk
+++ b/mk/patterns.mk
@@ -1,11 +1,11 @@
$(buildprefix)%.o: %.cc
@mkdir -p "$(dir $@)"
- $(trace-cxx) $(CXX) -o $@ -c $< $(GLOBAL_CXXFLAGS_PCH) $(GLOBAL_CXXFLAGS) $(CXXFLAGS) $($@_CXXFLAGS) -MMD -MF $(call filename-to-dep, $@) -MP
+ $(trace-cxx) $(CXX) -o $@ -c $< $(CPPFLAGS) $(GLOBAL_CXXFLAGS_PCH) $(GLOBAL_CXXFLAGS) $(CXXFLAGS) $($@_CXXFLAGS) -MMD -MF $(call filename-to-dep, $@) -MP
$(buildprefix)%.o: %.cpp
@mkdir -p "$(dir $@)"
- $(trace-cxx) $(CXX) -o $@ -c $< $(GLOBAL_CXXFLAGS_PCH) $(GLOBAL_CXXFLAGS) $(CXXFLAGS) $($@_CXXFLAGS) -MMD -MF $(call filename-to-dep, $@) -MP
+ $(trace-cxx) $(CXX) -o $@ -c $< $(CPPFLAGS) $(GLOBAL_CXXFLAGS_PCH) $(GLOBAL_CXXFLAGS) $(CXXFLAGS) $($@_CXXFLAGS) -MMD -MF $(call filename-to-dep, $@) -MP
$(buildprefix)%.o: %.c
@mkdir -p "$(dir $@)"
- $(trace-cc) $(CC) -o $@ -c $< $(GLOBAL_CFLAGS) $(CFLAGS) $($@_CFLAGS) -MMD -MF $(call filename-to-dep, $@) -MP
+ $(trace-cc) $(CC) -o $@ -c $< $(CPPFLAGS) $(GLOBAL_CFLAGS) $(CFLAGS) $($@_CFLAGS) -MMD -MF $(call filename-to-dep, $@) -MP