Chris PeBenito 88d14a2
#
Chris PeBenito 88d14a2
# Makefile for the security policy.
Chris PeBenito 88d14a2
#
Chris PeBenito 88d14a2
# Targets:
Chris PeBenito 88d14a2
# 
Chris PeBenito 88d14a2
# install       - compile and install the policy configuration, and context files.
Chris PeBenito 88d14a2
# load          - compile, install, and load the policy configuration.
Chris PeBenito 88d14a2
# reload        - compile, install, and load/reload the policy configuration.
Chris PeBenito 88d14a2
# relabel       - relabel filesystems based on the file contexts configuration.
Chris PeBenito 88d14a2
# checklabels   - check filesystems against the file context configuration
Chris PeBenito 88d14a2
# restorelabels - check filesystems against the file context configuration
Chris PeBenito 88d14a2
#                 and restore the label of files with incorrect labels
Chris PeBenito 88d14a2
# policy        - compile the policy configuration locally for testing/development.
Chris PeBenito 88d14a2
#
Chris PeBenito 88d14a2
# The default target is 'policy'.
Chris PeBenito 88d14a2
#
Chris PeBenito b4cd153
#
Chris PeBenito 8e0ef1f
# Please see build.conf for policy build options.
Chris PeBenito b4cd153
#
Chris PeBenito b4cd153
Chris PeBenito b4cd153
########################################
Chris PeBenito b4cd153
#
Chris PeBenito b67488e
# NO OPTIONS BELOW HERE
Chris PeBenito b4cd153
#
Chris PeBenito b4cd153
Chris PeBenito c9f20d5
# Include the local build.conf if it exists, otherwise
Chris PeBenito c9f20d5
# include the configuration of the root directory.
Chris PeBenito 1a7175a
include build.conf
Chris PeBenito 1a7175a
Chris PeBenito 1a7175a
ifdef LOCAL_ROOT
Chris PeBenito 1a7175a
	-include $(LOCAL_ROOT)/build.conf
