From a35c6eb4a2209716fe1d40cebad2b3adb5d05e0f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 11 Feb 2014 14:15:57 +0100 Subject: Support setting CFLAGS and CXXFLAGS for libraries/programs --- programs.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'programs.mk') diff --git a/programs.mk b/programs.mk index ab04ff93e910..5e27a7d62fb1 100644 --- a/programs.mk +++ b/programs.mk @@ -8,6 +8,10 @@ programs-list := # # - $(1)_SOURCES: the source files of the program. # +# - $(1)_CFLAGS: additional C compiler flags. +# +# - $(1)_CXXFLAGS: additional C++ compiler flags. +# # - $(1)_LIBS: the symbolic names of libraries on which this program # depends. # @@ -48,7 +52,8 @@ define build-program endif - # Propagate CXXFLAGS to the individual object files. + # Propagate CFLAGS and CXXFLAGS to the individual object files. + $$(foreach obj, $$($(1)_OBJS), $$(eval $$(obj)_CFLAGS=$$($(1)_CFLAGS))) $$(foreach obj, $$($(1)_OBJS), $$(eval $$(obj)_CXXFLAGS=$$($(1)_CXXFLAGS))) # Make each object file depend on the common dependencies. -- cgit 1.4.1