< prev index next >

make/common/NativeCompilation.gmk

Print this page

        

*** 1,7 **** # ! # Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 only, as # published by the Free Software Foundation. Oracle designates this --- 1,7 ---- # ! # Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 only, as # published by the Free Software Foundation. Oracle designates this
*** 173,185 **** $(foreach extension, $(NATIVE_SOURCE_EXTENSIONS), \ $(patsubst $(extension),%$(OBJ_SUFFIX), $(filter $(extension), $1))) \ ) endef ! ifeq ($(call isBuildOsEnv, windows.cygwin), true) UNIX_PATH_PREFIX := /cygdrive ! else ifeq ($(call isBuildOsEnv, windows.msys), true) UNIX_PATH_PREFIX := endif # This pattern is used to transform the output of the microsoft CL compiler # into a make syntax dependency file (.d) --- 173,185 ---- $(foreach extension, $(NATIVE_SOURCE_EXTENSIONS), \ $(patsubst $(extension),%$(OBJ_SUFFIX), $(filter $(extension), $1))) \ ) endef ! ifeq ($(OPENJDK_BUILD_OS_ENV), windows.cygwin) UNIX_PATH_PREFIX := /cygdrive ! else ifeq ($(OPENJDK_BUILD_OS_ENV), windows.msys) UNIX_PATH_PREFIX := endif # This pattern is used to transform the output of the microsoft CL compiler # into a make syntax dependency file (.d)
*** 229,247 **** $$(OUTPUTDIR)/,,$$($1_OBJ))).json $$($1_BASE)_ALL_OBJS_JSON += $$($1_OBJ_JSON) # Only continue if this object file hasn't been processed already. This lets # the first found source file override any other with the same name. ! ifeq ($$($1_OBJ_PROCESSED), ) ! $1_OBJ_PROCESSED := true # This is the definite source file to use for $1_FILENAME. $1_SRC_FILE := $$($1_FILE) ! ifneq ($$($1_DEFINE_THIS_FILE), false) ! ifneq ($$($$($1_BASE)_DEFINE_THIS_FILE), false) ! $1_THIS_FILE = -DTHIS_FILE='"$$($1_FILENAME)"' ! endif endif ifeq ($$($1_OPTIMIZATION), ) $1_OPT_CFLAGS := $$($$($1_BASE)_OPT_CFLAGS) $1_OPT_CXXFLAGS := $$($$($1_BASE)_OPT_CXXFLAGS) --- 229,245 ---- $$(OUTPUTDIR)/,,$$($1_OBJ))).json $$($1_BASE)_ALL_OBJS_JSON += $$($1_OBJ_JSON) # Only continue if this object file hasn't been processed already. This lets # the first found source file override any other with the same name. ! ifeq ($$(findstring $$($1_OBJ), $$($$($1_BASE)_OBJS_SO_FAR)), ) ! $$($1_BASE)_OBJS_SO_FAR += $$($1_OBJ) # This is the definite source file to use for $1_FILENAME. $1_SRC_FILE := $$($1_FILE) ! ifneq ($$($1_DISABLE_THIS_FILE_DEFINE), true) ! $1_THIS_FILE = -DTHIS_FILE='"$$(<F)"' endif ifeq ($$($1_OPTIMIZATION), ) $1_OPT_CFLAGS := $$($$($1_BASE)_OPT_CFLAGS) $1_OPT_CXXFLAGS := $$($$($1_BASE)_OPT_CXXFLAGS)
*** 308,329 **** $$(error Internal error in NativeCompilation.gmk: no compiler for file $$($1_FILENAME)) endif ifeq ($$(filter %.s %.S, $$($1_FILENAME)), ) # And this is the dependency file for this obj file. ! $1_DEPS_FILE := $$(patsubst %$(OBJ_SUFFIX),%.d,$$($1_OBJ)) # The dependency target file lists all dependencies as empty targets to # avoid make error "No rule to make target" for removed files ! $1_DEPS_TARGETS_FILE := $$(patsubst %$(OBJ_SUFFIX),%.d.targets,$$($1_OBJ)) ! # Only try to load individual dependency information files if the global ! # file hasn't been loaded (could happen if make was interrupted). ! ifneq ($$($$($1_BASE)_DEPS_FILE_LOADED), true) ! # Include previously generated dependency information. (if it exists) ! -include $$($1_DEPS_FILE) ! -include $$($1_DEPS_TARGETS_FILE) ! endif endif ifneq ($$(strip $$($1_CFLAGS) $$($1_CXXFLAGS) $$($1_OPTIMIZATION)), ) $1_VARDEPS := $$($1_CFLAGS) $$($1_CXXFLAGS) $$($1_OPTIMIZATION) $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_OBJ).vardeps) --- 306,323 ---- $$(error Internal error in NativeCompilation.gmk: no compiler for file $$($1_FILENAME)) endif ifeq ($$(filter %.s %.S, $$($1_FILENAME)), ) # And this is the dependency file for this obj file. ! $1_DEP := $$(patsubst %$(OBJ_SUFFIX),%.d,$$($1_OBJ)) # The dependency target file lists all dependencies as empty targets to # avoid make error "No rule to make target" for removed files ! $1_DEP_TARGETS := $$(patsubst %$(OBJ_SUFFIX),%.d.targets,$$($1_OBJ)) ! # Include previously generated dependency information. (if it exists) ! -include $$($1_DEP) ! -include $$($1_DEP_TARGETS) endif ifneq ($$(strip $$($1_CFLAGS) $$($1_CXXFLAGS) $$($1_OPTIMIZATION)), ) $1_VARDEPS := $$($1_CFLAGS) $$($1_CXXFLAGS) $$($1_OPTIMIZATION) $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_OBJ).vardeps)
*** 344,363 **** ifeq ($(TOOLCHAIN_TYPE)$$(filter %.s, $$($1_FILENAME)), solstudio) # The Solaris studio compiler doesn't output the full path to the # object file in the generated deps files. Fixing it with sed. If # compiling assembly, don't try this. $$(call ExecuteWithLog, $$@, \ ! $$($1_COMPILER) $$($1_DEP_FLAG) $$($1_DEPS_FILE).tmp $$($1_COMPILE_OPTIONS)) ! $(SED) 's|^$$(@F):|$$@:|' $$($1_DEPS_FILE).tmp > $$($1_DEPS_FILE) else $$(call ExecuteWithLog, $$@, \ ! $$($1_COMPILER) $$($1_DEP_FLAG) $$($1_DEPS_FILE) $$($1_COMPILE_OPTIONS)) endif # Create a dependency target file from the dependency file. # Solution suggested by http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/ ! ifneq ($$($1_DEPS_FILE), ) ! $(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_DEPS_FILE) > $$($1_DEPS_TARGETS_FILE) endif else # The Visual Studio compiler lacks a feature for generating make # dependencies, but by setting -showIncludes, all included files are # printed. These are filtered out and parsed into make dependences. --- 338,357 ---- ifeq ($(TOOLCHAIN_TYPE)$$(filter %.s, $$($1_FILENAME)), solstudio) # The Solaris studio compiler doesn't output the full path to the # object file in the generated deps files. Fixing it with sed. If # compiling assembly, don't try this. $$(call ExecuteWithLog, $$@, \ ! $$($1_COMPILER) $$($1_DEP_FLAG) $$($1_DEP).tmp $$($1_COMPILE_OPTIONS)) ! $(SED) 's|^$$(@F):|$$@:|' $$($1_DEP).tmp > $$($1_DEP) else $$(call ExecuteWithLog, $$@, \ ! $$($1_COMPILER) $$($1_DEP_FLAG) $$($1_DEP) $$($1_COMPILE_OPTIONS)) endif # Create a dependency target file from the dependency file. # Solution suggested by http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/ ! ifneq ($$($1_DEP), ) ! $(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_DEP) > $$($1_DEP_TARGETS) endif else # The Visual Studio compiler lacks a feature for generating make # dependencies, but by setting -showIncludes, all included files are # printed. These are filtered out and parsed into make dependences.
*** 367,381 **** # pipefail is always active on Windows. $$(call ExecuteWithLog, $$@, \ $$($1_COMPILER) -showIncludes $$($1_COMPILE_OPTIONS)) \ | $(TR) -d '\r' | $(GREP) -v -e "^Note: including file:" \ -e "^$$($1_FILENAME)$$$$" || test "$$$$?" = "1" ; \ ! $(ECHO) $$@: \\ > $$($1_DEPS_FILE) ; \ $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_OBJ).log \ ! | $(SORT) -u >> $$($1_DEPS_FILE) ; \ ! $(ECHO) >> $$($1_DEPS_FILE) ; \ ! $(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_DEPS_FILE) > $$($1_DEPS_TARGETS_FILE) endif endif endef # Setup make rules for creating a native binary (a shared library or an --- 361,374 ---- # pipefail is always active on Windows. $$(call ExecuteWithLog, $$@, \ $$($1_COMPILER) -showIncludes $$($1_COMPILE_OPTIONS)) \ | $(TR) -d '\r' | $(GREP) -v -e "^Note: including file:" \ -e "^$$($1_FILENAME)$$$$" || test "$$$$?" = "1" ; \ ! $(ECHO) $$@: \\ > $$($1_DEP) ; \ $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_OBJ).log \ ! | $(SORT) -u >> $$($1_DEP) ; \ ! $(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_DEP) > $$($1_DEP_TARGETS) endif endif endef # Setup make rules for creating a native binary (a shared library or an
*** 427,437 **** # ZIP_EXTERNAL_DEBUG_SYMBOLS Set to false to override global setting of debug symbol # zipping # STRIPFLAGS Optionally change the flags given to the strip command # PRECOMPILED_HEADER Header file to use as precompiled header # PRECOMPILED_HEADER_EXCLUDE List of source files that should not use PCH - # DEFINE_THIS_FILE Set to false to not set the THIS_FILE preprocessor macro # # After being called, some variables are exported from this macro, all prefixed # with parameter 1 followed by a '_': # TARGET The library or executable created by the macro # TARGET_DEPS All prerequisites for the target calculated by the macro --- 420,429 ----
*** 492,504 **** $1_BASENAME := $$($1_PREFIX)$$($1_NAME)$$($1_SUFFIX) $1_TARGET := $$($1_OUTPUT_DIR)/$$($1_BASENAME) $1_NOSUFFIX := $$($1_PREFIX)$$($1_NAME) $1_SAFE_NAME := $$(strip $$(subst /,_, $1)) - # Need to make sure TARGET is first on list - $1 := $$($1_TARGET) - # Setup the toolchain to be used $$(call SetIfEmpty, $1_TOOLCHAIN, TOOLCHAIN_DEFAULT) $$(call SetIfEmpty, $1_CC, $$($$($1_TOOLCHAIN)_CC)) $$(call SetIfEmpty, $1_CXX, $$($$($1_TOOLCHAIN)_CXX)) $$(call SetIfEmpty, $1_LD, $$($$($1_TOOLCHAIN)_LD)) --- 484,493 ----
*** 514,526 **** # Make sure the dirs exist. $$(call MakeDir, $$($1_OBJECT_DIR) $$($1_OUTPUT_DIR)) $$(foreach d, $$($1_SRC), $$(if $$(wildcard $$d), , \ $$(error SRC specified to SetupNativeCompilation $1 contains missing directory $$d))) ! $1_SRCS_RAW := $$(call FindFiles, $$($1_SRC)) ! # Order src files according to the order of the src dirs ! $1_SRCS := $$(foreach d, $$($1_SRC), $$(filter $$d%, $$($1_SRCS_RAW))) $1_SRCS := $$(filter $$(NATIVE_SOURCE_EXTENSIONS), $$($1_SRCS)) # Extract the C/C++ files. ifneq ($$($1_EXCLUDE_PATTERNS), ) # We must not match the exclude pattern against the src root(s). $1_SRCS_WITHOUT_ROOTS := $$($1_SRCS) --- 503,514 ---- # Make sure the dirs exist. $$(call MakeDir, $$($1_OBJECT_DIR) $$($1_OUTPUT_DIR)) $$(foreach d, $$($1_SRC), $$(if $$(wildcard $$d), , \ $$(error SRC specified to SetupNativeCompilation $1 contains missing directory $$d))) ! # Find all files in the source trees. Preserve order. ! $1_SRCS := $$(foreach s, $$($1_SRC), $$(call CacheFind, $$(s))) $1_SRCS := $$(filter $$(NATIVE_SOURCE_EXTENSIONS), $$($1_SRCS)) # Extract the C/C++ files. ifneq ($$($1_EXCLUDE_PATTERNS), ) # We must not match the exclude pattern against the src root(s). $1_SRCS_WITHOUT_ROOTS := $$($1_SRCS)
*** 705,715 **** $$(eval $$(call SetupCompileNativeFile, $1_$$(notdir $$($1_GENERATED_PCH_SRC)), \ FILE := $$($1_GENERATED_PCH_SRC), \ BASE := $1, \ EXTRA_CXXFLAGS := -Fp$$($1_PCH_FILE) -Yc$$(notdir $$($1_PRECOMPILED_HEADER)), \ ! DEFINE_THIS_FILE := false, \ )) $1_USE_PCH_FLAGS := \ -Fp$$($1_PCH_FILE) -Yu$$(notdir $$($1_PRECOMPILED_HEADER)) --- 693,703 ---- $$(eval $$(call SetupCompileNativeFile, $1_$$(notdir $$($1_GENERATED_PCH_SRC)), \ FILE := $$($1_GENERATED_PCH_SRC), \ BASE := $1, \ EXTRA_CXXFLAGS := -Fp$$($1_PCH_FILE) -Yc$$(notdir $$($1_PRECOMPILED_HEADER)), \ ! DISABLE_THIS_FILE_DEFINE := true, \ )) $1_USE_PCH_FLAGS := \ -Fp$$($1_PCH_FILE) -Yu$$(notdir $$($1_PRECOMPILED_HEADER))
*** 728,752 **** $1_USE_PCH_FLAGS := -I$$($1_OBJECT_DIR)/precompiled else ifeq ($(TOOLCHAIN_TYPE), clang) $1_PCH_FILE := $$($1_OBJECT_DIR)/precompiled/$$(notdir $$($1_PRECOMPILED_HEADER)).pch $1_USE_PCH_FLAGS := -include-pch $$($1_PCH_FILE) endif ! $1_PCH_DEPS_FILE := $$($1_PCH_FILE).d ! $1_PCH_DEPS_TARGETS_FILE := $$($1_PCH_FILE).d.targets ! -include $$($1_PCH_DEPS_FILE) ! -include $$($1_PCH_DEPS_TARGETS_FILE) $1_PCH_COMMAND := $$($1_CC) $$($1_CFLAGS) $$($1_EXTRA_CFLAGS) $$($1_SYSROOT_CFLAGS) \ ! $$($1_OPT_CFLAGS) -x c++-header -c $(C_FLAG_DEPS) $$($1_PCH_DEPS_FILE) $$($1_PCH_FILE): $$($1_PRECOMPILED_HEADER) $$($1_COMPILE_VARDEPS_FILE) $$(call LogInfo, Generating precompiled header) $$(call MakeDir, $$(@D)) $$(call ExecuteWithLog, $$@, $$($1_PCH_COMMAND) $$< -o $$@) ! $(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_PCH_DEPS_FILE) \ ! > $$($1_PCH_DEPS_TARGETS_FILE) $$($1_ALL_OBJS): $$($1_PCH_FILE) # Generate the corresponding compile_commands.json fragment. $1_PCH_FILE_JSON := $$(MAKESUPPORT_OUTPUTDIR)/compile-commands/$$(subst /,_,$$(subst \ --- 716,739 ---- $1_USE_PCH_FLAGS := -I$$($1_OBJECT_DIR)/precompiled else ifeq ($(TOOLCHAIN_TYPE), clang) $1_PCH_FILE := $$($1_OBJECT_DIR)/precompiled/$$(notdir $$($1_PRECOMPILED_HEADER)).pch $1_USE_PCH_FLAGS := -include-pch $$($1_PCH_FILE) endif ! $1_PCH_DEP := $$($1_PCH_FILE).d ! $1_PCH_DEP_TARGETS := $$($1_PCH_FILE).d.targets ! -include $$($1_PCH_DEP) ! -include $$($1_PCH_DEP_TARGETS) $1_PCH_COMMAND := $$($1_CC) $$($1_CFLAGS) $$($1_EXTRA_CFLAGS) $$($1_SYSROOT_CFLAGS) \ ! $$($1_OPT_CFLAGS) -x c++-header -c $(C_FLAG_DEPS) $$($1_PCH_DEP) $$($1_PCH_FILE): $$($1_PRECOMPILED_HEADER) $$($1_COMPILE_VARDEPS_FILE) $$(call LogInfo, Generating precompiled header) $$(call MakeDir, $$(@D)) $$(call ExecuteWithLog, $$@, $$($1_PCH_COMMAND) $$< -o $$@) ! $(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_PCH_DEP) > $$($1_PCH_DEP_TARGETS) $$($1_ALL_OBJS): $$($1_PCH_FILE) # Generate the corresponding compile_commands.json fragment. $1_PCH_FILE_JSON := $$(MAKESUPPORT_OUTPUTDIR)/compile-commands/$$(subst /,_,$$(subst \
*** 758,795 **** $$($1_PCH_COMMAND) $$< -o $$($1_PCH_FILE)) endif endif endif - # Create a rule to collect all the individual make dependency files into a - # single makefile. - $1_DEPS_FILE := $$($1_OBJECT_DIR)/$1.d - - $$($1_DEPS_FILE): $$($1_ALL_OBJS) - $(RM) $$@ - # CD into dir to reduce risk of hitting command length limits, which - # could otherwise happen if TOPDIR is a very long path. - $(CD) $$($1_OBJECT_DIR) && $(CAT) *.d > $$@.tmp - $(CD) $$($1_OBJECT_DIR) && $(CAT) *.d.targets | $(SORT) -u >> $$@.tmp - # After generating the file, which happens after all objects have been - # compiled, copy it to .old extension. On the next make invocation, this - # .old file will be included by make. - $(CP) $$@.tmp $$@.old - $(MV) $$@.tmp $$@ - - $1 += $$($1_DEPS_FILE) - - # The include must be on the .old file, which represents the state from the - # previous invocation of make. The file being included must not have a rule - # defined for it as otherwise make will think it has to run the rule before - # being able to include the file, which would be wrong since we specifically - # need the file as it was generated by a previous make invocation. - ifneq ($$(wildcard $$($1_DEPS_FILE).old), ) - $1_DEPS_FILE_LOADED := true - -include $$($1_DEPS_FILE).old - endif - # Now call SetupCompileNativeFile for each source file we are going to compile. $$(foreach file, $$($1_SRCS), \ $$(eval $$(call SetupCompileNativeFile, $1_$$(notdir $$(file)),\ FILE := $$(file), \ BASE := $1, \ --- 745,754 ----
*** 798,825 **** # Setup rule for printing progress info when compiling source files. # This is a rough heuristic and may not always print accurate information. $$($1_BUILD_INFO): $$($1_SRCS) $$($1_COMPILE_VARDEPS_FILE) ifeq ($$(wildcard $$($1_TARGET)), ) ! $$(call LogWarn, Creating $$(subst $$(OUTPUTDIR)/,,$$($1_TARGET)) from $$(words \ ! $$(filter-out %.vardeps, $$?)) file(s)) else ! $$(call LogWarn, $$(strip Updating $$(subst $$(OUTPUTDIR)/,,$$($1_TARGET)) \ $$(if $$(filter-out %.vardeps, $$?), \ ! due to $$(words $$(filter-out %.vardeps, $$?)) file(s), \ ! $$(if $$(filter %.vardeps, $$?), due to makefile changes)))) endif $(TOUCH) $$@ # On windows we need to create a resource file ! ifeq ($(call isTargetOs, windows), true) ifneq ($$($1_VERSIONINFO_RESOURCE), ) $1_RES := $$($1_OBJECT_DIR)/$$($1_BASENAME).res ! $1_RES_DEPS_FILE := $$($1_RES).d ! $1_RES_DEPS_TARGETS_FILE := $$($1_RES).d.targets ! -include $$($1_RES_DEPS_FILE) ! -include $$($1_RES_DEPS_TARGETS_FILE) $1_RES_VARDEPS := $$($1_RC) $$($1_RC_FLAGS) $1_RES_VARDEPS_FILE := $$(call DependOnVariable, $1_RES_VARDEPS, \ $$($1_RES).vardeps) --- 757,784 ---- # Setup rule for printing progress info when compiling source files. # This is a rough heuristic and may not always print accurate information. $$($1_BUILD_INFO): $$($1_SRCS) $$($1_COMPILE_VARDEPS_FILE) ifeq ($$(wildcard $$($1_TARGET)), ) ! $(ECHO) 'Creating $$(subst $$(OUTPUTDIR)/,,$$($1_TARGET)) from $$(words \ ! $$(filter-out %.vardeps, $$?)) file(s)' else ! $(ECHO) $$(strip 'Updating $$(subst $$(OUTPUTDIR)/,,$$($1_TARGET))' \ $$(if $$(filter-out %.vardeps, $$?), \ ! 'due to $$(words $$(filter-out %.vardeps, $$?)) file(s)', \ ! $$(if $$(filter %.vardeps, $$?), 'due to makefile changes'))) endif $(TOUCH) $$@ # On windows we need to create a resource file ! ifeq ($(OPENJDK_TARGET_OS), windows) ifneq ($$($1_VERSIONINFO_RESOURCE), ) $1_RES := $$($1_OBJECT_DIR)/$$($1_BASENAME).res ! $1_RES_DEP := $$($1_RES).d ! $1_RES_DEP_TARGETS := $$($1_RES).d.targets ! -include $$($1_RES_DEP) ! -include $$($1_RES_DEP_TARGETS) $1_RES_VARDEPS := $$($1_RC) $$($1_RC_FLAGS) $1_RES_VARDEPS_FILE := $$(call DependOnVariable, $1_RES_VARDEPS, \ $$($1_RES).vardeps)
*** 832,860 **** # Windows RC compiler does not support -showIncludes, so we mis-use CL # for this. Filter out RC specific arguments that are unknown to CL. # For some unknown reason, in this case CL actually outputs the show # includes to stderr so need to redirect it to hide the output from the # main log. ! $$(call ExecuteWithLog, $$($1_RES_DEPS_FILE).obj, \ $$($1_CC) $$(filter-out -l%, $$($1_RC_FLAGS)) \ $$($1_SYSROOT_CFLAGS) -showIncludes -nologo -TC \ ! $(CC_OUT_OPTION)$$($1_RES_DEPS_FILE).obj -P -Fi$$($1_RES_DEPS_FILE).pp \ $$($1_VERSIONINFO_RESOURCE)) 2>&1 \ | $(TR) -d '\r' | $(GREP) -v -e "^Note: including file:" \ -e "^$$(notdir $$($1_VERSIONINFO_RESOURCE))$$$$" || test "$$$$?" = "1" ; \ ! $(ECHO) $$($1_RES): \\ > $$($1_RES_DEPS_FILE) ; \ ! $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_RES_DEPS_FILE).obj.log \ ! >> $$($1_RES_DEPS_FILE) ; \ ! $(ECHO) >> $$($1_RES_DEPS_FILE) ;\ ! $(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_RES_DEPS_FILE) \ ! > $$($1_RES_DEPS_TARGETS_FILE) endif endif ifneq ($(DISABLE_MAPFILES), true) $1_REAL_MAPFILE := $$($1_MAPFILE) ! ifeq ($(call isTargetOs, windows), false) ifneq ($$($1_REORDER), ) $1_REAL_MAPFILE := $$($1_OBJECT_DIR)/mapfile $$($1_REAL_MAPFILE) : $$($1_MAPFILE) $$($1_REORDER) $$(call MakeDir, $$(@D)) --- 791,816 ---- # Windows RC compiler does not support -showIncludes, so we mis-use CL # for this. Filter out RC specific arguments that are unknown to CL. # For some unknown reason, in this case CL actually outputs the show # includes to stderr so need to redirect it to hide the output from the # main log. ! $$(call ExecuteWithLog, $$($1_RES_DEP).obj, \ $$($1_CC) $$(filter-out -l%, $$($1_RC_FLAGS)) \ $$($1_SYSROOT_CFLAGS) -showIncludes -nologo -TC \ ! $(CC_OUT_OPTION)$$($1_RES_DEP).obj -P -Fi$$($1_RES_DEP).pp \ $$($1_VERSIONINFO_RESOURCE)) 2>&1 \ | $(TR) -d '\r' | $(GREP) -v -e "^Note: including file:" \ -e "^$$(notdir $$($1_VERSIONINFO_RESOURCE))$$$$" || test "$$$$?" = "1" ; \ ! $(ECHO) $$($1_RES): \\ > $$($1_RES_DEP) ; \ ! $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_RES_DEP).obj.log >> $$($1_RES_DEP) ; \ ! $(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_RES_DEP) > $$($1_RES_DEP_TARGETS) endif endif ifneq ($(DISABLE_MAPFILES), true) $1_REAL_MAPFILE := $$($1_MAPFILE) ! ifneq ($(OPENJDK_TARGET_OS), windows) ifneq ($$($1_REORDER), ) $1_REAL_MAPFILE := $$($1_OBJECT_DIR)/mapfile $$($1_REAL_MAPFILE) : $$($1_MAPFILE) $$($1_REORDER) $$(call MakeDir, $$(@D))
*** 871,880 **** --- 827,839 ---- $1_EXTRA_LIBS += $$($1_LIBS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LIBS_$(OPENJDK_TARGET_OS)) ifneq ($$($1_REAL_MAPFILE), ) $1_EXTRA_LDFLAGS += $(call SET_SHARED_LIBRARY_MAPFILE,$$($1_REAL_MAPFILE)) endif + # Need to make sure TARGET is first on list + $1 := $$($1_TARGET) + ifneq ($$($1_COPY_DEBUG_SYMBOLS), false) $1_COPY_DEBUG_SYMBOLS := $(COPY_DEBUG_SYMBOLS) endif ifneq ($$($1_ZIP_EXTERNAL_DEBUG_SYMBOLS), false)
*** 884,915 **** ifeq ($$($1_COPY_DEBUG_SYMBOLS), true) ifneq ($$($1_DEBUG_SYMBOLS), false) # Only copy debug symbols for dynamic libraries and programs. ifneq ($$($1_TYPE), STATIC_LIBRARY) # Generate debuginfo files. ! ifeq ($(call isTargetOs, windows), true) $1_EXTRA_LDFLAGS += -debug "-pdb:$$($1_OUTPUT_DIR)/$$($1_NOSUFFIX).pdb" \ "-map:$$($1_OUTPUT_DIR)/$$($1_NOSUFFIX).map" $1_DEBUGINFO_FILES := $$($1_OUTPUT_DIR)/$$($1_NOSUFFIX).pdb \ $$($1_OUTPUT_DIR)/$$($1_NOSUFFIX).map ! else ifeq ($(call isTargetOs, linux solaris), true) $1_DEBUGINFO_FILES := $$($1_OUTPUT_DIR)/$$($1_NOSUFFIX).debuginfo # Setup the command line creating debuginfo files, to be run after linking. # It cannot be run separately since it updates the original target file $1_CREATE_DEBUGINFO_CMDS := \ $$($1_OBJCOPY) --only-keep-debug $$($1_TARGET) $$($1_DEBUGINFO_FILES) $$(NEWLINE) \ $(CD) $$($1_OUTPUT_DIR) && \ $$($1_OBJCOPY) --add-gnu-debuglink=$$($1_DEBUGINFO_FILES) $$($1_TARGET) ! else ifeq ($(call isTargetOs, macosx), true) $1_DEBUGINFO_FILES := \ $$($1_OUTPUT_DIR)/$$($1_BASENAME).dSYM/Contents/Info.plist \ $$($1_OUTPUT_DIR)/$$($1_BASENAME).dSYM/Contents/Resources/DWARF/$$($1_BASENAME) $1_CREATE_DEBUGINFO_CMDS := \ $(DSYMUTIL) --out $$($1_OUTPUT_DIR)/$$($1_BASENAME).dSYM $$($1_TARGET) ! endif # Since the link rule creates more than one file that we want to track, # we have to use some tricks to get make to cooperate. To properly # trigger downstream dependants of $$($1_DEBUGINFO_FILES), we must have # a recipe in the rule below. To avoid rerunning the recipe every time --- 843,874 ---- ifeq ($$($1_COPY_DEBUG_SYMBOLS), true) ifneq ($$($1_DEBUG_SYMBOLS), false) # Only copy debug symbols for dynamic libraries and programs. ifneq ($$($1_TYPE), STATIC_LIBRARY) # Generate debuginfo files. ! ifeq ($(OPENJDK_TARGET_OS), windows) $1_EXTRA_LDFLAGS += -debug "-pdb:$$($1_OUTPUT_DIR)/$$($1_NOSUFFIX).pdb" \ "-map:$$($1_OUTPUT_DIR)/$$($1_NOSUFFIX).map" $1_DEBUGINFO_FILES := $$($1_OUTPUT_DIR)/$$($1_NOSUFFIX).pdb \ $$($1_OUTPUT_DIR)/$$($1_NOSUFFIX).map ! else ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris), ) $1_DEBUGINFO_FILES := $$($1_OUTPUT_DIR)/$$($1_NOSUFFIX).debuginfo # Setup the command line creating debuginfo files, to be run after linking. # It cannot be run separately since it updates the original target file $1_CREATE_DEBUGINFO_CMDS := \ $$($1_OBJCOPY) --only-keep-debug $$($1_TARGET) $$($1_DEBUGINFO_FILES) $$(NEWLINE) \ $(CD) $$($1_OUTPUT_DIR) && \ $$($1_OBJCOPY) --add-gnu-debuglink=$$($1_DEBUGINFO_FILES) $$($1_TARGET) ! else ifeq ($(OPENJDK_TARGET_OS), macosx) $1_DEBUGINFO_FILES := \ $$($1_OUTPUT_DIR)/$$($1_BASENAME).dSYM/Contents/Info.plist \ $$($1_OUTPUT_DIR)/$$($1_BASENAME).dSYM/Contents/Resources/DWARF/$$($1_BASENAME) $1_CREATE_DEBUGINFO_CMDS := \ $(DSYMUTIL) --out $$($1_OUTPUT_DIR)/$$($1_BASENAME).dSYM $$($1_TARGET) ! endif # OPENJDK_TARGET_OS # Since the link rule creates more than one file that we want to track, # we have to use some tricks to get make to cooperate. To properly # trigger downstream dependants of $$($1_DEBUGINFO_FILES), we must have # a recipe in the rule below. To avoid rerunning the recipe every time
*** 991,1001 **** ifneq ($(COMPILER_BINDCMD_FILE_FLAG), ) $1_EXTRA_LDFLAGS += $(COMPILER_BINDCMD_FILE_FLAG)$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).loadmap endif endif ! ifeq ($(call isTargetOs, windows), true) ifeq ($$($1_EMBED_MANIFEST), true) $1_EXTRA_LDFLAGS += -manifest:embed endif $1_IMPORT_LIBRARY := $$($1_OBJECT_DIR)/$$($1_NAME).lib --- 950,960 ---- ifneq ($(COMPILER_BINDCMD_FILE_FLAG), ) $1_EXTRA_LDFLAGS += $(COMPILER_BINDCMD_FILE_FLAG)$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).loadmap endif endif ! ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($$($1_EMBED_MANIFEST), true) $1_EXTRA_LDFLAGS += -manifest:embed endif $1_IMPORT_LIBRARY := $$($1_OBJECT_DIR)/$$($1_NAME).lib
*** 1009,1021 **** ifneq ($$(wildcard $$($1_IMPORT_LIBRARY)), $$($1_IMPORT_LIBRARY)) $$(call LogDebug, Deleting $$($1_BASENAME) because import library is missing) $$(shell $(RM) $$($1_TARGET)) endif $$($1_IMPORT_LIBRARY): $$($1_TARGET) $(TOUCH) $$@ - - $1 += $$($1_IMPORT_LIBRARY) endif endif $1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \ $$(GLOBAL_LIBS) $$($1_LIBS) $$($1_EXTRA_LIBS) $$($1_MT) \ --- 968,981 ---- ifneq ($$(wildcard $$($1_IMPORT_LIBRARY)), $$($1_IMPORT_LIBRARY)) $$(call LogDebug, Deleting $$($1_BASENAME) because import library is missing) $$(shell $(RM) $$($1_TARGET)) endif $$($1_IMPORT_LIBRARY): $$($1_TARGET) + $$(if $$(CORRECT_FUNCTION_IN_RECIPE_EVALUATION), \ + $$(if $$(wildcard $$@), , $$(error $$@ was not created for $$<)) \ + ) $(TOUCH) $$@ endif endif $1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \ $$(GLOBAL_LIBS) $$($1_LIBS) $$($1_EXTRA_LIBS) $$($1_MT) \
*** 1070,1080 **** endif endif # Keep as much as possible on one execution line for best performance # on Windows $$(call LogInfo, Linking $$($1_BASENAME)) ! ifeq ($(call isTargetOs, windows), true) $$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \ $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \ $(LD_OUT_OPTION)$$($1_TARGET) $$($1_LD_OBJ_ARG) $$($1_RES) $$(GLOBAL_LIBS) \ $$($1_LIBS) $$($1_EXTRA_LIBS)) \ | $(GREP) -v "^ Creating library .*\.lib and object .*\.exp" || \ --- 1030,1040 ---- endif endif # Keep as much as possible on one execution line for best performance # on Windows $$(call LogInfo, Linking $$($1_BASENAME)) ! ifeq ($(OPENJDK_TARGET_OS), windows) $$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \ $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \ $(LD_OUT_OPTION)$$($1_TARGET) $$($1_LD_OBJ_ARG) $$($1_RES) $$(GLOBAL_LIBS) \ $$($1_LIBS) $$($1_EXTRA_LIBS)) \ | $(GREP) -v "^ Creating library .*\.lib and object .*\.exp" || \
*** 1088,1098 **** $(LD_OUT_OPTION)$$($1_TARGET) $$($1_LD_OBJ_ARG) $$($1_RES) $$(GLOBAL_LIBS) \ $$($1_LIBS) $$($1_EXTRA_LIBS)) ; \ $$($1_CREATE_DEBUGINFO_CMDS) $$($1_STRIP_CMD) endif ! ifeq ($(call isTargetOs, windows), true) ifneq ($$($1_MANIFEST), ) $$($1_MT) -nologo -manifest $$($1_MANIFEST) -identity:"$$($1_NAME).exe, version=$$($1_MANIFEST_VERSION)" -outputresource:$$@;#1 endif endif # This only works if the openjdk_codesign identity is present on the system. Let --- 1048,1058 ---- $(LD_OUT_OPTION)$$($1_TARGET) $$($1_LD_OBJ_ARG) $$($1_RES) $$(GLOBAL_LIBS) \ $$($1_LIBS) $$($1_EXTRA_LIBS)) ; \ $$($1_CREATE_DEBUGINFO_CMDS) $$($1_STRIP_CMD) endif ! ifeq ($(OPENJDK_TARGET_OS), windows) ifneq ($$($1_MANIFEST), ) $$($1_MT) -nologo -manifest $$($1_MANIFEST) -identity:"$$($1_NAME).exe, version=$$($1_MANIFEST_VERSION)" -outputresource:$$@;#1 endif endif # This only works if the openjdk_codesign identity is present on the system. Let
< prev index next >