File: Makefile

package info (click to toggle)
apparmor 2.7.103-4
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 11,920 kB
  • sloc: ansic: 12,022; perl: 10,644; sh: 8,119; cpp: 2,505; yacc: 1,592; python: 1,489; makefile: 1,138; lex: 1,003; pascal: 399; ruby: 374; exp: 250; java: 212; xml: 159
file content (51 lines) | stat: -rw-r--r-- 1,606 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#
PROVE=/usr/bin/prove
TESTS=simple.pl
PARSER_DIR=..
PARSER_BIN=apparmor_parser
PARSER=$(PARSER_DIR)/$(PARSER_BIN)
PROVE_ARG=-f

ifeq ($(VERBOSE),1)
  PROVE_ARG+=-v
endif

all: tests

.PHONY: tests error_output gen_xtrans parser_sanity caching minimize
tests: error_output gen_xtrans parser_sanity caching minimize

GEN_TRANS_DIRS=simple_tests/generated_x/ simple_tests/generated_perms_leading/ simple_tests/generated_perms_safe/

gen_xtrans: $(GEN_TRANS_DIRS)
	./gen-xtrans.pl

$(GEN_TRANS_DIRS):
	mkdir $@

error_output: $(PARSER)
	$(PARSER) -S -I errors >/dev/null errors/okay.sd
	LANG=C $(PARSER) -S -I errors 2>&1 >/dev/null errors/single.sd | \
		grep -q "AppArmor parser error for errors/single.sd in errors/single.sd at line 3: Could not open 'failure'"
	LANG=C $(PARSER) -S -I errors 2>&1 >/dev/null errors/double.sd | \
		grep -q "AppArmor parser error for errors/double.sd in errors/includes/busted at line 66: Could not open 'does-not-exist'"
	LANG=C $(PARSER) -S -I errors 2>&1 >/dev/null errors/modefail.sd | \
		grep -q "AppArmor parser error for errors/modefail.sd in errors/modefail.sd at line 6: syntax error"
	LANG=C $(PARSER) -S -I errors 2>&1 >/dev/null errors/multi_include.sd | \
		grep -q "AppArmor parser error for errors/multi_include.sd in errors/multi_include.sd at line 12: Could not open 'failure'"
	@echo "Error Output: PASS"

parser_sanity: $(PARSER)
	$(Q)${PROVE} ${PROVE_ARG} ${TESTS}

caching: $(PARSER)
	LANG=C ./caching.sh

minimize: $(PARSER)
	LANG=C ./minimize.sh

$(PARSER):
	make -C $(PARSER_DIR) $(PARSER_BIN)

clean:
	find $(GEN_TRANS_DIRS) -type f | xargs rm -f