• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1noarg:
2	$(MAKE) -C ../
3
4TEST_GEN_PROGS := count_instructions l3_bank_test per_event_excludes
5EXTRA_SOURCES := ../harness.c event.c lib.c ../utils.c
6
7include ../../lib.mk
8
9all: $(TEST_GEN_PROGS) ebb
10
11$(TEST_GEN_PROGS): $(EXTRA_SOURCES)
12
13# loop.S can only be built 64-bit
14$(OUTPUT)/count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES)
15	$(CC) $(CFLAGS) -m64 -o $@ $^
16
17$(OUTPUT)/per_event_excludes: ../utils.c
18
19DEFAULT_RUN_TESTS := $(RUN_TESTS)
20override define RUN_TESTS
21	$(DEFAULT_RUN_TESTS)
22	TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests
23endef
24
25DEFAULT_EMIT_TESTS := $(EMIT_TESTS)
26override define EMIT_TESTS
27	$(DEFAULT_EMIT_TESTS)
28	TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -s -C $$TARGET emit_tests
29endef
30
31DEFAULT_INSTALL_RULE := $(INSTALL_RULE)
32override define INSTALL_RULE
33	$(DEFAULT_INSTALL_RULE)
34	TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install
35endef
36
37clean:
38	$(RM) $(TEST_GEN_PROGS) $(OUTPUT)/loop.o
39	TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean
40
41ebb:
42	TARGET=$@; BUILD_TARGET=$$OUTPUT/$$TARGET; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $$TARGET all
43
44.PHONY: all run_tests clean ebb
45