make-rules/ips.mk
changeset 32 280a7444e782
parent 30 440b6ca0641d
child 38 cd00ea74156e
--- a/make-rules/ips.mk	Wed Aug 25 11:58:58 2010 -0700
+++ b/make-rules/ips.mk	Thu Sep 02 11:07:22 2010 -0500
@@ -172,6 +172,16 @@
 $(COMPONENT_SRC)/.published:	manifest-compare $(PUBLISHED)
 	$(TOUCH) $@
 
+print-package-names:	canonical-manifests
+	@cat $(CANONICAL_MANIFESTS) $(WS_TOP)/transforms/print-pkgs | \
+		$(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 | \
+ 		sed -e '/^$$/d' -e '/^#.*$$/d' | sort -u
+
+print-package-paths:	canonical-manifests
+	@cat $(CANONICAL_MANIFESTS) $(WS_TOP)/transforms/print-paths | \
+		$(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 | \
+ 		sed -e '/^$$/d' -e '/^#.*$$/d' | sort -u
+
 canonical-manifests:	$(CANONICAL_MANIFESTS)
 ifeq	($(strip $(CANONICAL_MANIFESTS)),)
 	# If there were no canonical manifests in the workspace, nothing will
@@ -182,3 +192,12 @@
 	# workspace.
 	$(error Missing canonical manifest(s))
 endif
+
+# This converts required paths to containing package names for be able to
+# properly setup the build environment for a component.
+required-pkgs.mk:	Makefile
+	@echo "generating $@ from Makefile REQUIRED_* data"
+	@pkg search -H -l '<$(DEPENDS:%=% OR) /bin/true>' \
+		| sed -e 's/pkg:\/\(.*\)@.*/REQUIRED_PKGS += \1/g' >$@
+
+CLEAN_PATHS +=	required-pkgs.mk