WIP FPC-III support
[linux/fpc-iii.git] / tools / testing / selftests / powerpc / pmu / Makefile
blob904672fb78dd54828a90cf0c757314ad2e742cf5
1 # SPDX-License-Identifier: GPL-2.0
2 noarg:
3 $(MAKE) -C ../
5 TEST_GEN_PROGS := count_instructions count_stcx_fail l3_bank_test per_event_excludes
6 EXTRA_SOURCES := ../harness.c event.c lib.c ../utils.c
8 top_srcdir = ../../../../..
9 include ../../lib.mk
11 all: $(TEST_GEN_PROGS) ebb
13 $(TEST_GEN_PROGS): $(EXTRA_SOURCES)
15 # loop.S can only be built 64-bit
16 $(OUTPUT)/count_instructions: CFLAGS += -m64
17 $(OUTPUT)/count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES)
19 $(OUTPUT)/count_stcx_fail: CFLAGS += -m64
20 $(OUTPUT)/count_stcx_fail: loop.S $(EXTRA_SOURCES)
23 $(OUTPUT)/per_event_excludes: ../utils.c
25 DEFAULT_RUN_TESTS := $(RUN_TESTS)
26 override define RUN_TESTS
27 $(DEFAULT_RUN_TESTS)
28 TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests
29 endef
31 DEFAULT_EMIT_TESTS := $(EMIT_TESTS)
32 override define EMIT_TESTS
33 $(DEFAULT_EMIT_TESTS)
34 TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -s -C $$TARGET emit_tests
35 endef
37 DEFAULT_INSTALL_RULE := $(INSTALL_RULE)
38 override define INSTALL_RULE
39 $(DEFAULT_INSTALL_RULE)
40 TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install
41 endef
43 clean:
44 $(RM) $(TEST_GEN_PROGS) $(OUTPUT)/loop.o
45 TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean
47 ebb:
48 TARGET=$@; BUILD_TARGET=$$OUTPUT/$$TARGET; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $$TARGET all
50 .PHONY: all run_tests clean ebb