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
#
# 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 configuration of the root directory.
ifndef LOCAL_ROOT
include $(ROOT)/build.conf
include build.conf
else
include $(LOCAL_ROOT)/build.conf
endif
@ -39,13 +35,12 @@ endif
VERSION = $(shell cat VERSION)
ifdef LOCAL_ROOT
BUILDDIR := $(LOCAL_ROOT)
BUILDDIR := $(LOCAL_ROOT)/
TMPDIR := $(LOCAL_ROOT)/tmp
TAGS := $(LOCAL_ROOT)/tags
else
BUILDDIR := $(ROOT)
TMPDIR := $(ROOT)/tmp
TAGS := $(ROOT)/tags
TMPDIR := tmp
TAGS := tags
endif
# executable paths
@ -71,7 +66,7 @@ SED ?= sed
CFLAGS += -Wall
# policy source layout
POLDIR := $(ROOT)/policy
POLDIR := policy
MODDIR := $(POLDIR)/modules
FLASKDIR := $(POLDIR)/flask
SECCLASS := $(FLASKDIR)/security_classes
@ -85,7 +80,7 @@ LOCAL_MODDIR := $(LOCAL_POLDIR)/modules
endif
# policy building support tools
SUPPORT := $(ROOT)/support
SUPPORT := support
GENXML := $(PYTHON) $(SUPPORT)/segenxml.py
GENDOC := $(PYTHON) $(SUPPORT)/sedoctool.py
GENPERM := $(PYTHON) $(SUPPORT)/genclassperms.py
@ -93,7 +88,7 @@ FCSORT := $(TMPDIR)/fc_sort
SETBOOLS := $(AWK) -f $(SUPPORT)/set_bools_tuns.awk
# documentation paths
DOCS = $(ROOT)/doc
DOCS := doc
XMLDTD = $(DOCS)/policy.dtd
LAYERXML = metadata.xml
DOCTEMPLATE = $(DOCS)/templates
@ -212,7 +207,7 @@ endif
M4SUPPORT = $(wildcard $(POLDIR)/support/*.spt $(LOCAL_POLDIR)/support/*.spt)
APPCONF := $(ROOT)/config/appconfig-$(TYPE)
APPCONF := config/appconfig-$(TYPE)
SEUSERS := $(APPCONF)/seusers
APPDIR := $(CONTEXTPATH)
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)
include $(ROOT)/Rules.monolithic
include Rules.monolithic
else
include $(ROOT)/Rules.modular
include Rules.modular
endif
########################################

View File

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

View File

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