7078053: Solaris JDK build: C compiler writing tmp files into the make tree
authorprr
Mon, 05 Mar 2012 09:33:44 -0800
changeset 12044 d826961f7d42
parent 12043 272bd8ce9ee6
child 12045 3c08f7ce2890
7078053: Solaris JDK build: C compiler writing tmp files into the make tree Reviewed-by: ohair, alanb
jdk/make/java/nio/Makefile
jdk/make/sun/xawt/Makefile
--- a/jdk/make/java/nio/Makefile	Mon Mar 05 14:15:01 2012 +0000
+++ b/jdk/make/java/nio/Makefile	Mon Mar 05 09:33:44 2012 -0800
@@ -849,6 +849,7 @@
 
 GENUC_SRC = $(PLATFORM_SRC)/native/sun/nio/fs/genUnixConstants.c
 
+GENUC_OBJ = $(TEMPDIR)/genUnixConstants.o
 GENUC_EXE = $(TEMPDIR)/genUnixConstants
 
 GENUC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENUC_SRC) | \
@@ -856,7 +857,8 @@
 
 $(GENUC_EXE) : $(GENUC_SRC)
 	$(prep-target)
-	$(CC) $(CPPFLAGS) -o $@ $(GENUC_SRC)
+	$(CC) $(CPPFLAGS) -c -o $(GENUC_OBJ) $(GENUC_SRC)
+	$(CC) $(CPPFLAGS) -o $@ $(GENUC_OBJ)
 
 ifdef NIO_PLATFORM_CLASSES_ROOT_DIR
 $(SFS_GEN)/UnixConstants.java: $(NIO_PLATFORM_CLASSES_ROOT_DIR)/sun/nio/fs/UnixConstants-$(PLATFORM)-$(ARCH).java
@@ -871,6 +873,7 @@
 
 GENSC_SRC = $(PLATFORM_SRC)/native/sun/nio/fs/genSolarisConstants.c
 
+GENSC_OBJ = $(TEMPDIR)/genSolarisConstants.o
 GENSC_EXE = $(TEMPDIR)/genSolarisConstants
 
 GENSC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSC_SRC) | \
@@ -878,7 +881,8 @@
 
 $(GENSC_EXE) : $(GENSC_SRC)
 	$(prep-target)
-	$(CC) $(CPPFLAGS) -o $@ $(GENSC_SRC)
+	$(CC) $(CPPFLAGS) -c -o $(GENSC_OBJ) $(GENSC_SRC)
+	$(CC) $(CPPFLAGS) -o $@ $(GENSC_OBJ)
 
 ifdef NIO_PLATFORM_CLASSES_ROOT_DIR
 $(SFS_GEN)/SolarisConstants.java: $(NIO_PLATFORM_CLASSES_ROOT_DIR)/sun/nio/fs/SolarisConstants-$(PLATFORM)-$(ARCH).java
--- a/jdk/make/sun/xawt/Makefile	Mon Mar 05 14:15:01 2012 +0000
+++ b/jdk/make/sun/xawt/Makefile	Mon Mar 05 09:33:44 2012 -0800
@@ -251,9 +251,11 @@
 $(SIZERS): $(SIZERS_C) 
 	$(prep-target)
 ifndef CROSS_COMPILE_ARCH
-	$(CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).c
+	$(CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -c -o $(SIZER)$(suffix $@).o $(SIZER)$(suffix $@).c
+	$(CC) $(CFLAGS_$(subst .,,$(suffix $@))) -o $@ $(CPPFLAGS) $(SIZER)$(suffix $@).o
 else
-	$(HOST_CC) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).c
+	$(HOST_CC) $(CPPFLAGS) -c -o $(SIZER)$(suffix $@).o $(SIZER)$(suffix $@).c
+	$(HOST_CC) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).o
 endif
 
 $(WRAPPER_GENERATOR_CLASS): $(WRAPPER_GENERATOR_JAVA)