1noarg: 2 $(MAKE) -C ../ 3 4PROGS := count_instructions l3_bank_test per_event_excludes 5EXTRA_SOURCES := ../harness.c event.c lib.c 6 7SUB_TARGETS = ebb 8 9all: $(PROGS) $(SUB_TARGETS) 10 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 17run_tests: all sub_run_tests 18 @-for PROG in $(PROGS); do \ 19 ./$$PROG; \ 20 done; 21 22clean: sub_clean 23 rm -f $(PROGS) loop.o 24 25$(SUB_TARGETS): 26 $(MAKE) -k -C $@ all 27 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 38.PHONY: all run_tests clean sub_run_tests sub_clean $(SUB_TARGETS) 39