aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Vermeulen <sven.vermeulen@siphos.be>2018-03-25 13:56:37 +0200
committerJason Zaman <jason@perfinion.com>2018-06-14 17:37:51 +0800
commitf42ea96bbfb376ca738206a0bd9bdc68c4826264 (patch)
treef2309adadff433ba6c6264cf110a4752c0c78ddb /Makefile
parentUpdate segenxml to include support for templated booleans and tunables (diff)
downloadhardened-refpolicy-f42ea96bbfb376ca738206a0bd9bdc68c4826264.tar.gz
hardened-refpolicy-f42ea96bbfb376ca738206a0bd9bdc68c4826264.tar.bz2
hardened-refpolicy-f42ea96bbfb376ca738206a0bd9bdc68c4826264.zip
Generate template code and update genxml call for documentation generation
Update the Makefile to first build the template files (template code definitions) and then have all segenxml calls use these files. Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 12 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 1447f5b1..db767566 100644
--- a/Makefile
+++ b/Makefile
@@ -110,6 +110,7 @@ m4terminate := $(support)/fatal_error.m4
# use our own genhomedircon to make sure we have a known usable one,
# so policycoreutils updates are not required (RHEL4)
genhomedircon := $(PYTHON) $(support)/genhomedircon.py
+gentemplates := $(support)/gentemplates.sh
# documentation paths
docs := doc
@@ -416,12 +417,20 @@ $(fcsort) : $(support)/fc_sort.c
#
# Documentation generation
#
-$(layerxml): %.xml: $(all_metaxml) $(filter $(addprefix $(moddir)/, $(notdir $*))%, $(detected_mods)) $(subst .te,.if, $(filter $(addprefix $(moddir)/, $(notdir $*))%, $(detected_mods)))
+iftemplates:
+ @echo "generating interface templates into $(tmpdir)/iftemplates"
+ @test -d $(tmpdir)/iftemplates || mkdir -p $(tmpdir)/iftemplates
+ $(gentemplates) -g -s $(moddir) -t $(tmpdir)/iftemplates
+ifdef LOCAL_ROOT
+ $(gentemplates) -g -s $(local_moddir) -t $(tmpdir)/iftemplates
+endif
+
+$(layerxml): %.xml: iftemplates $(all_metaxml) $(filter $(addprefix $(moddir)/, $(notdir $*))%, $(detected_mods)) $(subst .te,.if, $(filter $(addprefix $(moddir)/, $(notdir $*))%, $(detected_mods)))
@test -d $(tmpdir) || mkdir -p $(tmpdir)
$(verbose) cat $(filter %$(notdir $*)/$(metaxml), $(all_metaxml)) > $@
- $(verbose) for i in $(basename $(filter $(addprefix $(moddir)/, $(notdir $*))%, $(detected_mods))); do $(genxml) -w -m $$i >> $@; done
+ $(verbose) for i in $(basename $(filter $(addprefix $(moddir)/, $(notdir $*))%, $(detected_mods))); do $(genxml) -w -T $(tmpdir)/iftemplates -m $$i >> $@; done
ifdef LOCAL_ROOT
- $(verbose) for i in $(basename $(filter $(addprefix $(local_moddir)/, $(notdir $*))%, $(detected_mods))); do $(genxml) -w -m $$i >> $@; done
+ $(verbose) for i in $(basename $(filter $(addprefix $(local_moddir)/, $(notdir $*))%, $(detected_mods))); do $(genxml) -w -T $(tmpdir)/iftemplates -m $$i >> $@; done
endif
$(tunxml): $(globaltun)