blob: cd256277c24e4e5450165602d5b6951fc5baa9ab [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 Ellermancbfd7da2014-07-23 17:31:31 +10007SUB_TARGETS = ebb
8
9all: $(PROGS) $(SUB_TARGETS)
Michael Ellermancb961432013-08-06 17:42:37 +100010
11$(PROGS): $(EXTRA_SOURCES)
12
13# loop.S can only be built 64-bit
14count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES)
15 $(CC) $(CFLAGS) -m64 -o $@ $^
16
Michael Ellerman3752e452014-06-10 22:23:10 +100017run_tests: all sub_run_tests
Michael Ellermancb961432013-08-06 17:42:37 +100018 @-for PROG in $(PROGS); do \
19 ./$$PROG; \
20 done;
21
Michael Ellerman3752e452014-06-10 22:23:10 +100022clean: sub_clean
Michael Ellermancb961432013-08-06 17:42:37 +100023 rm -f $(PROGS) loop.o
24
Michael Ellermancbfd7da2014-07-23 17:31:31 +100025$(SUB_TARGETS):
26 $(MAKE) -k -C $@ all
Michael Ellerman3752e452014-06-10 22:23:10 +100027
28sub_run_tests: all
29 @for TARGET in $(SUB_TARGETS); do \
30 $(MAKE) -C $$TARGET run_tests; \
31 done;
32
33sub_clean:
34 @for TARGET in $(SUB_TARGETS); do \
35 $(MAKE) -C $$TARGET clean; \
36 done;
37
Michael Ellermancbfd7da2014-07-23 17:31:31 +100038.PHONY: all run_tests clean sub_run_tests sub_clean $(SUB_TARGETS)