Makefile 713 字节
Newer Older
1 2 3 4 5 6
noarg:
	$(MAKE) -C ../

PROGS := count_instructions
EXTRA_SOURCES := ../harness.c event.c

7 8 9
SUB_TARGETS = ebb

all: $(PROGS) $(SUB_TARGETS)
10 11 12 13 14 15 16

$(PROGS): $(EXTRA_SOURCES)

# loop.S can only be built 64-bit
count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES)
	$(CC) $(CFLAGS) -m64 -o $@ $^

17
run_tests: all sub_run_tests
18 19 20 21
	@-for PROG in $(PROGS); do \
		./$$PROG; \
	done;

22
clean: sub_clean
23 24
	rm -f $(PROGS) loop.o

25 26
$(SUB_TARGETS):
	$(MAKE) -k -C $@ all
27 28 29 30 31 32 33 34 35 36 37

sub_run_tests: all
	@for TARGET in $(SUB_TARGETS); do \
		$(MAKE) -C $$TARGET run_tests; \
	done;

sub_clean:
	@for TARGET in $(SUB_TARGETS); do \
		$(MAKE) -C $$TARGET clean; \
	done;

38
.PHONY: all run_tests clean sub_run_tests sub_clean $(SUB_TARGETS)