fix regression; remove unneeded ROOT and make BUILDDIR have a / if its set.

This commit is contained in:
Chris PeBenito 2006-02-16 17:11:58 +00:00
parent 988a441b79
commit 5b45ffb07a
3 changed files with 32 additions and 35 deletions

View File

@ -23,14 +23,10 @@
# NO OPTIONS BELOW HERE # NO OPTIONS BELOW HERE
# #
# Top level directory - so make can be run from outside
# of the tree (if this is overridden on the command line)
ROOT ?= .
# Include the local build.conf if it exists, otherwise # Include the local build.conf if it exists, otherwise
# include the configuration of the root directory. # include the configuration of the root directory.
ifndef LOCAL_ROOT ifndef LOCAL_ROOT
include $(ROOT)/build.conf include build.conf
else else
include $(LOCAL_ROOT)/build.conf include $(LOCAL_ROOT)/build.conf
endif endif
@ -39,13 +35,12 @@ endif
VERSION = $(shell cat VERSION) VERSION = $(shell cat VERSION)
ifdef LOCAL_ROOT ifdef LOCAL_ROOT
BUILDDIR := $(LOCAL_ROOT) BUILDDIR := $(LOCAL_ROOT)/
TMPDIR := $(LOCAL_ROOT)/tmp TMPDIR := $(LOCAL_ROOT)/tmp
TAGS := $(LOCAL_ROOT)/tags TAGS := $(LOCAL_ROOT)/tags
else else
BUILDDIR := $(ROOT) TMPDIR := tmp
TMPDIR := $(ROOT)/tmp TAGS := tags
TAGS := $(ROOT)/tags
endif endif
# executable paths # executable paths
@ -71,7 +66,7 @@ SED ?= sed
CFLAGS += -Wall CFLAGS += -Wall
# policy source layout # policy source layout
POLDIR := $(ROOT)/policy POLDIR := policy
MODDIR := $(POLDIR)/modules MODDIR := $(POLDIR)/modules
FLASKDIR := $(POLDIR)/flask FLASKDIR := $(POLDIR)/flask
SECCLASS := $(FLASKDIR)/security_classes SECCLASS := $(FLASKDIR)/security_classes
@ -85,7 +80,7 @@ LOCAL_MODDIR := $(LOCAL_POLDIR)/modules
endif endif
# policy building support tools # policy building support tools
SUPPORT := $(ROOT)/support SUPPORT := support
GENXML := $(PYTHON) $(SUPPORT)/segenxml.py GENXML := $(PYTHON) $(SUPPORT)/segenxml.py
GENDOC := $(PYTHON) $(SUPPORT)/sedoctool.py GENDOC := $(PYTHON) $(SUPPORT)/sedoctool.py
GENPERM := $(PYTHON) $(SUPPORT)/genclassperms.py GENPERM := $(PYTHON) $(SUPPORT)/genclassperms.py
@ -93,7 +88,7 @@ FCSORT := $(TMPDIR)/fc_sort
SETBOOLS := $(AWK) -f $(SUPPORT)/set_bools_tuns.awk SETBOOLS := $(AWK) -f $(SUPPORT)/set_bools_tuns.awk
# documentation paths # documentation paths
DOCS = $(ROOT)/doc DOCS := doc
XMLDTD = $(DOCS)/policy.dtd XMLDTD = $(DOCS)/policy.dtd
LAYERXML = metadata.xml LAYERXML = metadata.xml
DOCTEMPLATE = $(DOCS)/templates DOCTEMPLATE = $(DOCS)/templates
@ -212,7 +207,7 @@ endif
M4SUPPORT = $(wildcard $(POLDIR)/support/*.spt $(LOCAL_POLDIR)/support/*.spt) M4SUPPORT = $(wildcard $(POLDIR)/support/*.spt $(LOCAL_POLDIR)/support/*.spt)
APPCONF := $(ROOT)/config/appconfig-$(TYPE) APPCONF := config/appconfig-$(TYPE)
SEUSERS := $(APPCONF)/seusers SEUSERS := $(APPCONF)/seusers
APPDIR := $(CONTEXTPATH) APPDIR := $(CONTEXTPATH)
APPFILES := $(addprefix $(APPDIR)/,default_contexts default_type initrc_context failsafe_context userhelper_context removable_context dbus_contexts customizable_types) $(CONTEXTPATH)/files/media APPFILES := $(addprefix $(APPDIR)/,default_contexts default_type initrc_context failsafe_context userhelper_context removable_context dbus_contexts customizable_types) $(CONTEXTPATH)/files/media
@ -279,9 +274,9 @@ endef
# #
ifeq ($(MONOLITHIC),y) ifeq ($(MONOLITHIC),y)
include $(ROOT)/Rules.monolithic include Rules.monolithic
else else
include $(ROOT)/Rules.modular include Rules.modular
endif endif
######################################## ########################################

View File

@ -6,9 +6,9 @@
ALL_MODULES := $(BASE_MODS) $(MOD_MODS) $(OFF_MODS) ALL_MODULES := $(BASE_MODS) $(MOD_MODS) $(OFF_MODS)
ALL_INTERFACES := $(ALL_MODULES:.te=.if) ALL_INTERFACES := $(ALL_MODULES:.te=.if)
BASE_PKG := $(BUILDDIR)/base.pp BASE_PKG := $(BUILDDIR)base.pp
BASE_FC := $(BUILDDIR)/base.fc BASE_FC := $(BUILDDIR)base.fc
BASE_CONF := $(BUILDDIR)/base.conf BASE_CONF := $(BUILDDIR)base.conf
BASE_MOD := $(TMPDIR)/base.mod BASE_MOD := $(TMPDIR)/base.mod
USERS_EXTRA := $(TMPDIR)/users_extra USERS_EXTRA := $(TMPDIR)/users_extra
@ -21,7 +21,7 @@ BASE_POST_TE_FILES := $(USER_FILES) $(POLDIR)/constraints
BASE_FC_FILES := $(BASE_MODS:.te=.fc) BASE_FC_FILES := $(BASE_MODS:.te=.fc)
MOD_MODULES := $(MOD_MODS:.te=.mod) MOD_MODULES := $(MOD_MODS:.te=.mod)
MOD_PKGS := $(addprefix $(BUILDDIR)/,$(notdir $(MOD_MODS:.te=.pp))) MOD_PKGS := $(addprefix $(BUILDDIR),$(notdir $(MOD_MODS:.te=.pp)))
# policy packages to install # policy packages to install
INSTPKG := $(addprefix $(MODPKGDIR)/,$(notdir $(BASE_PKG)) $(MOD_PKGS)) INSTPKG := $(addprefix $(MODPKGDIR)/,$(notdir $(BASE_PKG)) $(MOD_PKGS))
@ -59,7 +59,7 @@ load: $(INSTPKG) $(APPFILES)
# #
# Install policy packages # Install policy packages
# #
$(MODPKGDIR)/%.pp: $(BUILDDIR)/%.pp $(MODPKGDIR)/%.pp: $(BUILDDIR)%.pp
@mkdir -p $(MODPKGDIR) @mkdir -p $(MODPKGDIR)
@echo "Installing $(NAME) $(@F) policy package." @echo "Installing $(NAME) $(@F) policy package."
$(verbose) install -m 0644 $^ $(MODPKGDIR) $(verbose) install -m 0644 $^ $(MODPKGDIR)
@ -79,7 +79,7 @@ $(TMPDIR)/%.mod.fc: $(M4SUPPORT) %.fc
@test -d $(TMPDIR) || mkdir -p $(TMPDIR) @test -d $(TMPDIR) || mkdir -p $(TMPDIR)
$(verbose) m4 $(M4PARAM) $(M4SUPPORT) $^ > $@ $(verbose) m4 $(M4PARAM) $(M4SUPPORT) $^ > $@
$(BUILDDIR)/%.pp: $(TMPDIR)/%.mod $(TMPDIR)/%.mod.fc $(BUILDDIR)%.pp: $(TMPDIR)/%.mod $(TMPDIR)/%.mod.fc
@echo "Creating $(NAME) $(@F) policy package" @echo "Creating $(NAME) $(@F) policy package"
@test -d $(BUILDDIR) || mkdir -p $(BUILDDIR) @test -d $(BUILDDIR) || mkdir -p $(BUILDDIR)
$(verbose) $(SEMOD_PKG) -o $@ -m $< -f $<.fc $(verbose) $(SEMOD_PKG) -o $@ -m $< -f $<.fc
@ -137,7 +137,7 @@ $(TMPDIR)/generated_definitions.conf: $(BASE_TE_FILES)
$(verbose) for i in $(notdir $(BASE_TE_FILES)); do \ $(verbose) for i in $(notdir $(BASE_TE_FILES)); do \
echo "define(\`$$i')" >> $@ ;\ echo "define(\`$$i')" >> $@ ;\
done done
$(verbose) test -f $(BOOLEANS) && $(SETBOOLS) $(BOOLEANS) >> $@ $(verbose) test -f $(BOOLEANS) && $(SETBOOLS) $(BOOLEANS) >> $@ || true
$(TMPDIR)/all_interfaces.conf: $(M4SUPPORT) $(ALL_INTERFACES) $(TMPDIR)/all_interfaces.conf: $(M4SUPPORT) $(ALL_INTERFACES)
ifeq ($(ALL_INTERFACES),) ifeq ($(ALL_INTERFACES),)
@ -214,7 +214,7 @@ $(APPDIR)/customizable_types: $(BASE_CONF)
clean: clean:
rm -f $(BASE_CONF) rm -f $(BASE_CONF)
rm -f $(BASE_FC) rm -f $(BASE_FC)
rm -f $(BUILDDIR)/*.pp rm -f $(BUILDDIR)*.pp
rm -fR $(TMPDIR) rm -fR $(TMPDIR)
.PHONY: default all policy base modules install load clean .PHONY: default all policy base modules install load clean

View File

@ -3,14 +3,14 @@
# Rules and Targets for building monolithic policies # Rules and Targets for building monolithic policies
# #
POLICY_CONF = $(BUILDDIR)/policy.conf POLICY_CONF = $(BUILDDIR)policy.conf
FC = $(BUILDDIR)/file_contexts FC = $(BUILDDIR)file_contexts
POLVER = policy.$(PV) POLVER = $(BUILDDIR)policy.$(PV)
HOMEDIR_TEMPLATE = $(BUILDDIR)/homedir_template HOMEDIR_TEMPLATE = $(BUILDDIR)homedir_template
# install paths # install paths
POLICYPATH = $(INSTALLDIR)/policy POLICYPATH = $(INSTALLDIR)/policy
LOADPATH = $(POLICYPATH)/$(POLVER) LOADPATH = $(POLICYPATH)/$(notdir $(POLVER))
HOMEDIRPATH = $(CONTEXTPATH)/files/homedir_template HOMEDIRPATH = $(CONTEXTPATH)/files/homedir_template
APPFILES += $(INSTALLDIR)/booleans APPFILES += $(INSTALLDIR)/booleans
@ -60,7 +60,7 @@ ifneq ($(PV),$(KV))
@echo "WARNING: Policy version mismatch! Is your OUTPUT_POLICY set correctly?" @echo "WARNING: Policy version mismatch! Is your OUTPUT_POLICY set correctly?"
@echo @echo
endif endif
$(verbose) $(CHECKPOLICY) $^ -o $(BUILDDIR)/$@ $(verbose) $(CHECKPOLICY) $^ -o $@
######################################## ########################################
# #
@ -118,7 +118,7 @@ $(TMPDIR)/generated_definitions.conf: $(ALL_TE_FILES)
$(verbose) for i in $(notdir $(ALL_MODULES)); do \ $(verbose) for i in $(notdir $(ALL_MODULES)); do \
echo "define(\`$$i')" >> $@ ;\ echo "define(\`$$i')" >> $@ ;\
done done
$(verbose) test -f $(BOOLEANS) && $(SETBOOLS) $(BOOLEANS) >> $@ $(verbose) test -f $(BOOLEANS) && $(SETBOOLS) $(BOOLEANS) >> $@ || true
$(TMPDIR)/all_interfaces.conf: $(M4SUPPORT) $(ALL_INTERFACES) $(TMPDIR)/all_interfaces.conf: $(M4SUPPORT) $(ALL_INTERFACES)
ifeq ($(ALL_INTERFACES),) ifeq ($(ALL_INTERFACES),)
@ -197,11 +197,13 @@ $(FCPATH): $(FC) $(LOADPATH) $(USERPATH)/system.users
# #
# Run policy source checks # Run policy source checks
# #
check: $(POLICY_CONF) $(FC) check: $(BUILDDIR)check.res
$(SECHECK) -s --profile=development --policy=$(POLICY_CONF) --fcfile=$(FC) > $(BUILDDIR)/$@.res $(BUILDDIR)check.res: $(POLICY_CONF) $(FC)
$(SECHECK) -s --profile=development --policy=$(POLICY_CONF) --fcfile=$(FC) > $@
longcheck: $(POLICY_CONF) $(FC) longcheck: $(BUILDDIR)longcheck.res
$(SECHECK) -s --profile=all --policy=$(POLICY_CONF) --fcfile=$(FC) > $(BUILDDIR)/$@.res $(BUILDDIR)longcheck.res: $(POLICY_CONF) $(FC)
$(SECHECK) -s --profile=all --policy=$(POLICY_CONF) --fcfile=$(FC) > $@
######################################## ########################################
# #
@ -218,7 +220,7 @@ $(APPDIR)/customizable_types: policy.conf
# #
clean: clean:
rm -f $(POLICY_CONF) rm -f $(POLICY_CONF)
rm -f $(BUILDDIR)/policy.$(PV) rm -f $(POLVER)
rm -f $(FC) rm -f $(FC)
rm -f $(HOMEDIR_TEMPLATE) rm -f $(HOMEDIR_TEMPLATE)
rm -f *.res rm -f *.res