< prev index next >

make/common/NativeCompilation.gmk

Print this page




 177 #   LDFLAGS the linker flags to be used, used both for C and C++.
 178 #   LDFLAGS_SUFFIX the linker flags to be added last on the commandline
 179 #       typically the libraries linked to.
 180 #   ARFLAGS the archiver flags to be used
 181 #   OBJECT_DIR the directory where we store the object files
 182 #   LIBRARY the resulting library file
 183 #   PROGRAM the resulting exec file
 184 #   INCLUDES only pick source from these directories
 185 #   EXCLUDES do not pick source from these directories
 186 #   INCLUDE_FILES only compile exactly these files!
 187 #   EXCLUDE_FILES with these names
 188 #   EXTRA_FILES List of extra files not in any of the SRC dirs
 189 #   VERSIONINFO_RESOURCE Input file for RC. Setting this implies that RC will be run
 190 #   RC_FLAGS flags for RC.
 191 #   MAPFILE mapfile
 192 #   REORDER reorder file
 193 #   DEBUG_SYMBOLS add debug symbols (if configured on)
 194 #   CC the compiler to use, default is $(CC)
 195 #   LDEXE the linker to use for linking executables, default is $(LDEXE)
 196 #   OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST

 197 define SetupNativeCompilation
 198   $(if $(27),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk))
 199   $(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)))
 200 endef
 201 
 202 define SetupNativeCompilationInner
 203   $(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 $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
 204   $(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))
 205   $(if $(27),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk))
 206 
 207   ifneq (,$$($1_BIN))
 208     $$(error BIN has been replaced with OBJECT_DIR)
 209   endif
 210 
 211   ifneq (,$$($1_LIB))
 212     $$(error LIB has been replaced with LIBRARY)
 213   endif
 214 
 215   ifneq (,$$($1_EXE))
 216     $$(error EXE has been replaced with PROGRAM)
 217   endif
 218 
 219   ifneq (,$$($1_LIBRARY))
 220     ifeq (,$$($1_OUTPUT_DIR))
 221       $$(error LIBRARY requires OUTPUT_DIR)
 222     endif
 223 
 224     ifneq ($$($1_LIBRARY),$(basename $$($1_LIBRARY)))
 225       $$(error directory of LIBRARY should be specified using OUTPUT_DIR)


 379     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_debug)
 380     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)_debug)
 381     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_debug)
 382   else
 383     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_release)
 384     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
 385     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_release)
 386   endif
 387 
 388   # Pickup extra OPENJDK_TARGET_OS_TYPE and/or OPENJDK_TARGET_OS dependent variables for CXXFLAGS.
 389   $1_EXTRA_CXXFLAGS:=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS))
 390   ifneq ($(DEBUG_LEVEL),release)
 391     # Pickup extra debug dependent variables for CXXFLAGS
 392     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_debug)
 393     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)_debug)
 394     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_debug)
 395   else
 396     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_release)
 397     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
 398     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release)






 399   endif
 400 
 401   ifeq ($$($1_DEBUG_SYMBOLS), true)
 402     ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
 403       ifdef OPENJDK
 404         # Always add debug symbols
 405         $1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS)
 406         $1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS)
 407       else
 408         # Programs don't get the debug symbols added in the old build. It's not clear if
 409         # this is intentional.
 410         ifeq ($$($1_PROGRAM),)
 411           $1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS)
 412           $1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS)
 413         endif
 414       endif
 415     endif
 416   endif
 417 
 418   ifeq ($$($1_CXXFLAGS),)




 177 #   LDFLAGS the linker flags to be used, used both for C and C++.
 178 #   LDFLAGS_SUFFIX the linker flags to be added last on the commandline
 179 #       typically the libraries linked to.
 180 #   ARFLAGS the archiver flags to be used
 181 #   OBJECT_DIR the directory where we store the object files
 182 #   LIBRARY the resulting library file
 183 #   PROGRAM the resulting exec file
 184 #   INCLUDES only pick source from these directories
 185 #   EXCLUDES do not pick source from these directories
 186 #   INCLUDE_FILES only compile exactly these files!
 187 #   EXCLUDE_FILES with these names
 188 #   EXTRA_FILES List of extra files not in any of the SRC dirs
 189 #   VERSIONINFO_RESOURCE Input file for RC. Setting this implies that RC will be run
 190 #   RC_FLAGS flags for RC.
 191 #   MAPFILE mapfile
 192 #   REORDER reorder file
 193 #   DEBUG_SYMBOLS add debug symbols (if configured on)
 194 #   CC the compiler to use, default is $(CC)
 195 #   LDEXE the linker to use for linking executables, default is $(LDEXE)
 196 #   OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST
 197 #   DISABLED_WARNINGS_<toolchain> Disable the given warnings for the specified toolchain
 198 define SetupNativeCompilation
 199   $(if $(30),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk))
 200   $(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),$(27),$(28),$(29)))
 201 endef
 202 
 203 define SetupNativeCompilationInner
 204   $(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 27 28 29, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
 205   $(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),$(27),$(28),$(29))
 206   $(if $(30),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk))
 207 
 208   ifneq (,$$($1_BIN))
 209     $$(error BIN has been replaced with OBJECT_DIR)
 210   endif
 211 
 212   ifneq (,$$($1_LIB))
 213     $$(error LIB has been replaced with LIBRARY)
 214   endif
 215 
 216   ifneq (,$$($1_EXE))
 217     $$(error EXE has been replaced with PROGRAM)
 218   endif
 219 
 220   ifneq (,$$($1_LIBRARY))
 221     ifeq (,$$($1_OUTPUT_DIR))
 222       $$(error LIBRARY requires OUTPUT_DIR)
 223     endif
 224 
 225     ifneq ($$($1_LIBRARY),$(basename $$($1_LIBRARY)))
 226       $$(error directory of LIBRARY should be specified using OUTPUT_DIR)


 380     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_debug)
 381     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)_debug)
 382     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_debug)
 383   else
 384     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_release)
 385     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
 386     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_release)
 387   endif
 388 
 389   # Pickup extra OPENJDK_TARGET_OS_TYPE and/or OPENJDK_TARGET_OS dependent variables for CXXFLAGS.
 390   $1_EXTRA_CXXFLAGS:=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS))
 391   ifneq ($(DEBUG_LEVEL),release)
 392     # Pickup extra debug dependent variables for CXXFLAGS
 393     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_debug)
 394     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)_debug)
 395     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_debug)
 396   else
 397     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_release)
 398     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
 399     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release)
 400   endif
 401 
 402   # Pick up disabled warnings, if possible on this platform.
 403   ifneq ($(DISABLE_WARNING_PREFIX),)
 404     $1_EXTRA_CFLAGS += $$(addprefix $(DISABLE_WARNING_PREFIX), $$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)))
 405     $1_EXTRA_CXXFLAGS += $$(addprefix $(DISABLE_WARNING_PREFIX), $$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)))
 406   endif
 407 
 408   ifeq ($$($1_DEBUG_SYMBOLS), true)
 409     ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
 410       ifdef OPENJDK
 411         # Always add debug symbols
 412         $1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS)
 413         $1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS)
 414       else
 415         # Programs don't get the debug symbols added in the old build. It's not clear if
 416         # this is intentional.
 417         ifeq ($$($1_PROGRAM),)
 418           $1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS)
 419           $1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS)
 420         endif
 421       endif
 422     endif
 423   endif
 424 
 425   ifeq ($$($1_CXXFLAGS),)


< prev index next >