Chris PeBenito c9f20d5
endif
Chris PeBenito 8e0ef1f
Chris PeBenito 120988c
# refpolicy version
Chris PeBenito c634db2
version = $(shell cat VERSION)
Chris PeBenito 120988c
Chris PeBenito c9f20d5
ifdef LOCAL_ROOT
Chris PeBenito c634db2
builddir := $(LOCAL_ROOT)/
Chris PeBenito c634db2
tmpdir := $(LOCAL_ROOT)/tmp
Chris PeBenito c634db2
tags := $(LOCAL_ROOT)/tags
Chris PeBenito c9f20d5
else
Chris PeBenito c634db2
tmpdir := tmp
Chris PeBenito c634db2
tags := tags
Chris PeBenito c9f20d5
endif
Chris PeBenito c9f20d5
Chris PeBenito b4cd153
# executable paths
Chris PeBenito 906f108
BINDIR ?= /usr/bin
Chris PeBenito 906f108
SBINDIR ?= /usr/sbin
Chris PeBenito e2ae086
ifdef TEST_TOOLCHAIN
Chris PeBenito 75beb95
tc_usrbindir := env LD_LIBRARY_PATH="$(TEST_TOOLCHAIN)/lib" $(TEST_TOOLCHAIN)$(BINDIR)
Chris PeBenito 75beb95
tc_usrsbindir := env LD_LIBRARY_PATH="$(TEST_TOOLCHAIN)/lib" $(TEST_TOOLCHAIN)$(SBINDIR)
Chris PeBenito 75beb95
tc_sbindir := env LD_LIBRARY_PATH="$(TEST_TOOLCHAIN)/lib" $(TEST_TOOLCHAIN)/sbin
Chris PeBenito e2ae086
else
Chris PeBenito 75beb95
tc_usrbindir := $(BINDIR)
Chris PeBenito 75beb95
tc_usrsbindir := $(SBINDIR)
Chris PeBenito 75beb95
tc_sbindir := /sbin
Chris PeBenito e2ae086
endif
Chris PeBenito 75beb95
CHECKPOLICY ?= $(tc_usrbindir)/checkpolicy
Chris PeBenito 75beb95
CHECKMODULE ?= $(tc_usrbindir)/checkmodule
Chris PeBenito 75beb95
SEMODULE ?= $(tc_usrsbindir)/semodule
Chris PeBenito 75beb95
SEMOD_PKG ?= $(tc_usrbindir)/semodule_package
Chris PeBenito 75beb95
SEMOD_LNK ?= $(tc_usrbindir)/semodule_link
Chris PeBenito 75beb95
SEMOD_EXP ?= $(tc_usrbindir)/semodule_expand
Chris PeBenito 75beb95
LOADPOLICY ?= $(tc_usrsbindir)/load_policy
Chris PeBenito e2ae086
SETFILES ?= $(tc_sbindir)/setfiles
Chris PeBenito 906f108
XMLLINT ?= $(BINDIR)/xmllint
Chris PeBenito 906f108
SECHECK ?= $(BINDIR)/sechecker
Chris PeBenito 0447352
Chris PeBenito 0e686f1
# interpreters and aux tools
Chris PeBenito 0e686f1
AWK ?= gawk
Chris PeBenito 0e686f1
GREP ?= egrep
Chris PeBenito cfd5c5e
INSTALL ?= install
Chris PeBenito 0e686f1
M4 ?= m4
Chris PeBenito 0e686f1
PYTHON ?= python
Chris PeBenito 0e686f1
SED ?= sed
Chris PeBenito f62f4c7
SORT ?= LC_ALL=C sort
Chris PeBenito 0e686f1
Chris PeBenito 0e686f1
CFLAGS += -Wall
Chris PeBenito c7b41e9
Chris PeBenito fb0a3a9
# policy source layout
Chris PeBenito c634db2
poldir := policy
Chris PeBenito c634db2
moddir := $(poldir)/modules
Chris PeBenito c634db2
flaskdir := $(poldir)/flask
Chris PeBenito c634db2
secclass := $(flaskdir)/security_classes
Chris PeBenito c634db2
isids := $(flaskdir)/initial_sids
Chris PeBenito c634db2
avs := $(flaskdir)/access_vectors
Chris PeBenito fb0a3a9
Chris PeBenito c9f20d5
# local source layout
Chris PeBenito c9f20d5
ifdef LOCAL_ROOT
Chris PeBenito c634db2
local_poldir := $(LOCAL_ROOT)/policy
Chris PeBenito c634db2
local_moddir := $(local_poldir)/modules
Chris PeBenito c9f20d5
endif
Chris PeBenito c9f20d5
Chris PeBenito fb0a3a9
# policy building support tools
Chris PeBenito c634db2
support := support
Chris PeBenito 1a79cf0
genxml := $(PYTHON) -E $(support)/segenxml.py
Chris PeBenito 1a79cf0
gendoc := $(PYTHON) -E $(support)/sedoctool.py
Chris PeBenito 1a79cf0
genperm := $(PYTHON) -E $(support)/genclassperms.py
Chris PeBenito c634db2
fcsort := $(tmpdir)/fc_sort
Chris PeBenito c634db2
setbools := $(AWK) -f $(support)/set_bools_tuns.awk
Chris PeBenito c634db2
get_type_attr_decl := $(SED) -r -f $(support)/get_type_attr_decl.sed
Chris PeBenito c634db2
comment_move_decl := $(SED) -r -f $(support)/comment_move_decl.sed
Chris PeBenito 1a79cf0
gennetfilter := $(PYTHON) -E $(support)/gennetfilter.py
Chris PeBenito e276d50
m4iferror := $(support)/iferror.m4
Chris PeBenito 90286f4
m4divert := $(support)/divert.m4
Chris PeBenito 90286f4
m4undivert := $(support)/undivert.m4
Chris PeBenito fc47b34
# use our own genhomedircon to make sure we have a known usable one,
Chris PeBenito fc47b34
# so policycoreutils updates are not required (RHEL4)
Chris PeBenito 1a79cf0
genhomedircon := $(PYTHON) -E $(support)/genhomedircon
Chris PeBenito 3a80ec2
Chris PeBenito fb0a3a9
# documentation paths
Chris PeBenito c634db2
docs := doc
Chris PeBenito c634db2
xmldtd = $(docs)/policy.dtd
Chris PeBenito 56e1b3d
metaxml = metadata.xml
Chris PeBenito c634db2
doctemplate = $(docs)/templates
Chris PeBenito c634db2
docfiles = $(docs)/Makefile.example $(addprefix $(docs)/,example.te example.if example.fc)
Chris PeBenito fb0a3a9
Chris PeBenito c9f20d5
ifndef LOCAL_ROOT
Chris PeBenito c634db2
polxml = $(docs)/policy.xml
Chris PeBenito c634db2
tunxml = $(docs)/global_tunables.xml
Chris PeBenito c634db2
boolxml = $(docs)/global_booleans.xml
Chris PeBenito c634db2
htmldir = $(docs)/html
Chris PeBenito c9f20d5
else
Chris PeBenito c634db2
polxml = $(LOCAL_ROOT)/doc/policy.xml
Chris PeBenito c634db2
tunxml = $(LOCAL_ROOT)/doc/global_tunables.xml
Chris PeBenito c634db2
boolxml = $(LOCAL_ROOT)/doc/global_booleans.xml
Chris PeBenito c634db2
htmldir = $(LOCAL_ROOT)/doc/html
Chris PeBenito c9f20d5
endif
Chris PeBenito c9f20d5
Chris PeBenito fb0a3a9
# config file paths
Chris PeBenito c634db2
globaltun = $(poldir)/global_tunables
Chris PeBenito c634db2
globalbool = $(poldir)/global_booleans
Chris PeBenito c634db2
rolemap = $(poldir)/rolemap
Chris PeBenito c634db2
user_files := $(poldir)/users
Chris PeBenito c07f9cc
policycaps := $(poldir)/policy_capabilities
Chris PeBenito fb0a3a9
Chris PeBenito c9f20d5
# local config file paths
Chris PeBenito c9f20d5
ifndef LOCAL_ROOT
Chris PeBenito c634db2
mod_conf = $(poldir)/modules.conf
Chris PeBenito c634db2
booleans = $(poldir)/booleans.conf
Chris PeBenito c634db2
tunables = $(poldir)/tunables.conf
Chris PeBenito c9f20d5
else
Chris PeBenito c634db2
mod_conf = $(local_poldir)/modules.conf
Chris PeBenito c634db2
booleans = $(local_poldir)/booleans.conf
Chris PeBenito c634db2
tunables = $(local_poldir)/tunables.conf
Chris PeBenito c9f20d5
endif
Chris PeBenito c9f20d5
Chris PeBenito fb0a3a9
# install paths
Chris PeBenito c634db2
PKGNAME ?= refpolicy-$(version)
Chris PeBenito c634db2
prefix = $(DESTDIR)/usr
Chris PeBenito c634db2
topdir = $(DESTDIR)/etc/selinux
Chris PeBenito c634db2
installdir = $(topdir)/$(strip $(NAME))
Chris PeBenito c634db2
srcpath = $(installdir)/src
Chris PeBenito c634db2
userpath = $(installdir)/users
Chris PeBenito 2128323
policypath = $(installdir)/policy
Chris PeBenito c634db2
contextpath = $(installdir)/contexts
Chris PeBenito 2128323
homedirpath = $(contextpath)/files/homedir_template
Chris PeBenito c634db2
fcpath = $(contextpath)/files/file_contexts
Chris PeBenito c634db2
ncpath = $(contextpath)/netfilter_contexts
Chris PeBenito c634db2
sharedir = $(prefix)/share/selinux
Chris PeBenito c634db2
modpkgdir = $(sharedir)/$(strip $(NAME))
Chris PeBenito c634db2
headerdir = $(modpkgdir)/include
Chris PeBenito c634db2
docsdir = $(prefix)/share/doc/$(PKGNAME)
Chris PeBenito c767b14
Chris PeBenito 134191b
# enable MLS if requested.
Chris PeBenito 350b6ab
ifeq "$(TYPE)" "mls"
Chris PeBenito 3f026a9
	M4PARAM += -D enable_mls
Chris PeBenito 3f026a9
	CHECKPOLICY += -M
Chris PeBenito 3f026a9
	CHECKMODULE += -M
Chris PeBenito 6962bb3
	gennetfilter += -m
Chris PeBenito 134191b
endif
Chris PeBenito 134191b
Chris PeBenito a082484
# enable MLS if MCS requested.
Chris PeBenito 350b6ab
ifeq "$(TYPE)" "mcs"
Chris PeBenito 3f026a9
	M4PARAM += -D enable_mcs
Chris PeBenito 3f026a9
	CHECKPOLICY += -M
Chris PeBenito 3f026a9
	CHECKMODULE += -M
Chris PeBenito 6962bb3
	gennetfilter += -c
Chris PeBenito b67488e
endif
Chris PeBenito b67488e
Chris PeBenito 25a0c61
# enable distribution-specific policy
Chris PeBenito 25a0c61
ifneq ($(DISTRO),)
Chris PeBenito 3f026a9
	M4PARAM += -D distro_$(DISTRO)
