Michael Ellerman | cb96143 | 2013-08-06 17:42:37 +1000 | [diff] [blame] | 1 | noarg: |
| 2 | $(MAKE) -C ../ |
| 3 | |
| 4 | PROGS := count_instructions |
| 5 | EXTRA_SOURCES := ../harness.c event.c |
| 6 | |
Michael Ellerman | 3752e45 | 2014-06-10 22:23:10 +1000 | [diff] [blame^] | 7 | all: $(PROGS) sub_all |
Michael Ellerman | cb96143 | 2013-08-06 17:42:37 +1000 | [diff] [blame] | 8 | |
| 9 | $(PROGS): $(EXTRA_SOURCES) |
| 10 | |
| 11 | # loop.S can only be built 64-bit |
| 12 | count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES) |
| 13 | $(CC) $(CFLAGS) -m64 -o $@ $^ |
| 14 | |
Michael Ellerman | 3752e45 | 2014-06-10 22:23:10 +1000 | [diff] [blame^] | 15 | run_tests: all sub_run_tests |
Michael Ellerman | cb96143 | 2013-08-06 17:42:37 +1000 | [diff] [blame] | 16 | @-for PROG in $(PROGS); do \ |
| 17 | ./$$PROG; \ |
| 18 | done; |
| 19 | |
Michael Ellerman | 3752e45 | 2014-06-10 22:23:10 +1000 | [diff] [blame^] | 20 | clean: sub_clean |
Michael Ellerman | cb96143 | 2013-08-06 17:42:37 +1000 | [diff] [blame] | 21 | rm -f $(PROGS) loop.o |
| 22 | |
Michael Ellerman | 3752e45 | 2014-06-10 22:23:10 +1000 | [diff] [blame^] | 23 | |
| 24 | SUB_TARGETS = ebb |
| 25 | |
| 26 | sub_all: |
| 27 | @for TARGET in $(SUB_TARGETS); do \ |
| 28 | $(MAKE) -C $$TARGET all; \ |
| 29 | done; |
| 30 | |
| 31 | sub_run_tests: all |
| 32 | @for TARGET in $(SUB_TARGETS); do \ |
| 33 | $(MAKE) -C $$TARGET run_tests; \ |
| 34 | done; |
| 35 | |
| 36 | sub_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 |