make-rules/ips.mk
changeset 181 87e11e685b1f
parent 166 db8a55996482
child 185 773dda89f186
--- a/make-rules/ips.mk	Wed Apr 13 10:10:46 2011 -0600
+++ b/make-rules/ips.mk	Wed Apr 13 09:58:06 2011 -0700
@@ -40,6 +40,7 @@
 PKGMOGRIFY =	/usr/bin/pkgmogrify
 PKGSEND =	/usr/bin/pkgsend
 PKGLINT =	/usr/bin/pkglint
+PKGMANGLE =	$(WS_TOOLS)/userland-mangler
 
 # Package headers should all pretty much follow the same format
 METADATA_TEMPLATE =		$(WS_TOP)/transforms/manifest-metadata-template
@@ -64,7 +65,6 @@
 PKG_MACROS +=		MACH=$(MACH)
 PKG_MACROS +=		MACH32=$(MACH32)
 PKG_MACROS +=		MACH64=$(MACH64)
-PKG_MACROS +=		IPS_PKG_NAME=$(IPS_PKG_NAME)
 PKG_MACROS +=		PUBLISHER=$(PUBLISHER)
 PKG_MACROS +=		CONSOLIDATION=$(CONSOLIDATION)
 PKG_MACROS +=		BUILD_VERSION=$(BUILD_VERSION)
@@ -77,7 +77,9 @@
 
 PKG_OPTIONS +=		$(PKG_MACROS:%=-D %)
 
-PKG_PROTO_DIRS += $(PROTO_DIR) $(@D) $(COMPONENT_DIR) $(COMPONENT_SRC)
+MANGLED_DIR =	$(PROTO_DIR)/mangled
+
+PKG_PROTO_DIRS += $(MANGLED_DIR) $(PROTO_DIR) $(@D) $(COMPONENT_DIR) $(COMPONENT_SRC)
 
 MANIFEST_BASE =		$(BUILD_DIR)/manifest-$(MACH)
 
@@ -117,9 +119,17 @@
 		$(PUBLISH_TRANSFORMS) | \
 		sed -e '/^$$/d' -e '/^#.*$$/d' | uniq >[email protected]
 
+# mangle the file contents
+$(MANGLED_DIR):
+	$(MKDIR) [email protected]
+
+PKGMANGLE_OPTIONS = -D $(MANGLED_DIR) $(PKG_PROTO_DIRS:%=-d %)
+$(MANIFEST_BASE)-%.mangled:	$(MANIFEST_BASE)-%.mogrified $(MANGLED_DIR)
+	$(PKGMANGLE) $(PKGMANGLE_OPTIONS) -m $< >[email protected]
+
 # generate dependencies
 PKGDEPEND_GENERATE_OPTIONS = -m $(PKG_PROTO_DIRS:%=-d %)
-$(MANIFEST_BASE)-%.depend:	$(MANIFEST_BASE)-%.mogrified
+$(MANIFEST_BASE)-%.depend:	$(MANIFEST_BASE)-%.mangled
 	$(PKGDEPEND) generate $(PKGDEPEND_GENERATE_OPTIONS) $< >[email protected]
 
 # resolve dependencies, prepend the mogrified manifest, less the unresolved