From 106396289a4299c7dba319d31263c2a15c8dafc1 Mon Sep 17 00:00:00 2001 From: Steve Beattie Date: Sat, 10 Dec 2016 10:25:31 -0800 Subject: [PATCH] build: make documentation at tarball creation time, not during build The latex based techdoc in the parser/ tree adds a number of build dependencies for downstreams to create it; it also is the primary element to make the builds unrepeatable. Creating the techdoc and other documentation when generating a tarball for distribution avoids all that. * Makefile: build documentation as part of the tarball creation. Skip the libraries/libapparmor directory as it needs to have configure run before the manpages can be made. * changehat/mod_apparmor/Makefile, changehat/mod_apparmor/Makefile, utils/Makefile, profiles/Makefile: create separate docs target, some of them dummies. * parser/Makefile: pull the techdoc out of the default build target, add an extra_docs target to create it. Signed-off-by: Steve Beattie Acked-by: John Johansen Acked-by: Christian Boltz --- Makefile | 6 ++++++ changehat/mod_apparmor/Makefile | 6 +++++- changehat/pam_apparmor/Makefile | 7 ++++++- parser/Makefile | 3 ++- profiles/Makefile | 8 ++++++-- utils/Makefile | 7 +++++-- 6 files changed, 30 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index d4d6f632a..028dbc26d 100644 --- a/Makefile +++ b/Makefile @@ -75,6 +75,12 @@ clean: .PHONY: setup setup: cd $(__SETUP_DIR)/libraries/libapparmor && ./autogen.sh + # parser has an extra doc to build + make -C $(__SETUP_DIR)/parser extra_docs + # libraries/libapparmor needs configure to have run before + # building docs + $(foreach dir, $(filter-out libraries/libapparmor tests, $(DIRS)), \ + make -C $(__SETUP_DIR)/$(dir) docs;) .PHONY: tag tag: diff --git a/changehat/mod_apparmor/Makefile b/changehat/mod_apparmor/Makefile index 29bf06110..a51114f41 100644 --- a/changehat/mod_apparmor/Makefile +++ b/changehat/mod_apparmor/Makefile @@ -1,5 +1,6 @@ # ---------------------------------------------------------------------- # Copyright (c) 2004, 2005 NOVELL (All rights reserved) +# Copyright (c) 2016 Canonical, Ltd. # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public @@ -73,7 +74,10 @@ endif .SILENT: libapparmor_check libapparmor_check: ; $(ERROR_MESSAGE) -all: libapparmor_check $(TARGET) ${MANPAGES} ${HTMLMANPAGES} +all: libapparmor_check $(TARGET) docs + +.PHONY: docs +docs: ${MANPAGES} ${HTMLMANPAGES} %.so: %.c ${APXS} ${LIBAPPARMOR_FLAGS} -c $< ${LDLIBS} diff --git a/changehat/pam_apparmor/Makefile b/changehat/pam_apparmor/Makefile index 092131e46..80303e6e2 100644 --- a/changehat/pam_apparmor/Makefile +++ b/changehat/pam_apparmor/Makefile @@ -1,5 +1,6 @@ # ---------------------------------------------------------------------- # Copyright (c) 1999, 2004, 2005 NOVELL (All rights reserved) +# Copyright (c) 2016 Canonical, Ltd. # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public @@ -62,7 +63,11 @@ OBJECTS=${NAME}.o get_options.o .SILENT: libapparmor_check libapparmor_check: ; $(ERROR_MESSAGE) -all: libapparmor_check $(NAME).so +all: libapparmor_check $(NAME).so docs + +.PHONY: docs +# docs: we should have some +docs: $(NAME).so: ${OBJECTS} $(CC) $(EXTRA_CFLAGS) $(LINK_FLAGS) -o $@ ${OBJECTS} $(LIBS) diff --git a/parser/Makefile b/parser/Makefile index 35c9bd498..670944198 100644 --- a/parser/Makefile +++ b/parser/Makefile @@ -161,7 +161,8 @@ htmlmanpages: $(HTMLMANPAGES) pdf: techdoc.pdf -docs: manpages htmlmanpages pdf +docs: manpages htmlmanpages +extra_docs: pdf indep: docs $(Q)$(MAKE) -C po all diff --git a/profiles/Makefile b/profiles/Makefile index 1e5beda1e..bb49e06fa 100644 --- a/profiles/Makefile +++ b/profiles/Makefile @@ -1,7 +1,7 @@ # ------------------------------------------------------------------ # # Copyright (C) 2002-2009 Novell/SUSE -# Copyright (C) 2010 Canonical Ltd. +# Copyright (C) 2010-2016 Canonical Ltd. # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public @@ -20,7 +20,7 @@ # Makefile for LSM-based AppArmor profiles NAME=apparmor-profiles -all: local +all: local docs COMMONDIR=../common/ include $(COMMONDIR)/Make.rules @@ -75,6 +75,10 @@ ifndef LOGPROF LOGPROF=PYTHONPATH=../utils $(PYTHON) ../utils/aa-logprof endif +.PHONY: docs +# docs: should we have some here? +docs: + IGNORE_FILES=${EXTRAS_SOURCE}/README CHECK_PROFILES=$(filter-out ${IGNORE_FILES} ${SUBDIRS}, $(wildcard ${PROFILES_SOURCE}/*) $(wildcard ${EXTRAS_SOURCE}/*)) diff --git a/utils/Makefile b/utils/Makefile index acfddbaec..67caa0dbe 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -1,6 +1,6 @@ # ---------------------------------------------------------------------- # Copyright (c) 1999, 2004-2009 NOVELL (All rights reserved) -# Copyright (c) 2010-2011 Canonical Ltd. +# Copyright (c) 2010-2016 Canonical Ltd. # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public @@ -30,10 +30,13 @@ PYMODULES = $(wildcard apparmor/*.py apparmor/rule/*.py) MANPAGES = ${TOOLS:=.8} logprof.conf.5 -all: ${MANPAGES} ${HTMLMANPAGES} +all: docs $(MAKE) -C po all $(MAKE) -C vim all +.PHONY: docs +docs: ${MANPAGES} ${HTMLMANPAGES} + # need some better way of determining this DESTDIR=/ BINDIR=${DESTDIR}/usr/sbin