jdk/makefiles/GensrcMisc.gmk
changeset 13702 efd6a05935b2
parent 13164 72c5d01a857d
child 14326 3f8b8cd207f8
child 14231 a0c23c1c010f
--- a/jdk/makefiles/GensrcMisc.gmk	Wed Jul 05 18:22:17 2017 +0200
+++ b/jdk/makefiles/GensrcMisc.gmk	Tue Sep 18 11:29:24 2012 -0700
@@ -31,12 +31,14 @@
 $(JDK_OUTPUTDIR)/gensrc_misc/sun/misc/Version.java: \
 	$(JDK_TOPDIR)/src/share/classes/sun/misc/Version.java.template
 	$(MKDIR) -p $(@D)
+	$(RM) $@ $@.tmp
 	$(ECHO) Generating sun/misc/Version.java
 	$(SED) -e 's/@@launcher_name@@/$(LAUNCHER_NAME)/g' \
 	       -e 's/@@java_version@@/$(RELEASE)/g' \
 	       -e 's/@@java_runtime_version@@/$(FULL_VERSION)/g' \
 	       -e 's/@@java_runtime_name@@/$(RUNTIME_NAME)/g' \
-            $< > $@
+            $< > $@.tmp
+	$(MV) $@.tmp $@
 
 GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/sun/misc/Version.java
 
@@ -46,8 +48,10 @@
 $(JDK_OUTPUTDIR)/gensrc_misc/sun/tools/jconsole/Version.java: \
                 $(JDK_TOPDIR)/src/share/classes/sun/tools/jconsole/Version.java.template
 	$(MKDIR) -p $(@D)
+	$(RM) $@ $@.tmp
 	$(ECHO) Generating sun/tools/jconsole/Version.java
-	$(SED) -e 's/@@jconsole_version@@/$(FULL_VERSION)/g' $< > $@
+	$(SED) -e 's/@@jconsole_version@@/$(FULL_VERSION)/g' $< > $@.tmp
+	$(MV) $@.tmp $@
 
 GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/sun/tools/jconsole/Version.java
 
@@ -80,12 +84,14 @@
 
     $(JDK_OUTPUTDIR)/gensrc_c/libjdbcodbc/dummyodbc1.c : 
 	$(MKDIR) -p $(@D)
+	$(RM) $@
 	$(ECHO) Creating $@
 	$(PRINTF) "void dummyOdbc(void){}\n" > $@
 	$(ECHO) Created $@
 
     $(JDK_OUTPUTDIR)/gensrc_c/libjdbcodbc/dummyodbc2.c : 
 	$(MKDIR) -p $(@D)
+	$(RM) $@
 	$(ECHO) Creating $@
 	$(PRINTF) "void dummyOdbc(void){}\n" > $@
 	$(ECHO) Created $@
@@ -110,21 +116,27 @@
 		SRC:=$(GENSRC_SOR_SRC),\
 		INCLUDE_FILES:=$(GENSRC_SOR_SRC_FILE),\
 		LANG:=C,\
-		CC:=$(HOST_CC),\
-		LDEXE:=$(HOST_LD),\
+		CC:=$(BUILD_CC),\
+		LDEXE:=$(BUILD_LD),\
 		OBJECT_DIR:=$(GENSRC_SOR_BIN),\
 		OUTPUT_DIR:=$(GENSRC_SOR_BIN),\
                 PROGRAM:=genSocketOptionRegistry))
 
-ifneq ($(JAVASE_EMBEDDED), true)
+ifneq ($(wildcard $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/ch/SocketOptionRegistry-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java),)
+  HAS_SOCKET_OPTION_REGISTRY:=true
+endif
+
+ifneq ($(HAS_SOCKET_OTION_REGISTRY),true)
 $(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/ch/SocketOptionRegistry.java : $(BUILD_GENSRC_SOR_EXE)
 	$(MKDIR) -p $(@D)
+	$(RM) $@ $@.tmp
 	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@.tmp
 	$(BUILD_GENSRC_SOR_EXE) >> $@.tmp
 	$(MV) $@.tmp $@
 else
 $(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/ch/SocketOptionRegistry.java : $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/ch/SocketOptionRegistry-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java
 	$(MKDIR) -p $(@D)
+	$(RM) $@
 	$(CP) $< $@
 endif
 
@@ -134,7 +146,7 @@
 
 GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/UnixConstants.java
 
-GENSRC_UC_SRC := $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/nio/fs
+GENSRC_UC_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/fs
 GENSRC_UC_SRC_FILE := genUnixConstants.c
 GENSRC_UC_BIN := $(JDK_OUTPUTDIR)/gensrc_misc/genUnixConstants
 
@@ -145,21 +157,27 @@
 		SRC:=$(GENSRC_UC_SRC),\
 		INCLUDE_FILES:=$(GENSRC_UC_SRC_FILE),\
 		LANG:=C,\
-		CC:=$(HOST_CC),\
-		LDEXE:=$(HOST_CC),\
+		CC:=$(BUILD_CC),\
+		LDEXE:=$(BUILD_CC),\
 		OBJECT_DIR:=$(GENSRC_UC_BIN),\
                 OUTPUT_DIR:=$(GENSRC_UC_BIN),\
 		PROGRAM:=genUnixConstants))
 
-ifneq ($(JAVASE_EMBEDDED), true)
+ifneq ($(wildcard $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/fs/UnixConstants-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java),)
+  HAS_UNIX_CONSTANTS:=true
+endif
+
+ifneq ($(HAS_UNIX_CONSTANTS),true)
 $(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/UnixConstants.java : $(BUILD_GENSRC_UC_EXE)
 	$(MKDIR) -p $(@D)
+	$(RM) $@ $@.tmp
 	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(UC_COPYRIGHT_YEARS)" > $@.tmp
 	$(BUILD_GENSRC_UC_EXE) >> $@.tmp
 	$(MV) $@.tmp $@
 else
 $(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/UnixConstants.java : $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/fs/UnixConstants-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java
 	$(MKDIR) -p $(@D)
+	$(RM) $@
 	$(CP) $< $@
 endif
 
@@ -171,7 +189,7 @@
 
 GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/SolarisConstants.java
 
-GENSRC_SOL_SRC := $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/nio/fs
+GENSRC_SOL_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/fs
 GENSRC_SOL_SRC_FILE := genSolarisConstants.c
 GENSRC_SOL_BIN := $(JDK_OUTPUTDIR)/gensrc_misc/genSolarisConstants
 
@@ -182,14 +200,15 @@
 		SRC:=$(GENSRC_SOL_SRC),\
 		INCLUDE_FILES:=$(GENSRC_SOL_SRC_FILE),\
 		LANG:=C,\
-		CC:=$(HOST_CC),\
-		LDEXE:=$(HOST_CC),\
+		CC:=$(BUILD_CC),\
+		LDEXE:=$(BUILD_CC),\
 		OBJECT_DIR:=$(GENSRC_SOL_BIN),\
 		OUTPUT_DIR:=$(GENSRC_SOL_BIN),\
 		PROGRAM:=genSolarisConstants))
 
 $(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/SolarisConstants.java : $(BUILD_GENSRC_SOL_EXE)
 	$(MKDIR) -p $(@D)
+	$(RM) $@ $@.tmp
 	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(SOL_COPYRIGHT_YEARS)" > $@.tmp
 	$(BUILD_GENSRC_SOL_EXE) >> $@.tmp
 	$(MV) $@.tmp $@