make-rules/ips.mk
changeset 1235 413599fe2d31
parent 1205 6c6c27bcf9ac
child 1238 fb93a6ad84e5
--- a/make-rules/ips.mk	Thu Mar 28 08:49:28 2013 -0700
+++ b/make-rules/ips.mk	Thu Mar 28 13:51:30 2013 -0700
@@ -242,9 +242,30 @@
 $(MANIFEST_BASE)-%.depend:	$(MANIFEST_BASE)-%.mangled
 	$(PKGDEPEND) generate $(PKGDEPEND_GENERATE_OPTIONS) $< >[email protected]
 
+# These files should contain a list of packages that the component is known to
+# depend on.  Using resolve.deps is not required, but significantly speeds up
+# the "pkg resolve" step.
+EXTDEPFILES = $(wildcard $(addsuffix resolve.deps, $(subst build/, , $(dir $(DEPENDED)))))
+
+# This is a target that should only be run by hand, and not something that
+# .resolved-$(MACH) should depend on.
+sample-resolve.deps:
+	echo "<transform depend type=require -> print %(fmri)>" > rd-trans
+	for i in build/*.depend; do \
+		$(PKGMOGRIFY) -O /dev/null $$i rd-trans | sort -u > m1; \
+		$(PKGMOGRIFY) -O /dev/null $$i.res rd-trans | sort -u > m2; \
+		comm -13 m1 m2; \
+	done | sed -e 's/@.*//' -e 's,^pkg:/,,' | sort -u > resolve.deps
+	$(RM) rd-trans m1 m2
+	if [[ ! -s resolve.deps ]]; then \
+		echo "No computed dependencies found; removing empty resolve.deps."; \
+		$(RM) resolve.deps; \
+	fi
+
+
 # resolve the dependencies all at once
 $(BUILD_DIR)/.resolved-$(MACH):	$(DEPENDED)
-	$(PKGDEPEND) resolve -m $(DEPENDED)
+	$(PKGDEPEND) resolve $(EXTDEPFILES:%=-e %) -m $(DEPENDED)
 	$(TOUCH) [email protected]
 
 # lint the manifests all at once