Chris PeBenito 25a0c61
endif
Chris PeBenito 25a0c61
Chris PeBenito 2f1a8fb
# rhel4 also implies redhat
Chris PeBenito 2f1a8fb
ifeq "$(DISTRO)" "rhel4"
Chris PeBenito 2f1a8fb
	M4PARAM += -D distro_redhat
Chris PeBenito 2f1a8fb
endif
Chris PeBenito 2f1a8fb
Chris PeBenito 12cf805
ifeq "$(DISTRO)" "ubuntu"
Chris PeBenito 12cf805
	M4PARAM += -D distro_debian
Chris PeBenito 12cf805
endif
Chris PeBenito 12cf805
Chris PeBenito b67488e
ifneq ($(OUTPUT_POLICY),)
Chris PeBenito 3f026a9
	CHECKPOLICY += -c $(OUTPUT_POLICY)
Chris PeBenito b67488e
endif
Chris PeBenito b67488e
Chris PeBenito 3f026a9
# if not set, use the type as the name.
Chris PeBenito 3f026a9
NAME ?= $(TYPE)
Chris PeBenito 134191b
Chris PeBenito 8acfcbc
# default unknown permissions setting
Chris PeBenito 8acfcbc
#UNK_PERMS ?= deny
Chris PeBenito 8acfcbc
Chris PeBenito 142e9f4
ifeq ($(DIRECT_INITRC),y)
Chris PeBenito 3f026a9
	M4PARAM += -D direct_sysadm_daemon
Chris PeBenito 142e9f4
endif
Chris PeBenito 142e9f4
Chris PeBenito 296273a
ifeq "$(UBAC)" "y"
Chris PeBenito 296273a
	M4PARAM += -D enable_ubac
Chris PeBenito 296273a
endif
Chris PeBenito 296273a
Chris PeBenito e070dd2
# default MLS/MCS sensitivity and category settings.
Chris PeBenito e070dd2
MLS_SENS ?= 16
Chris PeBenito 0001e26
MLS_CATS ?= 1024
Chris PeBenito 0001e26
MCS_CATS ?= 1024
Chris PeBenito e070dd2
Chris PeBenito 9b3756b
ifeq ($(QUIET),y)
Chris PeBenito 9b3756b
	verbose = @
Chris PeBenito 9b3756b
endif
Chris PeBenito 9b3756b
Chris PeBenito e070dd2
M4PARAM += -D mls_num_sens=$(MLS_SENS) -D mls_num_cats=$(MLS_CATS) -D mcs_num_cats=$(MCS_CATS) -D hide_broken_symptoms
Chris PeBenito ee7f66b
Chris PeBenito 37227dc
# we need exuberant ctags; unfortunately it is named
Chris PeBenito 37227dc
# differently on different distros
Chris PeBenito 37227dc
ifeq ($(DISTRO),debian)
Chris PeBenito 37227dc
	CTAGS := ctags-exuberant
Chris PeBenito 37227dc
endif
Chris PeBenito 37227dc
Chris PeBenito 37227dc
ifeq ($(DISTRO),gentoo)
Chris PeBenito 37227dc
	CTAGS := exuberant-ctags	
