From b9ed3d03e072ea0a27cebd3512fb50822f186cb1 Mon Sep 17 00:00:00 2001 From: ohair Date: Tue, 18 Sep 2012 12:16:37 -0700 Subject: [PATCH] 7198325: Fix more $(sort) issues on lnk commands in makefiles, making binaries more consistent 7130909: Add a more general mechanism for customizing the build logic Reviewed-by: dholmes, tbell, erikj, ihse, ohrstrom --- make/Makefile | 4 +++- make/com/sun/java/pack/Makefile | 2 +- make/common/Defs.gmk | 23 +++++++++++++++++------ make/common/Release.gmk | 4 ---- make/java/jli/Makefile | 4 ++-- 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/make/Makefile b/make/Makefile index 83f99085c..2e5032d0f 100644 --- a/make/Makefile +++ b/make/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1995, 2012, 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 @@ -29,6 +29,7 @@ # BUILDDIR=. + include $(BUILDDIR)/common/Defs.gmk # @@ -273,6 +274,7 @@ docs:: sanity-docs post-sanity-docs # Release engineering targets. # include $(BUILDDIR)/common/Release.gmk +-include $(CUSTOM_MAKE_DIR)/Release.gmk # # Cscope targets. diff --git a/make/com/sun/java/pack/Makefile b/make/com/sun/java/pack/Makefile index 0530d37c8..5882683fe 100644 --- a/make/com/sun/java/pack/Makefile +++ b/make/com/sun/java/pack/Makefile @@ -159,7 +159,7 @@ $(UNPACK_EXE): $(UNPACK_EXE_FILES_o) updatefiles winres $(prep-target) $(RM) $(TEMPDIR)/mapfile-vers $(CP) mapfile-vers-unpack200 $(TEMPDIR)/mapfile-vers - $(LINKER) $(LDDFLAGS) $(UNPACK_EXE_FILES_o) $(RES) $(LIBCXX) $(LDOUTPUT)$(TEMPDIR)/unpack200$(EXE_SUFFIX) + $(LINKER) $(LDDFLAGS) $(sort $(UNPACK_EXE_FILES_o)) $(RES) $(LIBCXX) $(LDOUTPUT)$(TEMPDIR)/unpack200$(EXE_SUFFIX) ifdef MT $(MT) /manifest $(OBJDIR)/unpack200$(EXE_SUFFIX).manifest /outputresource:$(TEMPDIR)/unpack200$(EXE_SUFFIX);#1 endif diff --git a/make/common/Defs.gmk b/make/common/Defs.gmk index 00646df3e..fe2bc9450 100644 --- a/make/common/Defs.gmk +++ b/make/common/Defs.gmk @@ -109,18 +109,27 @@ else endif endif +# We allow for potential specialization of build files. This has to be +# done on a file-by-file, case-by-case basis. Here we define the basic control +# over where custom files are being used. Later we will -include the custom +# Defs.gmk if present. This works best because all Makefiles include defs.gmk. +# In other cases we can either have foo.gmk include custom/foo.gmk, or +# a Makefile can do: +# include foo.gmk +# -include $CUSTOM_MAKE_DIR/foo.gmk +# +# For non-OpenJDK builds the default location is the make/closed repository. +# For OpenJDK builds a real value has to be supplied externally. +ifneq ($(OPENJDK),true) + CUSTOM_MAKE_DIR = $(BUILDDIR)/closed +endif + # # Get platform definitions # include $(JDK_TOPDIR)/make/common/Defs-$(PLATFORM).gmk -# -# SE-Embedded support, if enabled -# - -include $(JDK_TOPDIR)/make/common/Defs-embedded.gmk - # # Cross-compilation Settings # @@ -611,4 +620,6 @@ define install-import-file $(install-importonly-file) endef +-include $(CUSTOM_MAKE_DIR)/Defs.gmk + .PHONY: all build clean clobber diff --git a/make/common/Release.gmk b/make/common/Release.gmk index 4c08ecda6..7d04d3e14 100644 --- a/make/common/Release.gmk +++ b/make/common/Release.gmk @@ -750,10 +750,6 @@ $(RT_JAR): $(RT_JAR_FILELIST) $(RT_JAR_MANIFEST_FILE) BUILDMETAINDEX_JARFILE = $(ABS_BUILDTOOLJARDIR)/buildmetaindex.jar -# SE-Embedded targets if enabled -include $(JDK_TOPDIR)/make/common/Release-embedded.gmk - - ###################################################### # JRE Image ###################################################### diff --git a/make/java/jli/Makefile b/make/java/jli/Makefile index eebd88c06..17d7bd290 100644 --- a/make/java/jli/Makefile +++ b/make/java/jli/Makefile @@ -190,7 +190,7 @@ ifeq ($(PLATFORM), windows) $(STATIC_LIBRARY): $(FILES_o) @$(prep-target) - $(LIBEXE) -nologo -out:$@ $(FILES_o) + $(LIBEXE) -nologo -out:$@ $(sort $(FILES_o)) library:: $(STATIC_LIBRARY) endif # PLATFORM @@ -216,7 +216,7 @@ $(STATIC_LIBRARY_DIR): | $(OBJDIR) $(STATIC_LIBRARY): $(STATIC_LIBRARY_DIR) @$(prep-target) - $(AR) $(ARFLAGS) $@ $(FILES_o) + $(AR) $(ARFLAGS) $@ $(sort $(FILES_o)) library:: $(STATIC_LIBRARY) -- GitLab