[apparmor] [PATCH] split parser build into "arch" "indep" and "check"

Kees Cook kees at ubuntu.com
Fri May 27 21:19:11 UTC 2011


In some cases, it is desirable to build the parser without building the
binary portions (Hurd). This patch splits up the build targets so this is
possible:

"main" becomes "arch"

"indep" is created and depends on "docs"
po building is moved from "main" to "indep"

"all" has "tests" removed (standard build practices are to "make" then
"make check" so I think "tests"/"check" should stay separate from "all").

redundant chunk is removed (this exists twice in the Makefile):
-.SILENT: check
-check: tests

"install" is split into "install-indep" and "install-arch"

"install-arch" requires "arch" and only installs the binaries

"install-indep" requires "indep" and only install non-binaries

=== modified file 'parser/Makefile'
--- parser/Makefile	2011-05-23 18:29:41 +0000
+++ parser/Makefile	2011-05-27 21:11:07 +0000
@@ -130,8 +130,7 @@
 
 # targets arranged this way so that people who don't want full docs can
 # pick specific targets they want.
-main: 	$(TOOLS)
-	$(Q)make -C po all
+arch: 	$(TOOLS)
 
 manpages:	$(MANPAGES)
 
@@ -141,7 +140,11 @@
 
 docs:	manpages htmlmanpages pdf
 
-all:	main docs tests
+indep: docs
+	$(Q)make -C po all
+
+all:	arch indep
+
 
 .PHONY: libstdc++.a
 libstdc++.a:
@@ -229,9 +232,6 @@
 	sh -e -c 'for test in ${TESTS} ; do echo "*** running $${test}" && ./$${test}; done'
 	$(Q)make -s -C tst tests
 
-.SILENT: check
-check: tests
-
 # always need to rebuild.
 .SILENT: $(AAREOBJECT)
 .PHONY: $(AAREOBJECT)
@@ -270,15 +270,21 @@
 .PHONY: install-unknown
 install-unknown:
 
-INSTALLDEPS=$(TOOLS)
+INSTALLDEPS=arch
 ifdef DISTRO
 INSTALLDEPS+=install-$(DISTRO)
 endif
 
 .PHONY: install
-install: $(INSTALLDEPS)
+install: install-indep install-arch
+
+.PHONY: install-arch
+install-arch: $(INSTALLDEPS)
 	install -m 755 -d $(DESTDIR)/sbin
 	install -m 755 ${TOOLS} $(DESTDIR)/sbin
+
+.PHONY: install-indep
+install-indep:
 	install -m 755 -d $(INSTALL_CONFDIR)
 	install -m 644 subdomain.conf $(INSTALL_CONFDIR)
 	install -m 755 -d ${DESTDIR}/var/lib/apparmor


-- 
Kees Cook
Ubuntu Security Team



More information about the AppArmor mailing list