132 $$($1_$2_DEP).raw) > $$($1_$2_DEP) |
132 $$($1_$2_DEP).raw) > $$($1_$2_DEP) |
133 endif |
133 endif |
134 endif |
134 endif |
135 endef |
135 endef |
136 |
136 |
|
137 # Setup make rules for creating a native binary (a shared library or an |
|
138 # executable). |
|
139 # |
|
140 # Parameter 1 is the name of the rule. This name is used as variable prefix, |
|
141 # and the targets generated are listed in a variable by that name. |
|
142 # |
|
143 # Remaining parameters are named arguments. These include: |
|
144 # SRC one or more directory roots to scan for C/C++ files. |
|
145 # LANG C or C++ |
|
146 # CFLAGS the compiler flags to be used, used both for C and C++. |
|
147 # CXXFLAGS the compiler flags to be used for c++, if set overrides CFLAGS. |
|
148 # LDFLAGS the linker flags to be used, used both for C and C++. |
|
149 # LDFLAGS_SUFFIX the linker flags to be added last on the commandline |
|
150 # typically the libraries linked to. |
|
151 # ARFLAGS the archiver flags to be used |
|
152 # OBJECT_DIR the directory where we store the object files |
|
153 # LIBRARY the resulting library file |
|
154 # PROGRAM the resulting exec file |
|
155 # INCLUDES only pick source from these directories |
|
156 # EXCLUDES do not pick source from these directories |
|
157 # INCLUDE_FILES only compile exactly these files! |
|
158 # EXCLUDE_FILES with these names |
|
159 # EXTRA_FILES List of extra files not in any of the SRC dirs |
|
160 # VERSIONINFO_RESOURCE Input file for RC. Setting this implies that RC will be run |
|
161 # RC_FLAGS flags for RC. |
|
162 # MAPFILE mapfile |
|
163 # REORDER reorder file |
|
164 # DEBUG_SYMBOLS add debug symbols (if configured on) |
|
165 # CC the compiler to use, default is $(CC) |
|
166 # LDEXE the linker to use for linking executables, default is $(LDEXE) |
|
167 # OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST |
137 define SetupNativeCompilation |
168 define SetupNativeCompilation |
138 # param 1 is for example BUILD_MYPACKAGE |
169 $(if $(27),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk)) |
139 # param 2,3,4,5,6,7,8 are named args. |
170 $(call EvalDebugWrapper,$(strip $1),$(call SetupNativeCompilationInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26))) |
140 # SRC one or more directory roots to scan for C/C++ files. |
171 endef |
141 # LANG C or C++ |
172 |
142 # CFLAGS the compiler flags to be used, used both for C and C++. |
173 define SetupNativeCompilationInner |
143 # CXXFLAGS the compiler flags to be used for c++, if set overrides CFLAGS. |
|
144 # LDFLAGS the linker flags to be used, used both for C and C++. |
|
145 # LDFLAGS_SUFFIX the linker flags to be added last on the commandline |
|
146 # typically the libraries linked to. |
|
147 # ARFLAGS the archiver flags to be used |
|
148 # OBJECT_DIR the directory where we store the object files |
|
149 # LIBRARY the resulting library file |
|
150 # PROGRAM the resulting exec file |
|
151 # INCLUDES only pick source from these directories |
|
152 # EXCLUDES do not pick source from these directories |
|
153 # INCLUDE_FILES only compile exactly these files! |
|
154 # EXCLUDE_FILES with these names |
|
155 # VERSIONINFO_RESOURCE Input file for RC. Setting this implies that RC will be run |
|
156 # RC_FLAGS flags for RC. |
|
157 # MAPFILE mapfile |
|
158 # REORDER reorder file |
|
159 # DEBUG_SYMBOLS add debug symbols (if configured on) |
|
160 # CC the compiler to use, default is $(CC) |
|
161 # LDEXE the linker to use for linking executables, default is $(LDEXE) |
|
162 # OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST |
|
163 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) |
174 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) |
164 $(call LogSetupMacroEntry,SetupNativeCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26)) |
175 $(call LogSetupMacroEntry,SetupNativeCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26)) |
165 $(if $(27),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk)) |
176 $(if $(27),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk)) |
166 |
177 |
167 ifneq (,$$($1_BIN)) |
178 ifneq (,$$($1_BIN)) |