File: Makefile

package info (click to toggle)
iproute 20080725-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 2,480 kB
  • ctags: 4,934
  • sloc: ansic: 33,697; sh: 2,128; makefile: 367; cpp: 352; yacc: 339; lex: 145; perl: 101
file content (45 lines) | stat: -rw-r--r-- 1,125 bytes parent folder | download | duplicates (6)
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
## -- Config --
DEV := lo
PREFIX := sudo
## -- End Config --

TESTS := $(patsubst tests/%,%,$(wildcard tests/*.t))
IPVERS := $(filter-out iproute2/Makefile,$(wildcard iproute2/*))
KENV := $(shell cat /proc/config.gz | gunzip | grep ^CONFIG)

.PHONY: compile listtests alltests configure $(TESTS)

configure:
	echo "Entering iproute2" && cd iproute2 && $(MAKE) configure && cd ..;

compile: configure
	echo "Entering iproute2" && cd iproute2 && $(MAKE) && cd ..;

listtests:
	@for t in $(TESTS); do \
		echo "$$t"; \
	done

alltests: $(TESTS)

clean:
	@rm -rf results/*

distclean: clean
	echo "Entering iproute2" && cd iproute2 && $(MAKE) distclean && cd ..;

$(TESTS):
	@for i in $(IPVERS); do \
		o=`echo $$i | sed -e 's/iproute2\///'`; \
		echo -n "Running $@ [$$o/`uname -r`]: "; \
		TC="$$i/tc/tc" IP="$$i/ip/ip" DEV="$(DEV)" IPVER="$@" SNAME="$$i" \
		ERRF="results/$@.$$o.err" $(KENV) $(PREFIX) tests/$@ > results/$@.$$o.out; \
		if [ "$$?" = "127" ]; then \
			echo "SKIPPED"; \
		elif [ -e "results/$@.$$o.err" ]; then \
			echo "FAILED"; \
		else \
			echo "PASS"; \
		fi; \
		dmesg > results/$@.$$o.dmesg; \
	done