215 # This has to be included here to allow changes to the source 216 # directories and excluded files before they are expanded 217 # by the definition of Src_Files. 218 -include $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/vm.make 219 220 # Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE. 221 define findsrc 222 $(notdir $(shell find $(1)/. ! -name . -prune \ 223 -a \( -name DUMMY $(addprefix -o -name ,$(Src_Files_BASE)) \) \ 224 -a ! \( -name DUMMY $(addprefix -o -name ,$(Src_Files_EXCLUDE)) \))) 225 endef 226 227 Src_Files := $(foreach e,$(Src_Dirs),$(call findsrc,$(e))) 228 229 Obj_Files = $(sort $(addsuffix .o,$(basename $(Src_Files))) $(EXTENDED_JVM_OBJ_FILES)) 230 231 JVM_OBJ_FILES = $(Obj_Files) 232 233 vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES)) 234 235 mapfile : $(MAPFILE) vm.def mapfile_ext 236 rm -f $@ 237 awk '{ if ($$0 ~ "INSERT VTABLE SYMBOLS HERE") \ 238 { system ("cat mapfile_ext"); system ("cat vm.def"); } \ 239 else \ 240 { print $$0 } \ 241 }' > $@ < $(MAPFILE) 242 243 mapfile_reorder : mapfile $(REORDERFILE) 244 rm -f $@ 245 cat $^ > $@ 246 247 VMDEF_PAT = ^_ZTV 248 VMDEF_PAT := ^gHotSpotVM|$(VMDEF_PAT) 249 VMDEF_PAT := ^UseSharedSpaces$$|$(VMDEF_PAT) 250 VMDEF_PAT := ^_ZN9Arguments17SharedArchivePathE$$|$(VMDEF_PAT) 251 ifneq ($(VMDEF_PAT_EXT),) 252 VMDEF_PAT := $(VMDEF_PAT_EXT)|$(VMDEF_PAT) 253 endif 254 255 vm.def: $(Res_Files) $(Obj_Files) $(VM_DEF_EXT) 256 $(QUIETLY) $(NM) --defined-only $(Obj_Files) | sort -k3 -u | \ 257 awk '$$3 ~ /$(VMDEF_PAT)/ { print "\t" $$3 ";" }' > $@ 258 ifneq ($(VM_DEF_EXT),) 259 cat $(VM_DEF_EXT) >> $@ 260 endif 261 262 mapfile_ext: 263 rm -f $@ 264 touch $@ 265 if [ -f $(HS_ALT_MAKE)/linux/makefiles/mapfile-ext ]; then \ 266 cat $(HS_ALT_MAKE)/linux/makefiles/mapfile-ext > $@; \ 267 fi 268 269 ifeq ($(JVM_VARIANT_ZEROSHARK), true) 270 STATIC_CXX = false 271 else 272 ifeq ($(ZERO_LIBARCH), ppc64) 273 STATIC_CXX = false 274 else 275 STATIC_CXX = true 276 endif 277 endif 278 279 ifeq ($(LINK_INTO),AOUT) 280 LIBJVM.o = 281 LIBJVM_MAPFILE = 282 LIBS_VM = $(LIBS) 283 else 284 LIBJVM.o = $(JVM_OBJ_FILES) 285 LIBJVM_MAPFILE$(LDNOMAP) = mapfile_reorder 286 LFLAGS_VM$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LIBJVM_MAPFILE)) 287 LFLAGS_VM += $(SONAMEFLAG:SONAME=$(LIBJVM)) | 215 # This has to be included here to allow changes to the source 216 # directories and excluded files before they are expanded 217 # by the definition of Src_Files. 218 -include $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/vm.make 219 220 # Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE. 221 define findsrc 222 $(notdir $(shell find $(1)/. ! -name . -prune \ 223 -a \( -name DUMMY $(addprefix -o -name ,$(Src_Files_BASE)) \) \ 224 -a ! \( -name DUMMY $(addprefix -o -name ,$(Src_Files_EXCLUDE)) \))) 225 endef 226 227 Src_Files := $(foreach e,$(Src_Dirs),$(call findsrc,$(e))) 228 229 Obj_Files = $(sort $(addsuffix .o,$(basename $(Src_Files))) $(EXTENDED_JVM_OBJ_FILES)) 230 231 JVM_OBJ_FILES = $(Obj_Files) 232 233 vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES)) 234 235 MAPFILE_SHARE := $(GAMMADIR)/make/share/makefiles/mapfile-vers 236 237 MAPFILE_EXT_SRC := $(HS_ALT_MAKE)/share/makefiles/mapfile-ext 238 ifneq ("$(wildcard $(MAPFILE_EXT_SRC))","") 239 MAPFILE_EXT := $(MAPFILE_EXT_SRC) 240 endif 241 242 mapfile : $(MAPFILE) $(MAPFILE_SHARE) vm.def $(MAPFILE_EXT) 243 rm -f $@ 244 awk '{ if ($$0 ~ "INSERT VTABLE SYMBOLS HERE") \ 245 { system ("cat ${MAPFILE_SHARE} $(MAPFILE_EXT) vm.def"); } \ 246 else \ 247 { print $$0 } \ 248 }' > $@ < $(MAPFILE) 249 250 mapfile_reorder : mapfile $(REORDERFILE) 251 rm -f $@ 252 cat $^ > $@ 253 254 VMDEF_PAT = ^_ZTV 255 VMDEF_PAT := ^gHotSpotVM|$(VMDEF_PAT) 256 VMDEF_PAT := ^UseSharedSpaces$$|$(VMDEF_PAT) 257 VMDEF_PAT := ^_ZN9Arguments17SharedArchivePathE$$|$(VMDEF_PAT) 258 ifneq ($(VMDEF_PAT_EXT),) 259 VMDEF_PAT := $(VMDEF_PAT_EXT)|$(VMDEF_PAT) 260 endif 261 262 vm.def: $(Res_Files) $(Obj_Files) $(VM_DEF_EXT) 263 $(QUIETLY) $(NM) --defined-only $(Obj_Files) | sort -k3 -u | \ 264 awk '$$3 ~ /$(VMDEF_PAT)/ { print "\t" $$3 ";" }' > $@ 265 ifneq ($(VM_DEF_EXT),) 266 cat $(VM_DEF_EXT) >> $@ 267 endif 268 269 ifeq ($(JVM_VARIANT_ZEROSHARK), true) 270 STATIC_CXX = false 271 else 272 ifeq ($(ZERO_LIBARCH), ppc64) 273 STATIC_CXX = false 274 else 275 STATIC_CXX = true 276 endif 277 endif 278 279 ifeq ($(LINK_INTO),AOUT) 280 LIBJVM.o = 281 LIBJVM_MAPFILE = 282 LIBS_VM = $(LIBS) 283 else 284 LIBJVM.o = $(JVM_OBJ_FILES) 285 LIBJVM_MAPFILE$(LDNOMAP) = mapfile_reorder 286 LFLAGS_VM$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LIBJVM_MAPFILE)) 287 LFLAGS_VM += $(SONAMEFLAG:SONAME=$(LIBJVM)) |