Chris PeBenito 37227dc
endif
Chris PeBenito 37227dc
Chris PeBenito a4fae7f
CTAGS ?= ctags
Chris PeBenito 37227dc
Chris PeBenito 90286f4
m4support := $(m4divert) $(wildcard $(poldir)/support/*.spt)
Chris PeBenito 2014458
ifdef LOCAL_ROOT
Chris PeBenito c634db2
m4support += $(wildcard $(local_poldir)/support/*.spt)
Chris PeBenito 2014458
endif
Chris PeBenito 90286f4
m4support += $(m4undivert)
Chris PeBenito 0fbe15d
Chris PeBenito c634db2
appconf := config/appconfig-$(TYPE)
Chris PeBenito c634db2
seusers := $(appconf)/seusers
Chris PeBenito c634db2
appdir := $(contextpath)
Chris PeBenito 8a2492a
user_default_contexts := $(wildcard config/appconfig-$(TYPE)/*_default_contexts)
Chris PeBenito 8a2492a
user_default_contexts_names := $(addprefix $(contextpath)/users/,$(subst _default_contexts,,$(notdir $(user_default_contexts))))
a34c78a
appfiles := $(addprefix $(appdir)/,default_contexts default_type initrc_context failsafe_context userhelper_context removable_context dbus_contexts sepgsql_contexts x_contexts customizable_types securetty_types virtual_image_context virtual_domain_context) $(contextpath)/files/media $(user_default_contexts_names)
Chris PeBenito c634db2
net_contexts := $(builddir)net_contexts
Chris PeBenito c9a26b3
Chris PeBenito 96fc0a4
all_layers := $(shell find $(wildcard $(moddir)/*) -maxdepth 0 -type d)
Chris PeBenito c9f20d5
ifdef LOCAL_ROOT
Chris PeBenito 96fc0a4
all_layers += $(shell find $(wildcard $(local_moddir)/*) -maxdepth 0 -type d)
Chris PeBenito c9f20d5
endif
Chris PeBenito e12e573
Chris PeBenito c634db2
generated_te := $(basename $(foreach dir,$(all_layers),$(wildcard $(dir)/*.te.in)))
Chris PeBenito c634db2
generated_if := $(basename $(foreach dir,$(all_layers),$(wildcard $(dir)/*.if.in)))
Chris PeBenito c634db2
generated_fc := $(basename $(foreach dir,$(all_layers),$(wildcard $(dir)/*.fc.in)))
Chris PeBenito e12e573
Chris PeBenito 8ae194f
# sort here since it removes duplicates, which can happen
Chris PeBenito 8ae194f
# when a generated file is already generated
Chris PeBenito c634db2
detected_mods := $(sort $(foreach dir,$(all_layers),$(wildcard $(dir)/*.te)) $(generated_te))
Chris PeBenito 19db6ba
Chris PeBenito 96fc0a4
modxml := $(addprefix $(tmpdir)/, $(detected_mods:.te=.xml))
Chris PeBenito 96fc0a4
layerxml := $(sort $(addprefix $(tmpdir)/, $(notdir $(addsuffix .xml,$(all_layers)))))
Chris PeBenito 96fc0a4
layer_names := $(sort $(notdir $(all_layers)))
Chris PeBenito 96fc0a4
all_metaxml = $(call detect-metaxml, $(layer_names))
Chris PeBenito 56e1b3d
Chris PeBenito fb0a3a9
# modules.conf setting for base module
Chris PeBenito c634db2
configbase := base
Chris PeBenito fb0a3a9
Chris PeBenito e0a9001
# modules.conf setting for loadable module
Chris PeBenito c634db2
configmod := module
Chris PeBenito fb0a3a9
Chris PeBenito e0a9001
# modules.conf setting for unused module
Chris PeBenito c634db2
configoff := off
Chris PeBenito e0a9001
Chris PeBenito c9f20d5
# test for module overrides from command line
Chris PeBenito c634db2
mod_test = $(filter $(APPS_OFF), $(APPS_BASE) $(APPS_MODS))
Chris PeBenito c634db2
mod_test += $(filter $(APPS_MODS), $(APPS_BASE))
Chris PeBenito c634db2
ifneq "$(strip $(mod_test))" ""
Chris PeBenito c634db2
        $(error Applications must be base, module, or off, and not in more than one list! $(strip $(mod_test)) found in multiple lists!)
Chris PeBenito c9f20d5
endif
Chris PeBenito c9f20d5
Chris PeBenito 2014458
# add on suffix to modules specified on command line
Chris PeBenito c634db2
cmdline_base := $(addsuffix .te,$(APPS_BASE))
Chris PeBenito c634db2
cmdline_mods := $(addsuffix .te,$(APPS_MODS))
Chris PeBenito c634db2
cmdline_off := $(addsuffix .te,$(APPS_OFF))
Chris PeBenito 2014458
Chris PeBenito fb0a3a9
# extract settings from modules.conf
Chris PeBenito c634db2
mod_conf_base := $(addsuffix .te,$(sort $(shell awk '/^[[:blank:]]*[[:alpha:]]/{ if ($$3 == "$(configbase)") print $$1 }' $(mod_conf) 2> /dev/null)))
Chris PeBenito c634db2
mod_conf_mods := $(addsuffix .te,$(sort $(shell awk '/^[[:blank:]]*[[:alpha:]]/{ if ($$3 == "$(configmod)") print $$1 }' $(mod_conf) 2> /dev/null)))
Chris PeBenito c634db2
mod_conf_off := $(addsuffix .te,$(sort $(shell awk '/^[[:blank:]]*[[:alpha:]]/{ if ($$3 == "$(configoff)") print $$1 }' $(mod_conf) 2> /dev/null)))
Chris PeBenito 2014458
Chris PeBenito c634db2
base_mods := $(cmdline_base)
Chris PeBenito c634db2
mod_mods := $(cmdline_mods)
Chris PeBenito c634db2
off_mods := $(cmdline_off)
Chris PeBenito 87e73c5
Chris PeBenito c634db2
base_mods += $(filter-out $(cmdline_off) $(cmdline_base) $(cmdline_mods), $(mod_conf_base))
Chris PeBenito c634db2
mod_mods += $(filter-out $(cmdline_off) $(cmdline_base) $(cmdline_mods), $(mod_conf_mods))
Chris PeBenito c634db2
off_mods += $(filter-out $(cmdline_off) $(cmdline_base) $(cmdline_mods), $(mod_conf_off))
Chris PeBenito 87e73c5
Chris PeBenito 87e73c5
# add modules not in modules.conf to the off list
Chris PeBenito c634db2
off_mods += $(filter-out $(base_mods) $(mod_mods) $(off_mods),$(notdir $(detected_mods)))
Chris PeBenito 712566e
Chris PeBenito 90b331f
# filesystems to be used in labeling targets
Chris PeBenito 0f5e26b
filesystems = $(shell mount | grep -v "context=" | egrep -v '\((|.*,)bind(,.*|)\)' | awk '/(ext[234]|btrfs| xfs| jfs).*rw/{print $$3}';)
Chris PeBenito 0f5e26b
fs_names := "btrfs ext2 ext3 ext4 xfs jfs"
Chris PeBenito 120988c
Chris PeBenito b4cd153
########################################
Chris PeBenito b4cd153
#
Chris PeBenito 4ace0fa
# Functions
Chris PeBenito 4ace0fa
#
Chris PeBenito 4ace0fa
Chris PeBenito bbcd3c9
# parse-rolemap-compat modulename,outputfile
Chris PeBenito bbcd3c9
define parse-rolemap-compat
Chris PeBenito bbcd3c9
	$(verbose) $(M4) $(M4PARAM) $(rolemap) | \
Chris PeBenito bbcd3c9
		$(AWK) '/^[[:blank:]]*[A-Za-z]/{ print "gen_require(type " $$3 "; role " $$1 ";)\n$1_per_userdomain_template(" $$2 "," $$3 "," $$1 ")" }' >> $2
Chris PeBenito bbcd3c9
endef
Chris PeBenito bbcd3c9
Chris PeBenito 4ace0fa
# parse-rolemap modulename,outputfile
Chris PeBenito 4ace0fa
define parse-rolemap
Chris PeBenito c634db2
	$(verbose) $(M4) $(M4PARAM) $(rolemap) | \
Chris PeBenito bbcd3c9
		$(AWK) '/^[[:blank:]]*[A-Za-z]/{ print "gen_require(type " $$3 "; role " $$1 ";)\n$1_per_role_template(" $$2 "," $$3 "," $$1 ")" }' >> $2
Chris PeBenito 4ace0fa
endef
Chris PeBenito 4ace0fa
Chris PeBenito bbcd3c9
# perrole-expansion modulename,outputfile
Chris PeBenito bbcd3c9
define perrole-expansion
Chris PeBenito bbcd3c9
	$(verbose) echo "ifdef(\`""$1""_per_role_template',\`" > $2
Chris PeBenito 4ace0fa
	$(call parse-rolemap,$1,$2)
Chris PeBenito 9b3756b
	$(verbose) echo "')" >> $2
Chris PeBenito bbcd3c9
Chris PeBenito bbcd3c9
	$(verbose) echo "ifdef(\`""$1""_per_userdomain_template',\`" >> $2
Chris PeBenito bbcd3c9
	$(verbose) echo "errprint(\`Warning: per_userdomain_templates have been renamed to per_role_templates (""$1""_per_userdomain_template)'__endline__)" >> $2
Chris PeBenito bbcd3c9
	$(call parse-rolemap-compat,$1,$2)
Chris PeBenito bbcd3c9
	$(verbose) echo "')" >> $2
Chris PeBenito bbcd3c9
endef
Chris PeBenito bbcd3c9
Chris PeBenito bbcd3c9
# create-base-per-role-tmpl modulenames,outputfile
Chris PeBenito bbcd3c9
define create-base-per-role-tmpl
Chris PeBenito bbcd3c9
	$(verbose) echo "define(\`base_per_role_template',\`" >> $2
Chris PeBenito bbcd3c9
Chris PeBenito bbcd3c9
	$(verbose) for i in $1; do \
Chris PeBenito bbcd3c9
		echo "ifdef(\`""$$i""_per_role_template',\`""$$i""_per_role_template("'$$*'")')" \
Chris PeBenito bbcd3c9
			>> $2 ;\
Chris PeBenito bbcd3c9
	done
Chris PeBenito bbcd3c9
Chris PeBenito bbcd3c9
	$(verbose) for i in $1; do \
Chris PeBenito bbcd3c9
		echo "ifdef(\`""$$i""_per_userdomain_template',\`" >> $2 ;\
Chris PeBenito bbcd3c9
		echo "errprint(\`Warning: per_userdomain_templates have been renamed to per_role_templates (""$$i""_per_userdomain_template)'__endline__)" >> $2 ;\
Chris PeBenito bbcd3c9
		echo """$$i""_per_userdomain_template("'$$*'")')"  >> $2 ;\
Chris PeBenito bbcd3c9
	done
Chris PeBenito bbcd3c9
	$(verbose) echo "')" >> $@
Chris PeBenito bbcd3c9
Chris PeBenito 4ace0fa
endef
Chris PeBenito 4ace0fa
Chris PeBenito 96fc0a4
# detect-metaxml layer_names
Chris PeBenito 96fc0a4
ifdef LOCAL_ROOT
Chris PeBenito 96fc0a4
define detect-metaxml
Chris PeBenito 96fc0a4
	$(shell for i in $1; do \
Chris PeBenito 96fc0a4
		if [ -d $(moddir)/$$i -a -d $(local_moddir)/$$i ]; then \
Chris PeBenito 96fc0a4
			if [ -f $(local_moddir)/$$i/$(metaxml) ]; then \
Chris PeBenito 96fc0a4
				echo $(local_moddir)/$$i/$(metaxml) ;\
Chris PeBenito 96fc0a4
			else \
Chris PeBenito 96fc0a4
				echo $(moddir)/$$i/$(metaxml) ;\
Chris PeBenito 96fc0a4
			fi \
Chris PeBenito 96fc0a4
		elif [ -d $(local_moddir)/$$i ]; then
Chris PeBenito 96fc0a4
			echo $(local_moddir)/$$i/$(metaxml) ;\
Chris PeBenito 96fc0a4
		else \
Chris PeBenito 96fc0a4
			echo $(moddir)/$$i/$(metaxml) ;\
Chris PeBenito 96fc0a4
		fi \
Chris PeBenito 96fc0a4
	done )
Chris PeBenito 96fc0a4
endef
Chris PeBenito 96fc0a4
else
Chris PeBenito 96fc0a4
define detect-metaxml
Chris PeBenito 96fc0a4
	$(shell for i in $1; do echo $(moddir)/$$i/$(metaxml); done)
Chris PeBenito 96fc0a4
endef
Chris PeBenito 96fc0a4
endif
Chris PeBenito 96fc0a4
Chris PeBenito 4ace0fa
########################################
Chris PeBenito 4ace0fa
#
Chris PeBenito fb0a3a9
# Load appropriate rules
Chris PeBenito b4cd153
#
Chris PeBenito b4cd153
Chris PeBenito fb0a3a9
ifeq ($(MONOLITHIC),y)
Chris PeBenito 5b45ffb
	include Rules.monolithic
Chris PeBenito fb0a3a9
else
Chris PeBenito 5b45ffb
	include Rules.modular
Chris PeBenito b4cd153
endif
Chris PeBenito b4cd153
Chris PeBenito b4cd153
########################################
Chris PeBenito b4cd153
#
Chris PeBenito fb0a3a9
# Generated files
Chris PeBenito 88d14a2
#
Chris PeBenito c9f20d5
# NOTE: There is no "local" version of these files.
Chris PeBenito c9f20d5
#
Chris PeBenito c634db2
generate: $(generated_te) $(generated_if) $(generated_fc)
Chris PeBenito fffba0b
Chris PeBenito 686f11c
$(moddir)/kernel/corenetwork.if: $(moddir)/kernel/corenetwork.te.in $(moddir)/kernel/corenetwork.if.m4 $(moddir)/kernel/corenetwork.if.in
Chris PeBenito 61bbe53
	@echo "#" > $@
Chris PeBenito 61bbe53
	@echo "# This is a generated file!  Instead of modifying this file, the" >> $@
Chris PeBenito 61bbe53
	@echo "# $(notdir $@).in or $(notdir $@).m4 file should be modified." >> $@
Chris PeBenito 61bbe53
	@echo "#" >> $@
Chris PeBenito 686f11c
	$(verbose) cat $@.in >> $@
Chris PeBenito 019dfaf
	$(verbose) $(GREP) "^[[:blank:]]*network_(interface|node|port|packet)(_controlled)?\(.*\)" $< \
Chris PeBenito 686f11c
		| $(M4) -D self_contained_policy $(M4PARAM) $@.m4 - \
Chris PeBenito cfd5c5e
		| $(SED) -e 's/dollarsone/\$$1/g' -e 's/dollarszero/\$$0/g' >> $@
Chris PeBenito f2e4ab3
Chris PeBenito c634db2
$(moddir)/kernel/corenetwork.te: $(moddir)/kernel/corenetwork.te.m4 $(moddir)/kernel/corenetwork.te.in
Chris PeBenito 61bbe53
	@echo "#" > $@
Chris PeBenito 61bbe53
	@echo "# This is a generated file!  Instead of modifying this file, the" >> $@
Chris PeBenito 61bbe53
	@echo "# $(notdir $@).in or $(notdir $@).m4 file should be modified." >> $@
Chris PeBenito 61bbe53
	@echo "#" >> $@
Chris PeBenito cfd5c5e
	$(verbose) $(M4) -D self_contained_policy $(M4PARAM) $^ \
Chris PeBenito cfd5c5e
		| $(SED) -e 's/dollarsone/\$$1/g' -e 's/dollarszero/\$$0/g' >> $@
Chris PeBenito f2e4ab3
Chris PeBenito b4cd153
########################################
Chris PeBenito b4cd153
#
Chris PeBenito 6962bb3
# Network packet labeling
Chris PeBenito 6962bb3
#
Chris PeBenito c634db2
$(net_contexts): $(moddir)/kernel/corenetwork.te.in
Chris PeBenito 6962bb3
	@echo "Creating netfilter network labeling rules"
Chris PeBenito 6962bb3
	$(verbose) $(gennetfilter) $^ > $@
Chris PeBenito 6962bb3
Chris PeBenito 6962bb3
########################################
Chris PeBenito 6962bb3
#
Chris PeBenito 84eb353
# Create config files
Chris PeBenito 84eb353
#
Chris PeBenito c634db2
conf: $(mod_conf) $(booleans) $(generated_te) $(generated_if) $(generated_fc)
Chris PeBenito d2d6c8c
Chris PeBenito c634db2
$(mod_conf) $(booleans): $(polxml)
Chris PeBenito c634db2
	@echo "Updating $(mod_conf) and $(booleans)"
Chris PeBenito c634db2
	$(verbose) $(gendoc) -b $(booleans) -m $(mod_conf) -x $(polxml)
Chris PeBenito 84eb353
Chris PeBenito 84eb353
########################################
Chris PeBenito 84eb353
#
Chris PeBenito c9f20d5
# Generate the fc_sort program
Chris PeBenito c9f20d5
#
Chris PeBenito c634db2
$(fcsort) : $(support)/fc_sort.c
Chris PeBenito 96fc0a4
	$(verbose) $(CC) $(CFLAGS) $^ -o $@
Chris PeBenito c9f20d5
Chris PeBenito c9f20d5
########################################
Chris PeBenito c9f20d5
#
Chris PeBenito 6d314fd
# Documentation generation
Chris PeBenito 6d314fd
#
Chris PeBenito 96fc0a4
$(layerxml): %.xml: $(all_metaxml) $(filter $(addprefix $(moddir)/, $(notdir $*))%, $(detected_mods)) $(subst .te,.if, $(filter $(addprefix $(moddir)/, $(notdir $*))%, $(detected_mods)))
Chris PeBenito 56e1b3d
	@test -d $(tmpdir) || mkdir -p $(tmpdir)
Chris PeBenito 96fc0a4
	$(verbose) cat $(filter %$(notdir $*)/$(metaxml), $(all_metaxml)) > $@
Chris PeBenito 96fc0a4
	$(verbose) for i in $(basename $(filter $(addprefix $(moddir)/, $(notdir $*))%, $(detected_mods))); do $(genxml) -w -m $$i >> $@; done
Chris PeBenito 96fc0a4
ifdef LOCAL_ROOT
Chris PeBenito 96fc0a4
	$(verbose) for i in $(basename $(filter $(addprefix $(local_moddir)/, $(notdir $*))%, $(detected_mods))); do $(genxml) -w -m $$i >> $@; done
Chris PeBenito 96fc0a4
endif	
Chris PeBenito 56e1b3d
Chris PeBenito 56e1b3d
$(tunxml): $(globaltun)
Chris PeBenito 56e1b3d
	$(verbose) $(genxml) -w -t $< > $@
Chris PeBenito 56e1b3d
Chris PeBenito 56e1b3d
$(boolxml): $(globalbool)
Chris PeBenito 56e1b3d
	$(verbose) $(genxml) -w -b $< > $@
Chris PeBenito 56e1b3d
Chris PeBenito 56e1b3d
$(polxml): $(layerxml) $(tunxml) $(boolxml)
Chris PeBenito 1a7175a
	@echo "Creating $(@F)"
Chris PeBenito c634db2
	@test -d $(dir $(polxml)) || mkdir -p $(dir $(polxml))
Chris PeBenito c634db2
	@test -d $(tmpdir) || mkdir -p $(tmpdir)
Chris PeBenito 9b3756b
	$(verbose) echo '' > $@
Chris PeBenito c634db2
	$(verbose) echo '' >> $@
Chris PeBenito 56e1b3d
	$(verbose) echo '<policy>' >> $@
Chris PeBenito 96fc0a4
	$(verbose) for i in $(basename $(notdir $(layerxml))); do echo "<layer name=\"$$i\">" >> $@; cat $(tmpdir)/$$i.xml >> $@; echo "</layer>" >> $@; done
Chris PeBenito 96fc0a4
	$(verbose) cat $(tunxml) $(boolxml) >> $@
Chris PeBenito 56e1b3d
	$(verbose) echo '</policy>' >> $@
Chris PeBenito c634db2
	$(verbose) if test -x $(XMLLINT) && test -f $(xmldtd); then \
Chris PeBenito c634db2
		$(XMLLINT) --noout --path $(dir $(xmldtd)) --dtdvalid $(xmldtd) $@ ;\
Chris PeBenito 004db90
	fi
Chris PeBenito 6d314fd
Chris PeBenito 56e1b3d
xml: $(polxml)
Chris PeBenito 3d59806
Chris PeBenito c634db2
html $(tmpdir)/html: $(polxml)
Chris PeBenito c634db2
	@echo "Building html interface reference documentation in $(htmldir)"
Chris PeBenito c634db2
	@test -d $(htmldir) || mkdir -p $(htmldir)
Chris PeBenito c634db2
	@test -d $(tmpdir) || mkdir -p $(tmpdir)
Chris PeBenito c634db2
	$(verbose) $(gendoc) -d $(htmldir) -T $(doctemplate) -x $(polxml)
Chris PeBenito c634db2
	$(verbose) cp $(doctemplate)/*.css $(htmldir)
Chris PeBenito c634db2
	@touch $(tmpdir)/html
Chris PeBenito 20030ef
Chris PeBenito c9a26b3
########################################
Chris PeBenito c9a26b3
#
Chris PeBenito c9a26b3
# Runtime binary policy patching of users
Chris PeBenito c9a26b3
#
Chris PeBenito c634db2
$(userpath)/system.users: $(m4support) $(tmpdir)/generated_definitions.conf $(user_files)
Chris PeBenito c634db2
	@mkdir -p $(tmpdir)
Chris PeBenito c634db2
	@mkdir -p $(userpath)
Chris PeBenito c9a26b3
	@echo "Installing system.users"
Chris PeBenito c634db2
	@echo "# " > $(tmpdir)/system.users
Chris PeBenito c634db2
	@echo "# Do not edit this file. " >> $(tmpdir)/system.users
Chris PeBenito c634db2
	@echo "# This file is replaced on reinstalls of this policy." >> $(tmpdir)/system.users
Chris PeBenito c634db2
	@echo "# Please edit local.users to make local changes." >> $(tmpdir)/system.users
Chris PeBenito c634db2
	@echo "#" >> $(tmpdir)/system.users
Chris PeBenito cfd5c5e
	$(verbose) $(M4) -D self_contained_policy $(M4PARAM) $^ | $(SED) -r -e 's/^[[:blank:]]+//' \
Chris PeBenito c634db2
		-e '/^[[:blank:]]*($$|#)/d' >> $(tmpdir)/system.users
Chris PeBenito c634db2
	$(verbose) $(INSTALL) -m 644 $(tmpdir)/system.users $@
Chris PeBenito c9a26b3
Chris PeBenito c634db2
$(userpath)/local.users: config/local.users
Chris PeBenito c634db2
	@mkdir -p $(userpath)
Chris PeBenito c9a26b3
	@echo "Installing local.users"
Chris PeBenito cfd5c5e
	$(verbose) $(INSTALL) -b -m 644 $< $@
Chris PeBenito c9a26b3
Chris PeBenito c9a26b3
########################################
Chris PeBenito c9a26b3
#
Chris PeBenito e070dd2
# Build Appconfig files
Chris PeBenito e070dd2
#
Chris PeBenito e070dd2
$(tmpdir)/initrc_context: $(appconf)/initrc_context
Chris PeBenito e070dd2
	@mkdir -p $(tmpdir)
Chris PeBenito e070dd2
	$(verbose) $(M4) $(M4PARAM) $(m4support) $^ | $(GREP) '^[a-z]' > $@
Chris PeBenito e070dd2
Chris PeBenito e070dd2
########################################
Chris PeBenito e070dd2
#
Chris PeBenito e070dd2
# Install Appconfig files
Chris PeBenito c9a26b3
#
Chris PeBenito c634db2
install-appconfig: $(appfiles)
Chris PeBenito c9a26b3
Chris PeBenito c634db2
$(installdir)/booleans: $(booleans)
Chris PeBenito c634db2
	@mkdir -p $(tmpdir)
Chris PeBenito c634db2
	@mkdir -p $(installdir)
Chris PeBenito cfd5c5e
	$(verbose) $(SED) -r -e 's/false/0/g' -e 's/true/1/g' \
Chris PeBenito c634db2
		-e '/^[[:blank:]]*($$|#)/d' $(booleans) | $(SORT) > $(tmpdir)/booleans
Chris PeBenito c634db2
	$(verbose) $(INSTALL) -m 644 $(tmpdir)/booleans $@
Chris PeBenito 1beba1c
Chris PeBenito c634db2
$(contextpath)/files/media: $(appconf)/media
Chris PeBenito c634db2
	@mkdir -p $(contextpath)/files/
Chris PeBenito cfd5c5e
	$(verbose) $(INSTALL) -m 644 $< $@
Chris PeBenito c9a26b3
Chris PeBenito 8a2492a
$(contextpath)/users/%: $(appconf)/%_default_contexts
Chris PeBenito c634db2
	@mkdir -p $(appdir)/users
Chris PeBenito 8a2492a
	$(verbose) $(INSTALL) -m 644 $^ $@
Chris PeBenito 9b3756b
Chris PeBenito b23e1c1
$(appdir)/%: $(appconf)/%
Chris PeBenito b23e1c1
	@mkdir -p $(appdir)
Chris PeBenito 90286f4
	$(verbose) $(M4) $(M4PARAM) $(m4support) $< > $@
Chris PeBenito b23e1c1
Chris PeBenito 9b3756b
########################################
Chris PeBenito 9b3756b
#
Chris PeBenito 9b3756b
# Install policy headers
Chris PeBenito 9b3756b
#
Chris PeBenito 56e1b3d
install-headers: $(layerxml) $(tunxml) $(boolxml)
Chris PeBenito c634db2
	@mkdir -p $(headerdir)
Chris PeBenito 0bf2bc9
	@echo "Installing $(NAME) policy headers."
Chris PeBenito 96fc0a4
	$(verbose) $(INSTALL) -m 644 $^ $(headerdir)
Chris PeBenito c634db2
	$(verbose) $(M4) $(M4PARAM) $(rolemap) > $(headerdir)/$(notdir $(rolemap))
Chris PeBenito c634db2
	$(verbose) mkdir -p $(headerdir)/support
Chris PeBenito c634db2
	$(verbose) $(INSTALL) -m 644 $(m4support) $(word $(words $(genxml)),$(genxml)) $(xmldtd) $(headerdir)/support
Chris PeBenito c634db2
	$(verbose) $(genperm) $(avs) $(secclass) > $(headerdir)/support/all_perms.spt
Chris PeBenito c634db2
	$(verbose) for i in $(notdir $(all_layers)); do \
Chris PeBenito c634db2
		mkdir -p $(headerdir)/$$i ;\
Chris PeBenito 96fc0a4
		$(INSTALL) -m 644 $(moddir)/$$i/*.if $(headerdir)/$$i ;\
Chris PeBenito 885b83e
	done
Chris PeBenito c634db2
	$(verbose) echo "TYPE ?= $(TYPE)" > $(headerdir)/build.conf
Chris PeBenito c634db2
	$(verbose) echo "NAME ?= $(NAME)" >> $(headerdir)/build.conf
Chris PeBenito 885b83e
ifneq "$(DISTRO)" ""
Chris PeBenito c634db2
	$(verbose) echo "DISTRO ?= $(DISTRO)" >> $(headerdir)/build.conf
Chris PeBenito 885b83e
endif
Chris PeBenito c634db2
	$(verbose) echo "MONOLITHIC ?= n" >> $(headerdir)/build.conf
Chris PeBenito c634db2
	$(verbose) echo "DIRECT_INITRC ?= $(DIRECT_INITRC)" >> $(headerdir)/build.conf
Chris PeBenito 296273a
	$(verbose) echo "override UBAC := $(UBAC)" >> $(headerdir)/build.conf
Chris PeBenito e070dd2
	$(verbose) echo "override MLS_SENS := $(MLS_SENS)" >> $(headerdir)/build.conf
Chris PeBenito e070dd2
	$(verbose) echo "override MLS_CATS := $(MLS_CATS)" >> $(headerdir)/build.conf
Chris PeBenito e070dd2
	$(verbose) echo "override MCS_CATS := $(MCS_CATS)" >> $(headerdir)/build.conf
Chris PeBenito c634db2
	$(verbose) $(INSTALL) -m 644 $(support)/Makefile.devel $(headerdir)/Makefile
Chris PeBenito c9a26b3
Chris PeBenito c592e52
########################################
Chris PeBenito c592e52
#
Chris PeBenito 120988c
# Install policy documentation
Chris PeBenito 120988c
#
Chris PeBenito c634db2
install-docs: $(tmpdir)/html
Chris PeBenito c634db2
	@mkdir -p $(docsdir)/html
Chris PeBenito 120988c
	@echo "Installing policy documentation"
Chris PeBenito c634db2
	$(verbose) $(INSTALL) -m 644 $(docfiles) $(docsdir)
Chris PeBenito c634db2
	$(verbose) $(INSTALL) -m 644 $(wildcard $(htmldir)/*) $(docsdir)/html
Chris PeBenito 120988c
Chris PeBenito 120988c
########################################
Chris PeBenito 120988c
#
Chris PeBenito c592e52
# Install policy sources
Chris PeBenito c592e52
#
Chris PeBenito c592e52
install-src:
Chris PeBenito c634db2
	rm -rf $(srcpath)/policy.old
Chris PeBenito c634db2
	-mv $(srcpath)/policy $(srcpath)/policy.old
Chris PeBenito c634db2
	mkdir -p $(srcpath)/policy
Chris PeBenito c634db2
	cp -R . $(srcpath)/policy
Chris PeBenito c592e52
Chris PeBenito 102a59b
########################################
Chris PeBenito 102a59b
#
Chris PeBenito 37227dc
# Generate tags file
Chris PeBenito 37227dc
#
Chris PeBenito c634db2
tags: $(tags)
Chris PeBenito c634db2
$(tags):
Chris PeBenito 37227dc
	@($(CTAGS) --version | grep -q Exuberant) || (echo ERROR: Need exuberant-ctags to function!; exit 1)
Chris PeBenito c634db2
	@LC_ALL=C $(CTAGS) -f $(tags) --langdef=te --langmap=te:..te.if.spt \
Chris PeBenito 37227dc
	 --regex-te='/^type[ \t]+(\w+)(,|;)/\1/t,type/' \
Chris PeBenito 37227dc
	 --regex-te='/^typealias[ \t]+\w+[ \t+]+alias[ \t]+(\w+);/\1/t,type/' \
Chris PeBenito 37227dc
	 --regex-te='/^attribute[ \t]+(\w+);/\1/a,attribute/' \
Chris PeBenito 37227dc
	 --regex-te='/^[ \t]*define\(`(\w+)/\1/d,define/' \
Chris PeBenito 37227dc
	 --regex-te='/^[ \t]*interface\(`(\w+)/\1/i,interface/' \
Chris PeBenito 4231988
	 --regex-te='/^[ \t]*template\(`(\w+)/\1/i,template/' \
Chris PeBenito 37227dc
	 --regex-te='/^[ \t]*bool[ \t]+(\w+)/\1/b,bool/' policy/modules/*/*.{if,te} policy/support/*.spt
Chris PeBenito 37227dc
Chris PeBenito 37227dc
########################################
Chris PeBenito 37227dc
#
Chris PeBenito 120988c
# Filesystem labeling
Chris PeBenito 120988c
#
Chris PeBenito 120988c
checklabels:
Chris PeBenito 0f5e26b
	@echo "Checking labels on filesystem types: $(fs_names)"
Chris PeBenito c634db2
	@if test -z "$(filesystems)"; then \
Chris PeBenito 120988c
		echo "No filesystems with extended attributes found!" ;\
Chris PeBenito 120988c
		false ;\
Chris PeBenito 120988c
	fi
Chris PeBenito c634db2
	$(verbose) $(SETFILES) -v -n $(fcpath) $(filesystems)
Chris PeBenito 120988c
Chris PeBenito 120988c
restorelabels:
Chris PeBenito 0f5e26b
	@echo "Restoring labels on filesystem types: $(fs_names)"
Chris PeBenito c634db2
	@if test -z "$(filesystems)"; then \
Chris PeBenito 120988c
		echo "No filesystems with extended attributes found!" ;\
Chris PeBenito 120988c
		false ;\
Chris PeBenito 120988c
	fi
Chris PeBenito c634db2
	$(verbose) $(SETFILES) -v $(fcpath) $(filesystems)
Chris PeBenito 120988c
Chris PeBenito 120988c
relabel:
Chris PeBenito 0f5e26b
	@echo "Relabeling filesystem types: $(fs_names)"
Chris PeBenito c634db2
	@if test -z "$(filesystems)"; then \
Chris PeBenito 120988c
		echo "No filesystems with extended attributes found!" ;\
Chris PeBenito 120988c
		false ;\
Chris PeBenito 120988c
	fi
Chris PeBenito c634db2
	$(verbose) $(SETFILES) $(fcpath) $(filesystems)
Chris PeBenito 120988c
Chris PeBenito 120988c
resetlabels:
Chris PeBenito 0f5e26b
	@echo "Resetting labels on filesystem types: $(fs_names)"
Chris PeBenito c634db2
	@if test -z "$(filesystems)"; then \
Chris PeBenito 120988c
		echo "No filesystems with extended attributes found!" ;\
Chris PeBenito 120988c
		false ;\
Chris PeBenito 120988c
	fi
Chris PeBenito c634db2
	$(verbose) $(SETFILES) -F $(fcpath) $(filesystems)
Chris PeBenito 120988c
Chris PeBenito 120988c
########################################
Chris PeBenito 120988c
#
Chris PeBenito 102a59b
# Clean everything
Chris PeBenito 102a59b
#
Chris PeBenito 0fbe15d
bare: clean
Chris PeBenito c634db2
	rm -f $(polxml)
Chris PeBenito 56e1b3d
	rm -f $(layerxml)
Chris PeBenito 56e1b3d
	rm -f $(modxml)
Chris PeBenito c634db2
	rm -f $(tunxml)
Chris PeBenito c634db2
	rm -f $(boolxml)
Chris PeBenito c634db2
	rm -f $(mod_conf)
Chris PeBenito c634db2
	rm -f $(booleans)
Chris PeBenito c634db2
	rm -fR $(htmldir)
Chris PeBenito c634db2
	rm -f $(tags)
Chris PeBenito c9f20d5
# don't remove these files if we're given a local root
Chris PeBenito c9f20d5
ifndef LOCAL_ROOT
Chris PeBenito c634db2
	rm -f $(fcsort)
Chris PeBenito c634db2
	rm -f $(support)/*.pyc
Chris PeBenito c634db2
ifneq ($(generated_te),)
Chris PeBenito c634db2
	rm -f $(generated_te)
Chris PeBenito c767b14
endif
Chris PeBenito c634db2
ifneq ($(generated_if),)
Chris PeBenito c634db2
	rm -f $(generated_if)
Chris PeBenito c767b14
endif
Chris PeBenito c634db2
ifneq ($(generated_fc),)
Chris PeBenito c634db2
	rm -f $(generated_fc)
Chris PeBenito c767b14
endif
Chris PeBenito c9f20d5
endif
Chris PeBenito 0fbe15d
Chris PeBenito 96fc0a4
.PHONY: install-src install-appconfig install-headers generate xml conf html bare tags
Chris PeBenito b8c7982
.SUFFIXES:
Chris PeBenito b8c7982
.SUFFIXES: .c