21137686 grails & unrar Makefiles break when PKG_PROTO_DIRS is extended
authorJohn Beck <John.Beck@Oracle.COM>
Tue, 26 May 2015 16:21:56 -0700
changeset 4355 918f15f3f728
parent 4351 c3f50d5f75d2
child 4356 53082858cced
21137686 grails & unrar Makefiles break when PKG_PROTO_DIRS is extended
components/grails/Makefile
components/unrar/Makefile
make-rules/ips.mk
--- a/components/grails/Makefile	Tue May 26 14:20:17 2015 -0700
+++ b/components/grails/Makefile	Tue May 26 16:21:56 2015 -0700
@@ -39,6 +39,14 @@
 
 include $(WS_MAKE_RULES)/prep.mk
 include $(WS_MAKE_RULES)/ant.mk
+
+# Need to package the .jar files we've built, not the ones included in
+# the source tarball.  So we need $(BUILD_DIR_32) added to $(PKG_PROTO_DIRS)
+# but it has to come at the beginning not the end, so we set it before we
+# include ips.mk.
+
+PKG_PROTO_DIRS = $(BUILD_DIR_32)
+
 include $(WS_MAKE_RULES)/ips.mk
 
 # Make sure we use the specially modified versions of grails and grails-debug
@@ -49,11 +57,6 @@
 COMPONENT_PRE_BUILD_ACTION = $(MKDIR) $(@D)/tmp 
 COMPONENT_BUILD_ENV += "ANT_OPTS=-Djava.io.tmpdir=$(BUILD_DIR_32)/tmp"
 
-# Need to package the .jar files we've built, not the ones included in
-# the source tarball.
-PKG_PROTO_DIRS = $(BUILD_DIR_32) $(MANGLED_DIR) $(PROTO_DIR) $(@D) \
-	$(COMPONENT_DIR) $(COMPONENT_SRC)
-
 ASLR_MODE = $(ASLR_NOT_APPLICABLE)
 
 # common targets
@@ -77,7 +80,6 @@
 
 system-test:    $(NO_TESTS)
 
-
 REQUIRED_PACKAGES += runtime/perl-512
 REQUIRED_PACKAGES += runtime/perl-516
 REQUIRED_PACKAGES += runtime/python-27
--- a/components/unrar/Makefile	Tue May 26 14:20:17 2015 -0700
+++ b/components/unrar/Makefile	Tue May 26 16:21:56 2015 -0700
@@ -41,11 +41,12 @@
 
 include $(WS_MAKE_RULES)/prep.mk
 include $(WS_MAKE_RULES)/justmake.mk
-include $(WS_MAKE_RULES)/ips.mk
 
-PKG_PROTO_DIRS = $(MANGLED_DIR)
-PKG_PROTO_DIRS += $(BUILD_DIR_64)
-PKG_PROTO_DIRS += $(COMPONENT_DIR)
+# We need this before the default PKG_PROTO_DIRS, so set it before we include
+# ips.mk, which will append the default set.
+PKG_PROTO_DIRS = $(BUILD_DIR_64)
+
+include $(WS_MAKE_RULES)/ips.mk
 
 PATCH_LEVEL =	0
 
@@ -74,7 +75,6 @@
 
 system-test:    $(NO_TESTS)
 
-
 REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/c++-runtime
 REQUIRED_PACKAGES += system/library/math
--- a/make-rules/ips.mk	Tue May 26 14:20:17 2015 -0700
+++ b/make-rules/ips.mk	Tue May 26 16:21:56 2015 -0700
@@ -123,6 +123,9 @@
 
 MANGLED_DIR =	$(PROTO_DIR)/mangled
 
+# We use += below so anyone wishing to put other directories at the beginning
+# of the list can do so, by setting PKG_PROTO_DIRS before including this file.
+# So don't change += to = here or components that use this will break.
 PKG_PROTO_DIRS += $(MANGLED_DIR) $(PROTO_DIR) $(@D) $(COMPONENT_DIR) $(COMPONENT_SRC)
 
 MANIFEST_BASE =		$(BUILD_DIR)/manifest-$(MACH)