update Makefile

This commit is contained in:
cgzones 2016-11-29 18:08:29 +01:00
parent dd20b09f12
commit 4e199ae145
1 changed files with 47 additions and 43 deletions

View File

@ -32,7 +32,7 @@ ifdef LOCAL_ROOT
endif
# refpolicy version
version = $(shell cat VERSION)
version := $(shell cat VERSION)
ifdef LOCAL_ROOT
builddir := $(LOCAL_ROOT)/
@ -70,13 +70,13 @@ SECHECK ?= $(BINDIR)/sechecker
AWK ?= gawk
GREP ?= egrep
INSTALL ?= install
M4 ?= m4
PYTHON ?= python
M4 ?= m4 -E -E
PYTHON ?= python -t -t
SED ?= sed
SORT ?= LC_ALL=C sort
UMASK ?= umask
CFLAGS += -Wall
CFLAGS += -Wall -Wextra -Werror -O2
# policy source layout
poldir := policy
@ -112,58 +112,58 @@ genhomedircon := $(PYTHON) -E $(support)/genhomedircon
# documentation paths
docs := doc
xmldtd = $(docs)/policy.dtd
metaxml = metadata.xml
doctemplate = $(docs)/templates
docfiles = $(docs)/Makefile.example $(addprefix $(docs)/,example.te example.if example.fc)
xmldtd := $(docs)/policy.dtd
metaxml := metadata.xml
doctemplate := $(docs)/templates
docfiles := $(docs)/Makefile.example $(addprefix $(docs)/,example.te example.if example.fc)
ifndef LOCAL_ROOT
polxml = $(docs)/policy.xml
tunxml = $(docs)/global_tunables.xml
boolxml = $(docs)/global_booleans.xml
htmldir = $(docs)/html
polxml := $(docs)/policy.xml
tunxml := $(docs)/global_tunables.xml
boolxml := $(docs)/global_booleans.xml
htmldir := $(docs)/html
else
polxml = $(LOCAL_ROOT)/doc/policy.xml
tunxml = $(LOCAL_ROOT)/doc/global_tunables.xml
boolxml = $(LOCAL_ROOT)/doc/global_booleans.xml
htmldir = $(LOCAL_ROOT)/doc/html
polxml := $(LOCAL_ROOT)/doc/policy.xml
tunxml := $(LOCAL_ROOT)/doc/global_tunables.xml
boolxml := $(LOCAL_ROOT)/doc/global_booleans.xml
htmldir := $(LOCAL_ROOT)/doc/html
endif
# config file paths
globaltun = $(poldir)/global_tunables
globalbool = $(poldir)/global_booleans
globaltun := $(poldir)/global_tunables
globalbool := $(poldir)/global_booleans
user_files := $(poldir)/users
policycaps := $(poldir)/policy_capabilities
ctx_defaults := $(poldir)/context_defaults
# local config file paths
ifndef LOCAL_ROOT
mod_conf = $(poldir)/modules.conf
booleans = $(poldir)/booleans.conf
tunables = $(poldir)/tunables.conf
mod_conf := $(poldir)/modules.conf
booleans := $(poldir)/booleans.conf
tunables := $(poldir)/tunables.conf
else
mod_conf = $(local_poldir)/modules.conf
booleans = $(local_poldir)/booleans.conf
tunables = $(local_poldir)/tunables.conf
mod_conf := $(local_poldir)/modules.conf
booleans := $(local_poldir)/booleans.conf
tunables := $(local_poldir)/tunables.conf
endif
# install paths
PKGNAME ?= refpolicy-$(version)
prefix = $(DESTDIR)/usr
topdir = $(DESTDIR)/etc/selinux
installdir = $(topdir)/$(strip $(NAME))
srcpath = $(installdir)/src
userpath = $(installdir)/users
policypath = $(installdir)/policy
contextpath = $(installdir)/contexts
homedirpath = $(contextpath)/files/homedir_template
fcpath = $(contextpath)/files/file_contexts
fcsubspath = $(contextpath)/files/file_contexts.subs_dist
ncpath = $(contextpath)/netfilter_contexts
sharedir = $(prefix)/share/selinux
modpkgdir = $(sharedir)/$(strip $(NAME))
headerdir = $(modpkgdir)/include
docsdir = $(prefix)/share/doc/$(PKGNAME)
prefix := $(DESTDIR)/usr
topdir := $(DESTDIR)/etc/selinux
installdir := $(topdir)/$(strip $(NAME))
srcpath := $(installdir)/src
userpath := $(installdir)/users
policypath := $(installdir)/policy
contextpath := $(installdir)/contexts
homedirpath := $(contextpath)/files/homedir_template
fcpath := $(contextpath)/files/file_contexts
fcsubspath := $(contextpath)/files/file_contexts.subs_dist
ncpath := $(contextpath)/netfilter_contexts
sharedir := $(prefix)/share/selinux
modpkgdir := $(sharedir)/$(strip $(NAME))
headerdir := $(modpkgdir)/include
docsdir := $(prefix)/share/doc/$(PKGNAME)
# enable MLS if requested.
ifeq "$(TYPE)" "mls"
@ -389,11 +389,15 @@ $(net_contexts): $(moddir)/kernel/corenetwork.te.in
#
# Create config files
#
conf: $(mod_conf) $(booleans) $(generated_te) $(generated_if) $(generated_fc)
conf: $(mod_conf) $(booleans) generate
$(mod_conf) $(booleans): $(polxml)
@echo "Updating $(mod_conf) and $(booleans)"
$(verbose) $(gendoc) -b $(booleans) -m $(mod_conf) -x $(polxml)
$(booleans): $(polxml)
@echo "Updating $(booleans)"
$(verbose) $(gendoc) -b $(booleans) -x $(polxml)
$(mod_conf): $(polxml)
@echo "Updating $(mod_conf)"
$(verbose) $(gendoc) -m $(mod_conf) -x $(polxml)
########################################
#