blob: b9ff0db42c79a1e35ce9116bb73103b154419411 [file] [log] [blame]
Michael Ellermancb961432013-08-06 17:42:37 +10001noarg:
2 $(MAKE) -C ../
3
4PROGS := count_instructions
5EXTRA_SOURCES := ../harness.c event.c
6
Michael Ellerman3752e452014-06-10 22:23:10 +10007all: $(PROGS) sub_all
Michael Ellermancb961432013-08-06 17:42:37 +10008
9$(PROGS): $(EXTRA_SOURCES)
10
11# loop.S can only be built 64-bit
12count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES)
13 $(CC) $(CFLAGS) -m64 -o $@ $^
14
Michael Ellerman3752e452014-06-10 22:23:10 +100015run_tests: all sub_run_tests
Michael Ellermancb961432013-08-06 17:42:37 +100016 @-for PROG in $(PROGS); do \
17 ./$$PROG; \
18 done;
19
Michael Ellerman3752e452014-06-10 22:23:10 +100020clean: sub_clean
Michael Ellermancb961432013-08-06 17:42:37 +100021 rm -f $(PROGS) loop.o
22
Michael Ellerman3752e452014-06-10 22:23:10 +100023
24SUB_TARGETS = ebb
25
26sub_all:
27 @for TARGET in $(SUB_TARGETS); do \
28 $(MAKE) -C $$TARGET all; \
29 done;
30
31sub_run_tests: all
32 @for TARGET in $(SUB_TARGETS); do \
33 $(MAKE) -C $$TARGET run_tests; \
34 done;
35
36sub_clean:
37 @for TARGET in $(SUB_TARGETS); do \
38 $(MAKE) -C $$TARGET clean; \
39 done;
40
41.PHONY: all run_tests clean sub_all sub_run_tests sub_clean