887 endif 888 else 889 # A shared dynamic library or an executable binary has been specified 890 ifeq ($$($1_TYPE), LIBRARY) 891 # Generating a dynamic library. 892 $1_EXTRA_LDFLAGS += $$(call SET_SHARED_LIBRARY_NAME,$$($1_BASENAME)) 893 894 # Create loadmap on AIX. Helps in diagnosing some problems. 895 ifneq ($(COMPILER_BINDCMD_FILE_FLAG), ) 896 $1_EXTRA_LDFLAGS += $(COMPILER_BINDCMD_FILE_FLAG)$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).loadmap 897 endif 898 endif 899 900 ifeq ($(OPENJDK_TARGET_OS), windows) 901 ifeq ($$($1_EMBED_MANIFEST), true) 902 $1_EXTRA_LDFLAGS += -manifest:embed 903 endif 904 905 $1_IMPORT_LIBRARY := $$($1_OBJECT_DIR)/$$($1_NAME).lib 906 $1_EXTRA_LDFLAGS += "-implib:$$($1_IMPORT_LIBRARY)" 907 # To properly trigger downstream dependants of the import library, just as 908 # for debug files, we must have a recipe in the rule. To avoid rerunning 909 # the recipe every time have it touch the target. If an import library 910 # file is deleted by something external, explicitly delete the target to 911 # trigger a rebuild of both. 912 ifneq ($$(wildcard $$($1_IMPORT_LIBRARY)), $$($1_IMPORT_LIBRARY)) 913 $$(call LogDebug, Deleting $$($1_BASENAME) because import library is missing) 914 $$(shell $(RM) $$($1_TARGET)) 915 endif 916 $$($1_IMPORT_LIBRARY): $$($1_TARGET) 917 $$(if $$(CORRECT_FUNCTION_IN_RECIPE_EVALUATION), \ 918 $$(if $$(wildcard $$@), , $$(error $$@ was not created for $$<)) \ 919 ) 920 $(TOUCH) $$@ 921 endif 922 923 $1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \ 924 $$(GLOBAL_LIBS) $$($1_LIBS) $$($1_EXTRA_LIBS) $$($1_MT) \ 925 $$($1_CODESIGN) $$($1_CREATE_DEBUGINFO_CMDS) $$($1_MANIFEST_VERSION) \ 926 $$($1_STRIP_CMD) 927 $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \ 928 $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps) 929 930 $1_LD_OBJ_ARG := $$($1_ALL_OBJS) 931 932 # If there are many object files, use an @-file... 933 ifneq ($$(word 17, $$($1_ALL_OBJS)), ) 934 $1_OBJ_FILE_LIST := $$($1_OBJECT_DIR)/_$1_objectfilenames.txt 935 ifneq ($(COMPILER_COMMAND_FILE_FLAG), ) 936 $1_LD_OBJ_ARG := $(COMPILER_COMMAND_FILE_FLAG)$$($1_OBJ_FILE_LIST) 937 else 938 # ...except for toolchains which don't support them. 939 $1_LD_OBJ_ARG := `cat $$($1_OBJ_FILE_LIST)` 940 endif | 887 endif 888 else 889 # A shared dynamic library or an executable binary has been specified 890 ifeq ($$($1_TYPE), LIBRARY) 891 # Generating a dynamic library. 892 $1_EXTRA_LDFLAGS += $$(call SET_SHARED_LIBRARY_NAME,$$($1_BASENAME)) 893 894 # Create loadmap on AIX. Helps in diagnosing some problems. 895 ifneq ($(COMPILER_BINDCMD_FILE_FLAG), ) 896 $1_EXTRA_LDFLAGS += $(COMPILER_BINDCMD_FILE_FLAG)$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).loadmap 897 endif 898 endif 899 900 ifeq ($(OPENJDK_TARGET_OS), windows) 901 ifeq ($$($1_EMBED_MANIFEST), true) 902 $1_EXTRA_LDFLAGS += -manifest:embed 903 endif 904 905 $1_IMPORT_LIBRARY := $$($1_OBJECT_DIR)/$$($1_NAME).lib 906 $1_EXTRA_LDFLAGS += "-implib:$$($1_IMPORT_LIBRARY)" 907 ifeq ($$($1_TYPE), LIBRARY) 908 # To properly trigger downstream dependants of the import library, just as 909 # for debug files, we must have a recipe in the rule. To avoid rerunning 910 # the recipe every time have it touch the target. If an import library 911 # file is deleted by something external, explicitly delete the target to 912 # trigger a rebuild of both. 913 ifneq ($$(wildcard $$($1_IMPORT_LIBRARY)), $$($1_IMPORT_LIBRARY)) 914 $$(call LogDebug, Deleting $$($1_BASENAME) because import library is missing) 915 $$(shell $(RM) $$($1_TARGET)) 916 endif 917 $$($1_IMPORT_LIBRARY): $$($1_TARGET) 918 $$(if $$(CORRECT_FUNCTION_IN_RECIPE_EVALUATION), \ 919 $$(if $$(wildcard $$@), , $$(error $$@ was not created for $$<)) \ 920 ) 921 $(TOUCH) $$@ 922 endif 923 endif 924 925 $1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \ 926 $$(GLOBAL_LIBS) $$($1_LIBS) $$($1_EXTRA_LIBS) $$($1_MT) \ 927 $$($1_CODESIGN) $$($1_CREATE_DEBUGINFO_CMDS) $$($1_MANIFEST_VERSION) \ 928 $$($1_STRIP_CMD) 929 $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \ 930 $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps) 931 932 $1_LD_OBJ_ARG := $$($1_ALL_OBJS) 933 934 # If there are many object files, use an @-file... 935 ifneq ($$(word 17, $$($1_ALL_OBJS)), ) 936 $1_OBJ_FILE_LIST := $$($1_OBJECT_DIR)/_$1_objectfilenames.txt 937 ifneq ($(COMPILER_COMMAND_FILE_FLAG), ) 938 $1_LD_OBJ_ARG := $(COMPILER_COMMAND_FILE_FLAG)$$($1_OBJ_FILE_LIST) 939 else 940 # ...except for toolchains which don't support them. 941 $1_LD_OBJ_ARG := `cat $$($1_OBJ_FILE_LIST)` 942 endif |