diff options
Diffstat (limited to 'Makefile.moddir_rules')
-rw-r--r-- | Makefile.moddir_rules | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Makefile.moddir_rules b/Makefile.moddir_rules index 72d4c2a8b..00494a8b5 100644 --- a/Makefile.moddir_rules +++ b/Makefile.moddir_rules @@ -54,10 +54,16 @@ endif # Both C++ and C++ sources need their module name in AST_MODULE # We also pass whatever _INCLUDE list is generated by menuselect -# (they are stored in file 'makeopts') +# (they are stored in file 'makeopts'). This is also necessary +# for components used to build modules, which can't be determined +# by the rules in this file, so the MOD_ASTCFLAGS definition +# is used to collect the required flags for a module... which can +# then be used any place they are required. + +MOD_ASTCFLAGS=-DAST_MODULE=\"$(1)\" $(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$(value $(dep)_INCLUDE)) $(addsuffix .oo,$(CC_MODS)) $(addsuffix .o,$(C_MODS)): \ - _ASTCFLAGS+= -DAST_MODULE=\"$*\" $(MENUSELECT_OPTS_$*:%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$*),$(value $(dep)_INCLUDE)) + _ASTCFLAGS+=$(call MOD_ASTCFLAGS,$*) ifeq ($(findstring $(OSARCH), mingw32 cygwin ),) # don't define -fPIC on mingw32 and cygwin, it is the default |