]> git.ipfire.org Git - people/stevee/selinux-policy.git/blame - refpolicy/Makefile
change modules.conf handling
[people/stevee/selinux-policy.git] / refpolicy / Makefile
CommitLineData
88d14a22
CP
1#
2# Makefile for the security policy.
3#
4# Targets:
5#
6# install - compile and install the policy configuration, and context files.
7# load - compile, install, and load the policy configuration.
8# reload - compile, install, and load/reload the policy configuration.
9# relabel - relabel filesystems based on the file contexts configuration.
10# checklabels - check filesystems against the file context configuration
11# restorelabels - check filesystems against the file context configuration
12# and restore the label of files with incorrect labels
13# policy - compile the policy configuration locally for testing/development.
14#
15# The default target is 'policy'.
16#
17
b4cd1533
CP
18########################################
19#
20# Configurable portions of the Makefile
21#
22
b67488e3
CP
23# Override default policy version
24OUTPUT_POLICY = 18
134191be 25
b67488e3
CP
26# Policy Type
27# strict, targeted, strict-mls, targeted-mls
28# strict and strict-mls are currently supported.
29TYPE = strict
b4cd1533 30
b67488e3
CP
31# If set, this will be used as the policy
32# name. Otherwise the policy type will be
33# used for the name.
34NAME =
35
36# Build monolithic policy. Putting n here
37# will build a loadable module policy.
38# Only monolithic policies are currently supported.
39MONOLITHIC=y
b4cd1533
CP
40
41# Uncomment this to disable command echoing
42#QUIET:=@
43
44########################################
45#
b67488e3 46# NO OPTIONS BELOW HERE
b4cd1533
CP
47#
48
49# executable paths
50PREFIX := /usr
51BINDIR := $(PREFIX)/bin
52SBINDIR := $(PREFIX)/sbin
53CHECKPOLICY := $(BINDIR)/checkpolicy
547283e2 54LOADPOLICY := $(SBINDIR)/load_policy
b4cd1533 55SETFILES := $(SBINDIR)/setfiles
1beba1c6 56GENHOMEDIRCON := $(SBINDIR)/genhomedircon
0447352a 57
c7b41e95
CP
58CFLAGS := -Wall
59
3a80ec29 60SUPPORT := support
95db4228 61GENXML := $(SUPPORT)/segenxml.py
3a80ec29 62GENDOC := $(SUPPORT)/sedoctool.py
254bbc7b 63FCSORT := $(SUPPORT)/fc_sort
84eb353c 64SETTUN := $(SUPPORT)/set_tunables
3a80ec29 65
004db90d 66XMLLINT := $(BINDIR)/xmllint
b4cd1533 67
134191be 68# enable MLS if requested.
b67488e3 69ifneq ($(findstring mls,$(TYPE)),)
134191be
CP
70 override M4PARAM += -D enable_mls
71 CHECKPOLICY += -M
72endif
73
b67488e3
CP
74# compile targeted policy if requested.
75ifneq ($(findstring targeted,$(TYPE)),)
76 override M4PARAM += -D targeted_policy
77endif
78
79ifeq ($(MONOLITHIC),y)
80 override M4PARAM += -D monolithic_policy
81endif
82
83ifneq ($(OUTPUT_POLICY),)
84 CHECKPOLICY += -c $(OUTPUT_POLICY)
85endif
86
87ifeq ($(NAME),)
88 NAME := $(TYPE)
134191be
CP
89endif
90
b4cd1533 91# determine the policy version and current kernel version if possible
134191be 92PV := $(shell $(CHECKPOLICY) -V |cut -f 1 -d ' ')
b4cd1533
CP
93KV := $(shell cat /selinux/policyvers)
94
95# dont print version warnings if we are unable to determine
96# the currently running kernel's policy version
97ifeq ($(KV),)
134191be 98 KV := $(PV)
b4cd1533
CP
99endif
100
101FC := file_contexts
102POLVER := policy.$(PV)
b4cd1533
CP
103
104# install paths
105TOPDIR = $(DESTDIR)/etc/selinux
b67488e3 106INSTALLDIR = $(TOPDIR)/$(NAME)
b4cd1533
CP
107POLICYPATH = $(INSTALLDIR)/policy
108SRCPATH = $(INSTALLDIR)/src
109USERPATH = $(INSTALLDIR)/users
110CONTEXTPATH = $(INSTALLDIR)/contexts
111LOADPATH = $(POLICYPATH)/$(POLVER)
112FCPATH = $(CONTEXTPATH)/files/file_contexts
113HOMEDIRPATH = $(CONTEXTPATH)/files/homedir_template
114
b67488e3
CP
115POLDIR = policy
116MODDIR = $(POLDIR)/modules
117
118BASE_MODULE = $(MODDIR)/kernel
119FLASKDIR = $(POLDIR)/flask
09693356 120APPCONF = config/appconfig
0350b1dc 121M4SUPPORT = $(wildcard $(POLDIR)/support/*.spt)
b4cd1533 122
84eb353c 123GLOBALTUN := $(POLDIR)/global_tunables
0350b1dc 124MOD_DISABLE := $(POLDIR)/modules.conf
84eb353c 125TUNABLES := $(POLDIR)/tunables.conf
0fbe15dc 126
c9a26b3e 127APPDIR := $(CONTEXTPATH)
1beba1c6 128APPFILES := $(addprefix $(APPDIR)/,default_contexts default_type initrc_context failsafe_context userhelper_context removable_context dbus_contexts customizable_types) $(CONTEXTPATH)/files/media $(INSTALLDIR)/booleans
2926f9c7 129CONTEXTFILES += $(wildcard $(APPCONF)/*_context*) $(APPCONF)/media
b67488e3 130USER_FILES := $(POLDIR)/users
c9a26b3e 131
e12e5738 132DISABLEMOD := $(foreach mod,$(shell egrep -v '^[[:blank:]]*\#' $(MOD_DISABLE)),$(subst ./,,$(shell find -iname $(mod).te)))
57869a68 133ALL_LAYERS := $(filter-out $(MODDIR)/CVS,$(shell find $(wildcard $(MODDIR)/*) -maxdepth 0 -type d))
e12e5738
CP
134
135GENERATED_TE := $(basename $(foreach dir,$(ALL_LAYERS),$(wildcard $(dir)/*.te.in)))
136GENERATED_IF := $(basename $(foreach dir,$(ALL_LAYERS),$(wildcard $(dir)/*.if.in)))
137GENERATED_FC := $(basename $(foreach dir,$(ALL_LAYERS),$(wildcard $(dir)/*.fc.in)))
138
8ae194f6
CP
139# sort here since it removes duplicates, which can happen
140# when a generated file is already generated
141DETECTED_MODS := $(sort $(foreach dir,$(ALL_LAYERS),$(wildcard $(dir)/*.te)) $(GENERATED_TE))
0fbe15dc 142ALL_MODULES := $(filter-out $(DISABLEMOD),$(DETECTED_MODS))
b4cd1533 143
b67488e3 144PRE_TE_FILES := $(addprefix $(FLASKDIR)/,security_classes initial_sids access_vectors) $(M4SUPPORT) $(POLDIR)/mls
0fbe15dc
CP
145ALL_INTERFACES := $(ALL_MODULES:.te=.if)
146ALL_TE_FILES := $(ALL_MODULES)
b67488e3 147POST_TE_FILES := $(POLDIR)/users $(POLDIR)/constraints
b4cd1533 148
0fbe15dc 149ALL_FC_FILES := $(ALL_MODULES:.te=.fc)
92e928e1 150HOMEDIR_TEMPLATE = tmp/homedir_template
b4cd1533 151
84eb353c 152POLICY_SECTIONS := tmp/pre_te_files.conf tmp/generated_definitions.conf tmp/all_interfaces.conf tmp/all_attrs_types.conf $(GLOBALTUN) tmp/only_te_rules.conf tmp/all_post.conf
b4cd1533 153
20030ef5 154DOCS = doc
12b559a4 155POLXML = $(DOCS)/policy.xml
20030ef5 156XMLDTD = $(DOCS)/policy.dtd
57869a68 157LAYERXML = metadata.xml
20030ef5
CP
158HTMLDIR = $(DOCS)/html
159DOCTEMPLATE = $(DOCS)/templates
36e54b81 160
b4cd1533
CP
161########################################
162#
163# default action: build policy locally
164#
165default: policy
166
167policy: $(POLVER)
168
44cda51b 169install: $(LOADPATH) $(FCPATH) $(APPFILES) $(USERPATH)/local.users
c9a26b3e
CP
170
171load: tmp/load
b4cd1533
CP
172
173########################################
174#
175# Build a binary policy locally
176#
177$(POLVER): policy.conf
b67488e3 178 @echo "Compiling $(NAME) $(POLVER)"
b4cd1533
CP
179ifneq ($(PV),$(KV))
180 @echo
b67488e3 181 @echo "WARNING: Policy version mismatch! Is your OUTPUT_POLICY set correctly?"
b4cd1533
CP
182 @echo
183endif
134191be 184 $(QUIET) $(CHECKPOLICY) $^ -o $@
b4cd1533
CP
185
186########################################
187#
188# Install a binary policy
189#
190$(LOADPATH): policy.conf
191 @mkdir -p $(POLICYPATH)
b67488e3 192 @echo "Compiling and installing $(NAME) $(LOADPATH)"
b4cd1533
CP
193ifneq ($(PV),$(KV))
194 @echo
b67488e3 195 @echo "WARNING: Policy version mismatch! Is your OUTPUT_POLICY set correctly?"
b4cd1533
CP
196 @echo
197endif
134191be 198 $(QUIET) $(CHECKPOLICY) $^ -o $@
b4cd1533 199
88d14a22
CP
200########################################
201#
202# Load the binary policy
203#
204reload tmp/load: $(LOADPATH) $(FCPATH)
b67488e3 205 @echo "Loading $(NAME) $(LOADPATH)"
88d14a22
CP
206 $(QUIET) $(LOADPOLICY) -q $(LOADPATH)
207 @touch tmp/load
208
b4cd1533
CP
209########################################
210#
211# Construct a monolithic policy.conf
212#
213policy.conf: $(POLICY_SECTIONS)
b67488e3 214 @echo "Creating $(NAME) policy.conf"
d2d6c8ce 215# checkpolicy can use the #line directives provided by -s for error reporting:
b67488e3 216 $(QUIET) m4 $(M4PARAM) -s $^ > tmp/$@.tmp
b4cd1533 217 $(QUIET) sed -e /^portcon/d -e /^nodecon/d -e /^netifcon/d < tmp/$@.tmp > $@
d2d6c8ce 218# the ordering of these ocontexts matters:
b4cd1533
CP
219 $(QUIET) grep ^portcon tmp/$@.tmp >> $@ || true
220 $(QUIET) grep ^netifcon tmp/$@.tmp >> $@ || true
221 $(QUIET) grep ^nodecon tmp/$@.tmp >> $@ || true
222
223tmp/pre_te_files.conf: $(PRE_TE_FILES)
224 @test -d tmp || mkdir -p tmp
225 $(QUIET) cat $^ > $@
226
d2d6c8ce
CP
227tmp/generated_definitions.conf: $(ALL_LAYERS) $(ALL_TE_FILES)
228# per-userdomain templates:
b4cd1533
CP
229 @test -d tmp || mkdir -p tmp
230 $(QUIET) echo "define(\`per_userdomain_templates',\`" > $@
0fbe15dc 231 $(QUIET) for i in $(patsubst %.te,%,$(notdir $(ALL_MODULES))); do \
b4cd1533
CP
232 echo "ifdef(\`""$$i""_per_userdomain_template',\`""$$i""_per_userdomain_template("'$$1'")')" \
233 >> $@ ;\
234 done
235 $(QUIET) echo "')" >> $@
d2d6c8ce 236# define foo.te
0fbe15dc 237 $(QUIET) for i in $(notdir $(ALL_MODULES)); do \
b4cd1533
CP
238 echo "define(\`$$i')" >> $@ ;\
239 done
84eb353c 240 $(QUIET) $(SETTUN) $(TUNABLES) >> $@
b4cd1533 241
199895e2 242tmp/all_interfaces.conf: $(M4SUPPORT) $(ALL_INTERFACES)
b4cd1533 243 @test -d tmp || mkdir -p tmp
199895e2 244 $(QUIET) m4 $^ | sed -e s/dollarsstar/\$$\*/g > $@
b4cd1533 245
3a80ec29 246tmp/all_te_files.conf: $(ALL_TE_FILES)
b4cd1533 247 @test -d tmp || mkdir -p tmp
3a80ec29 248 $(QUIET) cat $^ > $@
b4cd1533
CP
249
250tmp/post_te_files.conf: $(POST_TE_FILES)
251 @test -d tmp || mkdir -p tmp
252 $(QUIET) cat $^ > $@
253
254# extract attributes and put them first. extract post te stuff
255# like genfscon and put last. portcon, nodecon, and netifcon
256# is delayed since they are generated by m4
f66a1af9
CP
257tmp/all_attrs_types.conf tmp/only_te_rules.conf tmp/all_post.conf: tmp/all_te_files.conf tmp/post_te_files.conf
258 $(QUIET) grep ^attribute tmp/all_te_files.conf > tmp/all_attrs_types.conf || true
259 $(QUIET) grep '^type ' tmp/all_te_files.conf >> tmp/all_attrs_types.conf
b4cd1533 260 $(QUIET) cat tmp/post_te_files.conf > tmp/all_post.conf
cabfa520
CP
261 $(QUIET) grep '^sid ' tmp/all_te_files.conf >> tmp/all_post.conf || true
262 $(QUIET) egrep '^fs_use_(xattr|task|trans)' tmp/all_te_files.conf >> tmp/all_post.conf || true
b4cd1533 263 $(QUIET) grep ^genfscon tmp/all_te_files.conf >> tmp/all_post.conf || true
cabfa520
CP
264 $(QUIET) sed -r -e /^attribute/d -e '/^type /d' -e /^genfscon/d \
265 -e '/^sid /d' -e '/^fs_use_(xattr|task|trans)/d' \
266 < tmp/all_te_files.conf > tmp/only_te_rules.conf
b4cd1533 267
f2e4ab3a 268$(MODDIR)/kernel/corenetwork.if: $(MODDIR)/kernel/corenetwork.if.m4 $(MODDIR)/kernel/corenetwork.if.in
61bbe531
CP
269 @echo "#" > $@
270 @echo "# This is a generated file! Instead of modifying this file, the" >> $@
271 @echo "# $(notdir $@).in or $(notdir $@).m4 file should be modified." >> $@
272 @echo "#" >> $@
273 $(QUIET) cat $(MODDIR)/kernel/corenetwork.if.in >> $@
f2e4ab3a 274 $(QUIET) egrep "^[[:blank:]]*network_(interface|node|port)\(.*\)" $(@:.if=.te).in \
d2d6c8ce 275 | m4 $(M4PARAM) $(M4SUPPORT) $(MODDIR)/kernel/corenetwork.if.m4 - \
f2e4ab3a 276 | sed -e 's/dollarsone/\$$1/g' -e 's/dollarszero/\$$0/g' >> $@
f2e4ab3a
CP
277
278$(MODDIR)/kernel/corenetwork.te: $(MODDIR)/kernel/corenetwork.te.m4 $(MODDIR)/kernel/corenetwork.te.in
61bbe531
CP
279 @echo "#" > $@
280 @echo "# This is a generated file! Instead of modifying this file, the" >> $@
281 @echo "# $(notdir $@).in or $(notdir $@).m4 file should be modified." >> $@
282 @echo "#" >> $@
d2d6c8ce 283 $(QUIET) m4 $(M4PARAM) $(M4SUPPORT) $^ \
61bbe531 284 | sed -e 's/dollarsone/\$$1/g' -e 's/dollarszero/\$$0/g' >> $@
f2e4ab3a 285
88d14a22
CP
286########################################
287#
288# Remove the dontaudit rules from the policy.conf
289#
290enableaudit: policy.conf
291 @test -d tmp || mkdir -p tmp
292 @echo "Removing dontaudit rules from policy.conf"
293 $(QUIET) grep -v dontaudit policy.conf > tmp/policy.audit
294 $(QUIET) mv tmp/policy.audit policy.conf
295
6d314fd3
CP
296########################################
297#
298# Construct file_contexts
299#
92e928e1 300$(FC): $(M4SUPPORT) tmp/generated_definitions.conf $(ALL_FC_FILES) $(FCSORT)
6d314fd3 301 @test -d tmp || mkdir -p tmp
92e928e1
CP
302 $(QUIET) m4 $(M4PARAM) $(M4SUPPORT) tmp/generated_definitions.conf $(ALL_FC_FILES) > tmp/$@.tmp
303 $(QUIET) grep -e HOME -e ROLE tmp/$@.tmp > $(HOMEDIR_TEMPLATE)
304 $(QUIET) sed -i -e /HOME/d -e /ROLE/d tmp/$@.tmp
305 $(QUIET) $(FCSORT) tmp/$@.tmp $@
6d314fd3 306
547283e2
CP
307########################################
308#
309# Install file_contexts
310#
3a80ec29 311$(FCPATH): $(FC) $(USERPATH)/system.users
547283e2
CP
312 @mkdir -p $(CONTEXTPATH)/files
313 $(QUIET) install -m 644 $(FC) $(FCPATH)
92e928e1
CP
314 $(QUIET) install -m 644 $(HOMEDIR_TEMPLATE) $(HOMEDIRPATH)
315 $(QUIET) $(GENHOMEDIRCON) -d $(TOPDIR) -t $(NAME) $(USEPWD)
547283e2 316
b4cd1533
CP
317########################################
318#
319# Filesystem labeling
320#
88d14a22 321FILESYSTEMS := `mount | grep -v "context=" | egrep -v '\((|.*,)bind(,.*|)\)' | awk '/(ext[23]| xfs| jfs).*rw/{print $$3}';`
b4cd1533 322
88d14a22
CP
323checklabels: $(FC) $(SETFILES)
324 @if test -z "$(FILESYSTEMS)"; then \
325 echo "No filesystems with extended attributes found!" ;\
326 false ;\
327 fi
b4cd1533
CP
328 $(QUIET) $(SETFILES) -v -n $(FC) $(FILESYSTEMS)
329
88d14a22
CP
330restorelabels: $(FC) $(SETFILES)
331 @if test -z "$(FILESYSTEMS)"; then \
332 echo "No filesystems with extended attributes found!" ;\
333 false ;\
334 fi
b4cd1533
CP
335 $(QUIET) $(SETFILES) -v $(FC) $(FILESYSTEMS)
336
337relabel: $(FC) $(SETFILES)
88d14a22
CP
338 @if test -z "$(FILESYSTEMS)"; then \
339 echo "No filesystems with extended attributes found!" ;\
340 false ;\
341 fi
b4cd1533
CP
342 $(QUIET) $(SETFILES) $(FC) $(FILESYSTEMS)
343
84eb353c
CP
344########################################
345#
346# Create config files
347#
d2d6c8ce
CP
348conf: $(MOD_DISABLE) $(TUNABLES) $(GENERATED_TE) $(GENERATED_IF) $(GENERATED_FC)
349
350$(MOD_DISABLE) $(TUNABLES): $(POLXML)
84eb353c 351 @echo "Creating $(MOD_DISABLE) and $(TUNABLES)"
12b559a4 352 $(QUIET) cd $(DOCS) && ../$(GENDOC) -t ../$(TUNABLES) -m ../$(MOD_DISABLE) -x ../$(POLXML)
84eb353c 353
6d314fd3
CP
354########################################
355#
356# Documentation generation
357#
358
d2d6c8ce 359# minimal dependencies here, because we don't want to rebuild
84eb353c
CP
360# this and its dependents every time the dependencies
361# change
d2d6c8ce 362$(POLXML): $(ALL_INTERFACES)
88c72f44 363 @echo "Creating $@"
84eb353c 364 @mkdir -p tmp
004db90d 365 $(QUIET) echo '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>' > $@
95db4228
CP
366 $(QUIET) echo '<!DOCTYPE policy SYSTEM "$(notdir $(XMLDTD))">' >> $@
367 $(QUIET) $(GENXML) -w -m $(LAYERXML) -t $(GLOBALTUN) $(ALL_LAYERS) >> $@
0447352a
CP
368 $(QUIET) if test -x $(XMLLINT) && test -f $(XMLDTD); then \
369 $(XMLLINT) --noout --dtdvalid $(XMLDTD) $@ ;\
004db90d 370 fi
6d314fd3 371
12b559a4 372html: $(POLXML)
20030ef5 373 @mkdir -p $(HTMLDIR)
12b559a4 374 $(QUIET) cd $(DOCS) && ../$(GENDOC) -d ../$(HTMLDIR) -T ../$(DOCTEMPLATE) -x ../$(POLXML)
20030ef5
CP
375 $(QUIET) cp $(DOCTEMPLATE)/*.css $(HTMLDIR)
376
c9a26b3e
CP
377########################################
378#
379# Runtime binary policy patching of users
380#
381$(USERPATH)/system.users: $(USER_FILES) tmp/generated_definitions.conf
382 @mkdir -p $(USERPATH)
383 @echo "Installing system.users"
384 @echo "# " > tmp/system.users
385 @echo "# Do not edit this file. " >> tmp/system.users
386 @echo "# This file is replaced on reinstalls of this policy." >> tmp/system.users
387 @echo "# Please edit local.users to make local changes." >> tmp/system.users
388 @echo "#" >> tmp/system.users
389 $(QUIET) m4 $(M4PARAM) tmp/generated_definitions.conf $(USER_FILES) | \
390 egrep -v "^[[:space:]]*($$|#)" >> tmp/system.users
391 $(QUIET) install -m 644 tmp/system.users $@
392
1beba1c6 393$(USERPATH)/local.users: config/local.users
c9a26b3e
CP
394 @mkdir -p $(USERPATH)
395 @echo "Installing local.users"
c7b41e95 396 $(QUIET) install -b -m 644 $< $@
c9a26b3e
CP
397
398########################################
399#
400# Appconfig files
401#
402install-appconfig: $(APPFILES)
403
1beba1c6
CP
404$(INSTALLDIR)/booleans: $(TUNABLES)
405 @mkdir -p $(INSTALLDIR)
406 $(QUIET) egrep '^[[:blank:]]*[[:alpha:]]' $(TUNABLES) \
407 | sed -e 's/false/0/g' -e 's/true/1/g' > tmp/booleans
408 $(QUIET) install -m 644 tmp/booleans $@
409
2926f9c7 410$(CONTEXTPATH)/files/media: $(APPCONF)/media
1beba1c6
CP
411 @mkdir -p $(CONTEXTPATH)/files/
412 $(QUIET) install -m 644 $< $@
c9a26b3e 413
2926f9c7 414$(APPDIR)/default_contexts: $(APPCONF)/default_contexts
1beba1c6
CP
415 @mkdir -p $(APPDIR)
416 $(QUIET) install -m 644 $< $@
c9a26b3e 417
2926f9c7 418$(APPDIR)/removable_context: $(APPCONF)/removable_context
1beba1c6
CP
419 @mkdir -p $(APPDIR)
420 $(QUIET) install -m 644 $< $@
c9a26b3e
CP
421
422$(APPDIR)/customizable_types: policy.conf
1beba1c6
CP
423 @mkdir -p $(APPDIR)
424 $(QUIET) grep "^type .*customizable" $< | cut -d',' -f1 | cut -d' ' -f2 > tmp/customizable_types
425 $(QUIET) install -m 644 tmp/customizable_types $@
c9a26b3e 426
2926f9c7 427$(APPDIR)/default_type: $(APPCONF)/default_type
1beba1c6
CP
428 @mkdir -p $(APPDIR)
429 $(QUIET) install -m 644 $< $@
c9a26b3e 430
2926f9c7 431$(APPDIR)/userhelper_context: $(APPCONF)/userhelper_context
1beba1c6
CP
432 @mkdir -p $(APPDIR)
433 $(QUIET) install -m 644 $< $@
c9a26b3e 434
2926f9c7 435$(APPDIR)/initrc_context: $(APPCONF)/initrc_context
1beba1c6
CP
436 @mkdir -p $(APPDIR)
437 $(QUIET) install -m 644 $< $@
c9a26b3e 438
2926f9c7 439$(APPDIR)/failsafe_context: $(APPCONF)/failsafe_context
1beba1c6
CP
440 @mkdir -p $(APPDIR)
441 $(QUIET) install -m 644 $< $@
c9a26b3e 442
2926f9c7 443$(APPDIR)/dbus_contexts: $(APPCONF)/dbus_contexts
1beba1c6
CP
444 @mkdir -p $(APPDIR)
445 $(QUIET) install -m 644 $< $@
c9a26b3e 446
2926f9c7 447$(APPDIR)/users/root: $(APPCONF)/root_default_contexts
1beba1c6
CP
448 @mkdir -p $(APPDIR)/users
449 $(QUIET) install -m 644 $< $@
c9a26b3e 450
c592e52e
CP
451########################################
452#
453# Install policy sources
454#
455install-src:
456 rm -rf $(SRCPATH)/policy.old
457 -mv $(SRCPATH)/policy $(SRCPATH)/policy.old
458 mkdir -p $(SRCPATH)/policy
459 cp -R . $(SRCPATH)/policy
460
102a59ba
CP
461########################################
462#
463# Clean the sources
464#
b4cd1533
CP
465clean:
466 rm -fR tmp
467 rm -f policy.conf
468 rm -f policy.$(PV)
469 rm -f $(FC)
470
102a59ba
CP
471########################################
472#
473# Clean everything
474#
0fbe15dc 475bare: clean
12b559a4 476 rm -f $(POLXML)
254bbc7b
CP
477 rm -f $(SUPPORT)/*.pyc
478 rm -f $(FCSORT)
0fbe15dc
CP
479 rm -f $(MOD_DISABLE)
480 rm -f $(TUNABLES)
20030ef5 481 rm -fR $(HTMLDIR)
e12e5738
CP
482ifneq ($(GENERATED_TE),)
483 rm -f $(GENERATED_TE)
484endif
485ifneq ($(GENERATED_IF),)
486 rm -f $(GENERATED_IF)
487endif
488ifneq ($(GENERATED_FC),)
489 rm -f $(GENERATED_FC)
490endif
0fbe15dc 491
102a59ba 492.PHONY: default policy install load reload enableaudit checklabels restorelabels relabel conf clean bare