make/common/NativeCompilation.gmk
changeset 27602 236555ddac42
parent 27560 adc258b13e2c
parent 27593 4703225f5be4
child 28355 00a473df1a5b
child 28602 51c0dcf51b67
child 28902 0c09b47449c8
equal deleted inserted replaced
27581:9fffb959eb41 27602:236555ddac42
    32 
    32 
    33 ifeq (,$(_MAKEBASE_GMK))
    33 ifeq (,$(_MAKEBASE_GMK))
    34   $(error You must include MakeBase.gmk prior to including NativeCompilation.gmk)
    34   $(error You must include MakeBase.gmk prior to including NativeCompilation.gmk)
    35 endif
    35 endif
    36 
    36 
    37 ifneq ($(TOOLCHAIN_TYPE), microsoft)
    37 # Extensions of files handled by this macro.
    38   COMPILING_MSG=echo $(LOG_INFO) "Compiling $(notdir $1) (for $(notdir $2))"
    38 NATIVE_SOURCE_EXTENSIONS := %.s %.c %.cpp %.m %.mm
    39   LINKING_MSG=echo $(LOG_INFO) "Linking $1"
    39 
    40   LINKING_EXE_MSG=echo $(LOG_INFO) "Linking executable $1"
    40 # Replaces native source extensions with the object file extension in a string.
    41   ARCHIVING_MSG=echo $(LOG_INFO) "Archiving $1"
    41 # Param 1: the string containing source file names with extensions
    42 else
    42 # The surrounding strip is needed to keep additional whitespace out
    43   COMPILING_MSG=
    43 define replace_with_obj_extension
    44   LINKING_MSG=
    44 $(strip \
    45   LINKING_EXE_MSG=
    45   $(foreach extension, $(NATIVE_SOURCE_EXTENSIONS), \
    46   ARCHIVING_MSG=
    46       $(patsubst $(extension),%$(OBJ_SUFFIX),$(filter $(extension),$1))) \
    47 endif
    47 )
       
    48 endef
    48 
    49 
    49 ifeq ($(OPENJDK_BUILD_OS_ENV), windows.cygwin)
    50 ifeq ($(OPENJDK_BUILD_OS_ENV), windows.cygwin)
    50   UNIX_PATH_PREFIX := /cygdrive
    51   UNIX_PATH_PREFIX := /cygdrive
    51 else ifeq ($(OPENJDK_BUILD_OS_ENV), windows.msys)
    52 else ifeq ($(OPENJDK_BUILD_OS_ENV), windows.msys)
    52   UNIX_PATH_PREFIX :=
    53   UNIX_PATH_PREFIX :=
    53 endif
    54 endif
       
    55 
       
    56 WINDOWS_SHOWINCLUDE_SED_PATTERN := \
       
    57     -e '/^Note: including file:/!d' \
       
    58     -e 's|Note: including file: *||' \
       
    59     -e 's|\\|/|g' \
       
    60     -e 's|^\([a-zA-Z]\):|$(UNIX_PATH_PREFIX)/\1|g' \
       
    61     -e '/$(subst /,\/,$(TOPDIR))/!d' \
       
    62     -e 's|$$$$| \\|g' \
       
    63     #
    54 
    64 
    55 define add_native_source
    65 define add_native_source
    56   # param 1 = BUILD_MYPACKAGE
    66   # param 1 = BUILD_MYPACKAGE
    57   # parma 2 = the source file name (..../alfa.c or .../beta.cpp)
    67   # parma 2 = the source file name (..../alfa.c or .../beta.cpp)
    58   # param 3 = the bin dir that stores all .o (.obj) and .d files.
    68   # param 3 = the bin dir that stores all .o (.obj) and .d files.
    59   # param 4 = the c flags to the compiler
    69   # param 4 = the c flags to the compiler
    60   # param 5 = the c compiler
    70   # param 5 = the c compiler
    61   # param 6 = the c++ flags to the compiler
    71   # param 6 = the c++ flags to the compiler
    62   # param 7 = the c++ compiler
    72   # param 7 = the c++ compiler
    63   # param 8 = the flags to the assembler
    73   # param 8 = the objc compiler
       
    74   # param 9 = the flags to the assembler
    64 
    75 
    65   ifneq (,$$(filter %.c,$2))
    76   ifneq (,$$(filter %.c,$2))
    66     # Compile as a C file
    77     # Compile as a C file
    67     $1_$2_FLAGS=$4 $$($1_$(notdir $2)_CFLAGS) -DTHIS_FILE='"$$(<F)"' -c
    78     $1_$2_FLAGS=$4 $$($1_$(notdir $2)_CFLAGS) -DTHIS_FILE='"$$(<F)"' -c
    68     $1_$2_COMP=$5
    79     $1_$2_COMP=$5
    69     $1_$2_DEP_FLAG:=$(C_FLAG_DEPS)
    80     $1_$2_DEP_FLAG:=$(C_FLAG_DEPS)
    70   else ifneq (,$$(filter %.m,$2))
    81   else ifneq (,$$(filter %.m,$2))
    71     # Compile as a objective-c file
    82     # Compile as a objective-c file
    72     $1_$2_FLAGS=-x objective-c $4 $$($1_$(notdir $2)_CFLAGS) -DTHIS_FILE='"$$(<F)"' -c
    83     $1_$2_FLAGS=-x objective-c $4 $$($1_$(notdir $2)_CFLAGS) -DTHIS_FILE='"$$(<F)"' -c
    73     $1_$2_COMP=$5
    84     $1_$2_COMP=$8
    74     $1_$2_DEP_FLAG:=$(C_FLAG_DEPS)
    85     $1_$2_DEP_FLAG:=$(C_FLAG_DEPS)
    75   else ifneq (,$$(filter %.s,$2))
    86   else ifneq (,$$(filter %.s,$2))
    76     # Compile as assembler file
    87     # Compile as assembler file
    77     $1_$2_FLAGS=$8 -DTHIS_FILE='"$$(<F)"'
    88     $1_$2_FLAGS=$9 -DTHIS_FILE='"$$(<F)"'
    78     $1_$2_COMP=$(AS)
    89     $1_$2_COMP=$(AS)
    79     $1_$2_DEP_FLAG:=
    90     $1_$2_DEP_FLAG:=
    80   else
    91   else ifneq (,$$(filter %.cpp,$2)$$(filter %.mm,$2))
    81     # Compile as a C++ file
    92     # Compile as a C++ file
    82     $1_$2_FLAGS=$6 $$($1_$(notdir $2)_CXXFLAGS) -DTHIS_FILE='"$$(<F)"' -c
    93     $1_$2_FLAGS=$6 $$($1_$(notdir $2)_CXXFLAGS) -DTHIS_FILE='"$$(<F)"' -c
    83     $1_$2_COMP=$7
    94     $1_$2_COMP=$7
    84     $1_$2_DEP_FLAG:=$(CXX_FLAG_DEPS)
    95     $1_$2_DEP_FLAG:=$(CXX_FLAG_DEPS)
       
    96   else
       
    97     $$(error Internal error in NativeCompilation.gmk: no compiler for file $2)
    85   endif
    98   endif
    86   # Generate the .o (.obj) file name and place it in the bin dir.
    99   # Generate the .o (.obj) file name and place it in the bin dir.
    87   $1_$2_OBJ:=$3/$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(patsubst %.m,%$(OBJ_SUFFIX),$$(patsubst %.s,%$(OBJ_SUFFIX),$$(notdir $2)))))
   100   $1_$2_OBJ := $3/$$(call replace_with_obj_extension, $$(notdir $2))
    88   # Only continue if this object file hasn't been processed already. This lets the first found
   101   # Only continue if this object file hasn't been processed already. This lets the first found
    89   # source file override any other with the same name.
   102   # source file override any other with the same name.
    90   ifeq (,$$(findstring $$($1_$2_OBJ),$$($1_OBJS_SO_FAR)))
   103   ifeq (,$$(findstring $$($1_$2_OBJ),$$($1_ALL_OBJS)))
    91     $1_OBJS_SO_FAR+=$$($1_$2_OBJ)
   104     $1_ALL_OBJS+=$$($1_$2_OBJ)
    92     ifeq (,$$(filter %.s,$2))
   105     ifeq (,$$(filter %.s,$2))
    93       # And this is the dependency file for this obj file.
   106       # And this is the dependency file for this obj file.
    94       $1_$2_DEP:=$$(patsubst %$(OBJ_SUFFIX),%.d,$$($1_$2_OBJ))
   107       $1_$2_DEP:=$$(patsubst %$(OBJ_SUFFIX),%.d,$$($1_$2_OBJ))
    95       # Include previously generated dependency information. (if it exists)
   108       # Include previously generated dependency information. (if it exists)
    96       -include $$($1_$2_DEP)
   109       -include $$($1_$2_DEP)
    99         $1_$2_DEBUG_OUT_FLAGS:=-Fd$$(patsubst %$(OBJ_SUFFIX),%.pdb,$$($1_$2_OBJ)) \
   112         $1_$2_DEBUG_OUT_FLAGS:=-Fd$$(patsubst %$(OBJ_SUFFIX),%.pdb,$$($1_$2_OBJ)) \
   100             -Fm$$(patsubst %$(OBJ_SUFFIX),%.map,$$($1_$2_OBJ))
   113             -Fm$$(patsubst %$(OBJ_SUFFIX),%.map,$$($1_$2_OBJ))
   101       endif
   114       endif
   102     endif
   115     endif
   103 
   116 
   104     $$($1_$2_OBJ) : $2
   117     $$($1_$2_OBJ) : $2 | $$($1_BUILD_INFO)
       
   118 	$(ECHO) $(LOG_INFO) "Compiling $$(notdir $2) (for $$(notdir $$($1_TARGET)))"
   105         ifneq ($(TOOLCHAIN_TYPE), microsoft)
   119         ifneq ($(TOOLCHAIN_TYPE), microsoft)
   106 	  $$(call COMPILING_MSG,$2,$$($1_TARGET))
       
   107           # The Solaris studio compiler doesn't output the full path to the object file in the
   120           # The Solaris studio compiler doesn't output the full path to the object file in the
   108           # generated deps files. Fixing it with sed. If compiling assembly, don't try this.
   121           # generated deps files. Fixing it with sed. If compiling assembly, don't try this.
   109           ifeq ($(TOOLCHAIN_TYPE)$$(filter %.s,$2), solstudio)
   122           ifeq ($(TOOLCHAIN_TYPE)$$(filter %.s,$2), solstudio)
   110 	    $$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP).tmp $(CC_OUT_OPTION)$$($1_$2_OBJ) $2
   123 	    $$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP).tmp $(CC_OUT_OPTION)$$($1_$2_OBJ) $2
   111 	    $(SED) 's|^$$(@F):|$$@:|' $$($1_$2_DEP).tmp > $$($1_$2_DEP)
   124 	    $(SED) 's|^$$(@F):|$$@:|' $$($1_$2_DEP).tmp > $$($1_$2_DEP)
   117         # setting -showIncludes, all included files are printed. These are filtered out and
   130         # setting -showIncludes, all included files are printed. These are filtered out and
   118         # parsed into make dependences.
   131         # parsed into make dependences.
   119         ifeq ($(TOOLCHAIN_TYPE), microsoft)
   132         ifeq ($(TOOLCHAIN_TYPE), microsoft)
   120 	  ($$($1_$2_COMP) $$($1_$2_FLAGS) -showIncludes $$($1_$2_DEBUG_OUT_FLAGS) \
   133 	  ($$($1_$2_COMP) $$($1_$2_FLAGS) -showIncludes $$($1_$2_DEBUG_OUT_FLAGS) \
   121 	      $(CC_OUT_OPTION)$$($1_$2_OBJ) $2 ; echo $$$$? > $$($1_$2_DEP).exitvalue) \
   134 	      $(CC_OUT_OPTION)$$($1_$2_OBJ) $2 ; echo $$$$? > $$($1_$2_DEP).exitvalue) \
   122 	      | $(TEE) $$($1_$2_DEP).raw | $(GREP) -v "^Note: including file:" \
   135 	      | $(TEE) $$($1_$2_DEP).raw | $(GREP) -v -e "^Note: including file:" \
   123 	      && exit `cat $$($1_$2_DEP).exitvalue`
   136 	      -e "^$(notdir $2)$$$$" ; exit `cat $$($1_$2_DEP).exitvalue`
   124 	  $(RM) $$($1_$2_DEP).exitvalue
   137 	  $(RM) $$($1_$2_DEP).exitvalue
   125 	  ($(ECHO) $$@: \\ \
   138 	  ($(ECHO) $$@: \\ \
   126 	  && $(SED) -e '/^Note: including file:/!d' \
   139 	  && $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_$2_DEP).raw) > $$($1_$2_DEP)
   127 	      -e 's|Note: including file: *||' \
       
   128 	      -e 's|\\|/|g' \
       
   129 	      -e 's|^\([a-zA-Z]\):|$(UNIX_PATH_PREFIX)/\1|g' \
       
   130 	      -e '/$(subst /,\/,$(TOPDIR))/!d' \
       
   131 	      -e 's|$$$$| \\|g' \
       
   132 	      $$($1_$2_DEP).raw) > $$($1_$2_DEP)
       
   133         endif
   140         endif
   134   endif
   141   endif
   135 endef
   142 endef
   136 
   143 
       
   144 # Setup make rules for creating a native binary (a shared library or an
       
   145 # executable).
       
   146 #
       
   147 # Parameter 1 is the name of the rule. This name is used as variable prefix,
       
   148 # and the targets generated are listed in a variable by that name.
       
   149 #
       
   150 # Remaining parameters are named arguments. These include:
       
   151 #   SRC one or more directory roots to scan for C/C++ files.
       
   152 #   LANG C or C++
       
   153 #   CFLAGS the compiler flags to be used, used both for C and C++.
       
   154 #   CXXFLAGS the compiler flags to be used for c++, if set overrides CFLAGS.
       
   155 #   LDFLAGS the linker flags to be used, used both for C and C++.
       
   156 #   LDFLAGS_SUFFIX the linker flags to be added last on the commandline
       
   157 #       typically the libraries linked to.
       
   158 #   ARFLAGS the archiver flags to be used
       
   159 #   OBJECT_DIR the directory where we store the object files
       
   160 #   LIBRARY the resulting library file
       
   161 #   PROGRAM the resulting exec file
       
   162 #   INCLUDES only pick source from these directories
       
   163 #   EXCLUDES do not pick source from these directories
       
   164 #   INCLUDE_FILES only compile exactly these files!
       
   165 #   EXCLUDE_FILES with these names
       
   166 #   EXTRA_FILES List of extra files not in any of the SRC dirs
       
   167 #   VERSIONINFO_RESOURCE Input file for RC. Setting this implies that RC will be run
       
   168 #   RC_FLAGS flags for RC.
       
   169 #   MAPFILE mapfile
       
   170 #   REORDER reorder file
       
   171 #   DEBUG_SYMBOLS add debug symbols (if configured on)
       
   172 #   CC the compiler to use, default is $(CC)
       
   173 #   LDEXE the linker to use for linking executables, default is $(LDEXE)
       
   174 #   OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST
   137 define SetupNativeCompilation
   175 define SetupNativeCompilation
   138   # param 1 is for example BUILD_MYPACKAGE
   176   $(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.
   177   $(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.
   178 endef
   141   #   LANG C or C++
   179 
   142   #   CFLAGS the compiler flags to be used, used both for C and C++.
   180 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))
   181   $(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))
   182   $(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))
   183   $(if $(27),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk))
   166 
   184 
   167   ifneq (,$$($1_BIN))
   185   ifneq (,$$($1_BIN))
   191 
   209 
   192     ifneq (,$(findstring $(LIBRARY_PREFIX),$$($1_LIBRARY)))
   210     ifneq (,$(findstring $(LIBRARY_PREFIX),$$($1_LIBRARY)))
   193       $$(error LIBRARY should be specified without LIBRARY_PREFIX: $(LIBRARY_PREFIX))
   211       $$(error LIBRARY should be specified without LIBRARY_PREFIX: $(LIBRARY_PREFIX))
   194     endif
   212     endif
   195 
   213 
   196     $1_BASENAME:=$(LIBRARY_PREFIX)$$($1_LIBRARY)$(SHARED_LIBRARY_SUFFIX)
   214     ifeq ($$($1_SUFFIX), )
       
   215       $1_SUFFIX := $(SHARED_LIBRARY_SUFFIX)
       
   216     endif
       
   217 
       
   218     $1_BASENAME:=$(LIBRARY_PREFIX)$$($1_LIBRARY)$$($1_SUFFIX)
   197     $1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME)
   219     $1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME)
   198     $1_NOSUFFIX:=$(LIBRARY_PREFIX)$$($1_LIBRARY)
   220     $1_NOSUFFIX:=$(LIBRARY_PREFIX)$$($1_LIBRARY)
   199   endif
   221   endif
   200 
   222 
   201   ifneq (,$$($1_STATIC_LIBRARY))
   223   ifneq (,$$($1_STATIC_LIBRARY))
   213 
   235 
   214     ifneq (,$(findstring $(LIBRARY_PREFIX),$$($1_STATIC_LIBRARY)))
   236     ifneq (,$(findstring $(LIBRARY_PREFIX),$$($1_STATIC_LIBRARY)))
   215       $$(error STATIC_LIBRARY should be specified without LIBRARY_PREFIX: $(LIBRARY_PREFIX))
   237       $$(error STATIC_LIBRARY should be specified without LIBRARY_PREFIX: $(LIBRARY_PREFIX))
   216     endif
   238     endif
   217 
   239 
   218     $1_BASENAME:=$(LIBRARY_PREFIX)$$($1_STATIC_LIBRARY)$(STATIC_LIBRARY_SUFFIX)
   240     ifeq ($$($1_SUFFIX), )
       
   241       $1_SUFFIX := $(STATIC_LIBRARY_SUFFIX)
       
   242     endif
       
   243 
       
   244     $1_BASENAME:=$(LIBRARY_PREFIX)$$($1_STATIC_LIBRARY)$$($1_SUFFIX)
   219     $1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME)
   245     $1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME)
   220     $1_NOSUFFIX:=$(LIBRARY_PREFIX)$$($1_STATIC_LIBRARY)
   246     $1_NOSUFFIX:=$(LIBRARY_PREFIX)$$($1_STATIC_LIBRARY)
   221   endif
   247   endif
   222 
   248 
   223   ifneq (,$$($1_PROGRAM))
   249   ifneq (,$$($1_PROGRAM))
   231 
   257 
   232     ifneq (,$(findstring $(EXE_SUFFIX),$$($1_PROGRAM)))
   258     ifneq (,$(findstring $(EXE_SUFFIX),$$($1_PROGRAM)))
   233       $$(error PROGRAM should be specified without EXE_SUFFIX: $(EXE_SUFFIX))
   259       $$(error PROGRAM should be specified without EXE_SUFFIX: $(EXE_SUFFIX))
   234     endif
   260     endif
   235 
   261 
   236     $1_BASENAME:=$$($1_PROGRAM)$(EXE_SUFFIX)
   262     ifeq ($$($1_SUFFIX), )
       
   263       $1_SUFFIX := $(EXE_SUFFIX)
       
   264     endif
       
   265 
       
   266     $1_BASENAME:=$$($1_PROGRAM)$$($1_SUFFIX)
   237     $1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME)
   267     $1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME)
   238     $1_NOSUFFIX:=$$($1_PROGRAM)
   268     $1_NOSUFFIX:=$$($1_PROGRAM)
   239   endif
   269   endif
   240 
   270 
   241   ifeq (,$$($1_TARGET))
   271   ifeq (,$$($1_TARGET))
   247   endif
   277   endif
   248   ifeq (C,$$($1_LANG))
   278   ifeq (C,$$($1_LANG))
   249     ifeq ($$($1_LDEXE),)
   279     ifeq ($$($1_LDEXE),)
   250       $1_LDEXE:=$(LDEXE)
   280       $1_LDEXE:=$(LDEXE)
   251     endif
   281     endif
   252     $1_LD:=$(LD)
   282     ifeq ($$($1_LD),)
       
   283       $1_LD:=$(LD)
       
   284     endif
   253   else
   285   else
   254     ifeq (C++,$$($1_LANG))
   286     ifeq (C++,$$($1_LANG))
   255       $1_LD:=$(LDCXX)
   287       ifeq ($$($1_LD),)
   256       $1_LDEXE:=$(LDEXECXX)
   288         $1_LD:=$(LDCXX)
       
   289       endif
       
   290       ifeq ($$($1_LDEXE),)
       
   291         $1_LDEXE:=$(LDEXECXX)
       
   292       endif
   257     else
   293     else
   258       $$(error Unknown native language $$($1_LANG) for $1)
   294       $$(error Unknown native language $$($1_LANG) for $1)
   259     endif
   295     endif
   260   endif
   296   endif
   261 
   297 
   262   ifeq ($$($1_CC),)
   298   ifeq ($$($1_CC),)
   263     $1_CC:=$(CC)
   299     $1_CC:=$(CC)
       
   300   endif
       
   301   ifeq ($$($1_CXX),)
       
   302     $1_CXX:=$(CXX)
       
   303   endif
       
   304   ifeq ($$($1_OBJC),)
       
   305     $1_OBJC:=$(OBJC)
   264   endif
   306   endif
   265 
   307 
   266   # Make sure the dirs exist.
   308   # Make sure the dirs exist.
   267   $$(eval $$(call MakeDir,$$($1_OBJECT_DIR) $$($1_OUTPUT_DIR)))
   309   $$(eval $$(call MakeDir,$$($1_OBJECT_DIR) $$($1_OUTPUT_DIR)))
   268   $$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),,$$(error SRC specified to SetupNativeCompilation $1 contains missing directory $$d)))
   310   $$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),,$$(error SRC specified to SetupNativeCompilation $1 contains missing directory $$d)))
   273   $1_EXCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_EXCLUDE_FILES)))
   315   $1_EXCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_EXCLUDE_FILES)))
   274   $1_INCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_INCLUDE_FILES)))
   316   $1_INCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_INCLUDE_FILES)))
   275   ifneq ($$($1_EXCLUDE_FILES),)
   317   ifneq ($$($1_EXCLUDE_FILES),)
   276     $1_EXCLUDE_FILES:=$$(addprefix %,$$($1_EXCLUDE_FILES))
   318     $1_EXCLUDE_FILES:=$$(addprefix %,$$($1_EXCLUDE_FILES))
   277   endif
   319   endif
   278   $1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES),$$(filter %.s %.c %.cpp %.m,$$($1_ALL_SRCS)))
   320   $1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES),$$(filter $$(NATIVE_SOURCE_EXTENSIONS),$$($1_ALL_SRCS)))
   279   ifneq (,$$(strip $$($1_INCLUDE_FILES)))
   321   ifneq (,$$(strip $$($1_INCLUDE_FILES)))
   280     $1_SRCS := $$(filter $$($1_INCLUDE_FILES),$$($1_SRCS))
   322     $1_SRCS := $$(filter $$($1_INCLUDE_FILES),$$($1_SRCS))
   281   endif
   323   endif
   282   ifeq (,$$($1_SRCS))
   324   ifeq (,$$($1_SRCS))
   283     $$(error No sources found for $1 when looking inside the dirs $$($1_SRC))
   325     $$(error No sources found for $1 when looking inside the dirs $$($1_SRC))
   296     $1_SRC_EXCLUDES := $$(addsuffix /%,$$($1_EXCLUDES))
   338     $1_SRC_EXCLUDES := $$(addsuffix /%,$$($1_EXCLUDES))
   297     $1_SRC_EXCLUDES += $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES))))
   339     $1_SRC_EXCLUDES += $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES))))
   298     $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS))
   340     $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS))
   299   endif
   341   endif
   300 
   342 
       
   343   $1_SRCS += $$($1_EXTRA_FILES)
       
   344 
   301   # Calculate the expected output from compiling the sources (sort to remove duplicates. Also provides
   345   # Calculate the expected output from compiling the sources (sort to remove duplicates. Also provides
   302   # a reproducable order on the input files to the linker).
   346   # a reproducable order on the input files to the linker).
   303   $1_EXPECTED_OBJS:=$$(sort $$(addprefix $$($1_OBJECT_DIR)/,$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(patsubst %.m,%$(OBJ_SUFFIX),$$(patsubst %.s,%$(OBJ_SUFFIX),$$(notdir $$($1_SRCS))))))))
   347   $1_EXPECTED_OBJS_FILENAMES := $$(call replace_with_obj_extension, $$(notdir $$($1_SRCS)))
       
   348   $1_EXPECTED_OBJS:=$$(sort $$(addprefix $$($1_OBJECT_DIR)/,$$($1_EXPECTED_OBJS_FILENAMES)))
   304   # Are there too many object files on disk? Perhaps because some source file was removed?
   349   # Are there too many object files on disk? Perhaps because some source file was removed?
   305   $1_SUPERFLOUS_OBJS:=$$(sort $$(filter-out $$($1_EXPECTED_OBJS),$$($1_BINS)))
   350   $1_SUPERFLOUS_OBJS:=$$(sort $$(filter-out $$($1_EXPECTED_OBJS),$$($1_BINS)))
   306   # Clean out the superfluous object files.
   351   # Clean out the superfluous object files.
   307   ifneq ($$($1_SUPERFLUOUS_OBJS),)
   352   ifneq ($$($1_SUPERFLUOUS_OBJS),)
   308     $$(shell $(RM) -f $$($1_SUPERFLUOUS_OBJS))
   353     $$(shell $(RM) -f $$($1_SUPERFLUOUS_OBJS))
   309   endif
   354   endif
   310 
   355 
   311   # Pickup extra OPENJDK_TARGET_OS_API and/or OPENJDK_TARGET_OS dependent variables for CFLAGS.
   356   # Pickup extra OPENJDK_TARGET_OS_TYPE and/or OPENJDK_TARGET_OS dependent variables for CFLAGS.
   312   $1_EXTRA_CFLAGS:=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_API)) $$($1_CFLAGS_$(OPENJDK_TARGET_OS))
   357   $1_EXTRA_CFLAGS:=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_CFLAGS_$(OPENJDK_TARGET_OS))
   313   ifneq ($(DEBUG_LEVEL),release)
   358   ifneq ($(DEBUG_LEVEL),release)
   314     # Pickup extra debug dependent variables for CFLAGS
   359     # Pickup extra debug dependent variables for CFLAGS
   315     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_debug)
   360     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_debug)
   316     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_API)_debug)
   361     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)_debug)
   317     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_debug)
   362     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_debug)
   318   else
   363   else
   319     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_release)
   364     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_release)
   320     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_API)_release)
   365     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
   321     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_release)
   366     $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_release)
   322   endif
   367   endif
   323 
   368 
   324   # Pickup extra OPENJDK_TARGET_OS_API and/or OPENJDK_TARGET_OS dependent variables for CXXFLAGS.
   369   # Pickup extra OPENJDK_TARGET_OS_TYPE and/or OPENJDK_TARGET_OS dependent variables for CXXFLAGS.
   325   $1_EXTRA_CXXFLAGS:=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_API)) $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS))
   370   $1_EXTRA_CXXFLAGS:=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS))
   326   ifneq ($(DEBUG_LEVEL),release)
   371   ifneq ($(DEBUG_LEVEL),release)
   327     # Pickup extra debug dependent variables for CXXFLAGS
   372     # Pickup extra debug dependent variables for CXXFLAGS
   328     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_debug)
   373     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_debug)
   329     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_API)_debug)
   374     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)_debug)
   330     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_debug)
   375     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_debug)
   331   else
   376   else
   332     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_release)
   377     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_release)
   333     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_API)_release)
   378     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
   334     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release)
   379     $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release)
   335   endif
   380   endif
   336 
   381 
   337   ifneq (,$$($1_DEBUG_SYMBOLS))
   382   ifeq ($$($1_DEBUG_SYMBOLS), true)
   338     ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
   383     ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
   339       ifdef OPENJDK
   384       ifdef OPENJDK
   340         # Always add debug symbols
   385         # Always add debug symbols
   341         $1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS)
   386         $1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS)
   342         $1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS)
   387         $1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS)
   377     $1_EXTRA_CXXFLAGS += $(CXX_O_FLAG_HIGHEST)
   422     $1_EXTRA_CXXFLAGS += $(CXX_O_FLAG_HIGHEST)
   378   else ifneq (, $$($1_OPTIMIZATION))
   423   else ifneq (, $$($1_OPTIMIZATION))
   379     $$(error Unknown value for OPTIMIZATION: $$($1_OPTIMIZATION))
   424     $$(error Unknown value for OPTIMIZATION: $$($1_OPTIMIZATION))
   380   endif
   425   endif
   381 
   426 
   382   # Add sys root specific cflags last
   427   $1_BUILD_INFO := $$($1_OBJECT_DIR)/_build-info.marker
   383   $1_EXTRA_CFLAGS += $(SYSROOT_CFLAGS)
   428 
   384   $1_EXTRA_CXXFLAGS += $(SYSROOT_CFLAGS)
   429   # Setup rule for printing progress info when compiling source files.
       
   430   # This is a rough heuristic and may not always print accurate information.
       
   431   $$($1_BUILD_INFO): $$($1_SRCS)
       
   432         ifeq ($$(wildcard $$($1_TARGET)),)
       
   433 	  $(ECHO) 'Creating $$($1_BASENAME) from $$(words $$?) file(s)'
       
   434         else
       
   435 	  $(ECHO) 'Updating $$($1_BASENAME) from $$(words $$?) file(s)'
       
   436         endif
       
   437 	$(TOUCH) $$@
   385 
   438 
   386   # Now call add_native_source for each source file we are going to compile.
   439   # Now call add_native_source for each source file we are going to compile.
   387   $$(foreach p,$$($1_SRCS), \
   440   $$(foreach p,$$($1_SRCS), \
   388       $$(eval $$(call add_native_source,$1,$$p,$$($1_OBJECT_DIR), \
   441       $$(eval $$(call add_native_source,$1,$$p,$$($1_OBJECT_DIR), \
   389           $$($1_CFLAGS) $$($1_EXTRA_CFLAGS),$$($1_CC), \
   442           $(SYSROOT_CFLAGS) $$($1_CFLAGS) $$($1_EXTRA_CFLAGS),$$($1_CC), \
   390           $$($1_CXXFLAGS) $$($1_EXTRA_CXXFLAGS),$(CXX),$$($1_ASFLAGS))))
   443           $(SYSROOT_CFLAGS) $$($1_CXXFLAGS) $$($1_EXTRA_CXXFLAGS),$$($1_CXX),$$($1_OBJC),$$($1_ASFLAGS))))
   391 
   444 
   392   # On windows we need to create a resource file
   445   # On windows we need to create a resource file
   393   ifeq ($(OPENJDK_TARGET_OS), windows)
   446   ifeq ($(OPENJDK_TARGET_OS), windows)
   394     ifneq (,$$($1_VERSIONINFO_RESOURCE))
   447     ifneq (,$$($1_VERSIONINFO_RESOURCE))
   395       $1_RES:=$$($1_OBJECT_DIR)/$$($1_BASENAME).res
   448       $1_RES:=$$($1_OBJECT_DIR)/$$($1_BASENAME).res
       
   449       $1_RES_DEP:=$$($1_RES).d
       
   450       -include $$($1_RES_DEP)
   396       $$($1_RES): $$($1_VERSIONINFO_RESOURCE)
   451       $$($1_RES): $$($1_VERSIONINFO_RESOURCE)
       
   452 		$(ECHO) $(LOG_INFO) "Compiling resource $$(notdir $$($1_VERSIONINFO_RESOURCE)) (for $$(notdir $$($1_TARGET)))"
   397 		$(RC) $$($1_RC_FLAGS) $(CC_OUT_OPTION)$$@ $$($1_VERSIONINFO_RESOURCE)
   453 		$(RC) $$($1_RC_FLAGS) $(CC_OUT_OPTION)$$@ $$($1_VERSIONINFO_RESOURCE)
       
   454                 # Windows RC compiler does not support -showIncludes, so we mis-use CL for this.
       
   455 		$(CC) $$($1_RC_FLAGS) -showIncludes -nologo -TC \
       
   456 		    $(CC_OUT_OPTION)$$($1_RES_DEP).obj $$($1_VERSIONINFO_RESOURCE) > $$($1_RES_DEP).raw 2>&1 || exit 0
       
   457 		($(ECHO) $$($1_RES): \\ \
       
   458 		&& $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_RES_DEP).raw) > $$($1_RES_DEP)
   398     endif
   459     endif
   399     ifneq (,$$($1_MANIFEST))
   460     ifneq (,$$($1_MANIFEST))
   400       $1_GEN_MANIFEST:=$$($1_OBJECT_DIR)/$$($1_PROGRAM).manifest
   461       $1_GEN_MANIFEST:=$$($1_OBJECT_DIR)/$$($1_PROGRAM).manifest
   401       IMVERSIONVALUE:=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VERSION).$(COOKED_BUILD_NUMBER)
   462       IMVERSIONVALUE:=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VERSION).$(COOKED_BUILD_NUMBER)
   402       $$($1_GEN_MANIFEST): $$($1_MANIFEST)
   463       $$($1_GEN_MANIFEST): $$($1_MANIFEST)
   418 		$$(MV) $$@.tmp $$@
   479 		$$(MV) $$@.tmp $$@
   419       endif
   480       endif
   420     endif
   481     endif
   421   endif
   482   endif
   422 
   483 
   423   # Pickup extra OPENJDK_TARGET_OS_API and/or OPENJDK_TARGET_OS dependent variables
   484   # Pickup extra OPENJDK_TARGET_OS_TYPE and/or OPENJDK_TARGET_OS dependent variables
   424   # for LDFLAGS and LDFLAGS_SUFFIX
   485   # for LDFLAGS and LDFLAGS_SUFFIX
   425   $1_EXTRA_LDFLAGS:=$$($1_LDFLAGS_$(OPENJDK_TARGET_OS_API)) $$($1_LDFLAGS_$(OPENJDK_TARGET_OS))
   486   $1_EXTRA_LDFLAGS:=$$($1_LDFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LDFLAGS_$(OPENJDK_TARGET_OS))
   426   $1_EXTRA_LDFLAGS_SUFFIX:=$$($1_LDFLAGS_SUFFIX_$(OPENJDK_TARGET_OS_API)) $$($1_LDFLAGS_SUFFIX_$(OPENJDK_TARGET_OS))
   487   $1_EXTRA_LDFLAGS_SUFFIX:=$$($1_LDFLAGS_SUFFIX_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LDFLAGS_SUFFIX_$(OPENJDK_TARGET_OS))
   427   ifneq (,$$($1_REAL_MAPFILE))
   488   ifneq (,$$($1_REAL_MAPFILE))
   428     $1_EXTRA_LDFLAGS += $(call SET_SHARED_LIBRARY_MAPFILE,$$($1_REAL_MAPFILE))
   489     $1_EXTRA_LDFLAGS += $(call SET_SHARED_LIBRARY_MAPFILE,$$($1_REAL_MAPFILE))
   429   endif
   490   endif
   430 
       
   431   $1_EXTRA_LDFLAGS += $(SYSROOT_LDFLAGS)
       
   432 
   491 
   433   # Need to make sure TARGET is first on list
   492   # Need to make sure TARGET is first on list
   434   $1 := $$($1_TARGET)
   493   $1 := $$($1_TARGET)
   435   ifeq ($$($1_STATIC_LIBRARY),)
   494   ifeq ($$($1_STATIC_LIBRARY),)
   436     ifneq ($$($1_DEBUG_SYMBOLS),)
   495     ifeq ($$($1_DEBUG_SYMBOLS), true)
   437       ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
   496       ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
   438         ifneq ($(OPENJDK_TARGET_OS), macosx) # no MacOS X support yet
   497         ifneq ($(OPENJDK_TARGET_OS), macosx) # no MacOS X support yet
   439           ifneq ($$($1_OUTPUT_DIR),$$($1_OBJECT_DIR))
   498           ifneq ($$($1_OUTPUT_DIR),$$($1_OBJECT_DIR))
   440             # The dependency on TARGET is needed on windows for debuginfo files
   499             # The dependency on TARGET is needed on windows for debuginfo files
   441             # to be rebuilt properly.
   500             # to be rebuilt properly.
   515     $1_EXTRA_LDFLAGS_SUFFIX += $(GLOBAL_LDFLAGS_SUFFIX)
   574     $1_EXTRA_LDFLAGS_SUFFIX += $(GLOBAL_LDFLAGS_SUFFIX)
   516 
   575 
   517     $$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_REAL_MAPFILE) \
   576     $$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_REAL_MAPFILE) \
   518         $$($1_DEBUGINFO_EXTRA_DEPS)
   577         $$($1_DEBUGINFO_EXTRA_DEPS)
   519 		$$(call LINKING_MSG,$$($1_BASENAME))
   578 		$$(call LINKING_MSG,$$($1_BASENAME))
   520 		$$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(LD_OUT_OPTION)$$@ \
   579 		$$($1_LD) $(SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(LD_OUT_OPTION)$$@ \
   521 		    $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) \
   580 		    $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) \
   522 		    $$($1_EXTRA_LDFLAGS_SUFFIX)
   581 		    $$($1_EXTRA_LDFLAGS_SUFFIX)
   523 		$$($1_CREATE_DEBUGINFO_CMDS)
   582 		$$($1_CREATE_DEBUGINFO_CMDS)
   524                 # Touch target to make sure it has a later time stamp than the debug
   583                 # Touch target to make sure it has a later time stamp than the debug
   525                 # symbol files to avoid unnecessary relinking on rebuild.
   584                 # symbol files to avoid unnecessary relinking on rebuild.
   530   endif
   589   endif
   531 
   590 
   532   ifneq (,$$($1_STATIC_LIBRARY))
   591   ifneq (,$$($1_STATIC_LIBRARY))
   533     # Generating a static library, ie object file archive.
   592     # Generating a static library, ie object file archive.
   534     $$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES)
   593     $$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES)
   535 	$$(call ARCHIVING_MSG,$$($1_LIBRARY))
   594 	$(ECHO) $(LOG_INFO) "Archiving $$($1_STATIC_LIBRARY)"
   536 	$(AR) $$($1_ARFLAGS) $(AR_OUT_OPTION)$$($1_TARGET) $$($1_EXPECTED_OBJS) \
   595 	$(AR) $$($1_ARFLAGS) $(AR_OUT_OPTION)$$($1_TARGET) $$($1_EXPECTED_OBJS) \
   537 	    $$($1_RES) $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)
   596 	    $$($1_RES) $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)
   538   endif
   597   endif
   539 
   598 
   540   ifneq (,$$($1_PROGRAM))
   599   ifneq (,$$($1_PROGRAM))
   542     $1_EXTRA_LDFLAGS_SUFFIX += $(GLOBAL_LDFLAGS_SUFFIX)
   601     $1_EXTRA_LDFLAGS_SUFFIX += $(GLOBAL_LDFLAGS_SUFFIX)
   543 
   602 
   544     $$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_GEN_MANIFEST) \
   603     $$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_GEN_MANIFEST) \
   545         $$($1_DEBUGINFO_EXTRA_DEPS)
   604         $$($1_DEBUGINFO_EXTRA_DEPS)
   546 		$$(call LINKING_EXE_MSG,$$($1_BASENAME))
   605 		$$(call LINKING_EXE_MSG,$$($1_BASENAME))
   547 		$$($1_LDEXE) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(EXE_OUT_OPTION)$$($1_TARGET) \
   606 		$$($1_LDEXE) $(SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(EXE_OUT_OPTION)$$($1_TARGET) \
   548 		    $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) \
   607 		    $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) \
   549 		    $$($1_EXTRA_LDFLAGS_SUFFIX)
   608 		    $$($1_EXTRA_LDFLAGS_SUFFIX)
   550                 ifneq (,$$($1_GEN_MANIFEST))
   609                 ifneq (,$$($1_GEN_MANIFEST))
   551 		  $(MT) -nologo -manifest $$($1_GEN_MANIFEST) -outputresource:$$@;#1
   610 		  $(MT) -nologo -manifest $$($1_GEN_MANIFEST) -outputresource:$$@;#1
   552                 endif
   611                 endif