xref: /linux/tools/testing/selftests/powerpc/pmu/Makefile (revision 4ecd0868c5138238dec8a1549bb6ff8e5b48208b)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
2cb96143dSMichael Ellermannoarg:
3cb96143dSMichael Ellerman	$(MAKE) -C ../
4cb96143dSMichael Ellerman
57481cad4SMichael EllermanTEST_GEN_PROGS := count_instructions count_stcx_fail l3_bank_test per_event_excludes
6d1301afdSMichael EllermanEXTRA_SOURCES := ../harness.c event.c lib.c ../utils.c
7cb96143dSMichael Ellerman
87e0cf1c9SMichael Ellermantop_srcdir = ../../../../..
988baa78dSbamvor.zhangjian@huawei.cominclude ../../lib.mk
10cbfd7dabSMichael Ellerman
110a110a4bSAthira Rajeevall: $(TEST_GEN_PROGS) ebb sampling_tests event_code_tests
1288baa78dSbamvor.zhangjian@huawei.com
1388baa78dSbamvor.zhangjian@huawei.com$(TEST_GEN_PROGS): $(EXTRA_SOURCES)
14cb96143dSMichael Ellerman
15cb96143dSMichael Ellerman# loop.S can only be built 64-bit
167481cad4SMichael Ellerman$(OUTPUT)/count_instructions: CFLAGS += -m64
17a8ba798bSbamvor.zhangjian@huawei.com$(OUTPUT)/count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES)
187481cad4SMichael Ellerman
197481cad4SMichael Ellerman$(OUTPUT)/count_stcx_fail: CFLAGS += -m64
207481cad4SMichael Ellerman$(OUTPUT)/count_stcx_fail: loop.S $(EXTRA_SOURCES)
217481cad4SMichael Ellerman
22cb96143dSMichael Ellerman
23a8ba798bSbamvor.zhangjian@huawei.com$(OUTPUT)/per_event_excludes: ../utils.c
24fcb45ec0SMichael Ellerman
256faeeea4SMichael EllermanDEFAULT_RUN_TESTS := $(RUN_TESTS)
266faeeea4SMichael Ellermanoverride define RUN_TESTS
276faeeea4SMichael Ellerman	$(DEFAULT_RUN_TESTS)
28*4ecd0868SBenjamin Gray	+TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests
29*4ecd0868SBenjamin Gray	+TARGET=sampling_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests
30*4ecd0868SBenjamin Gray	+TARGET=event_code_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests
316faeeea4SMichael Ellermanendef
32cb96143dSMichael Ellerman
336faeeea4SMichael EllermanDEFAULT_EMIT_TESTS := $(EMIT_TESTS)
346faeeea4SMichael Ellermanoverride define EMIT_TESTS
356faeeea4SMichael Ellerman	$(DEFAULT_EMIT_TESTS)
36*4ecd0868SBenjamin Gray	+TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -s -C $$TARGET emit_tests
37*4ecd0868SBenjamin Gray	+TARGET=sampling_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -s -C $$TARGET emit_tests
38*4ecd0868SBenjamin Gray	+TARGET=event_code_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -s -C $$TARGET emit_tests
396faeeea4SMichael Ellermanendef
406faeeea4SMichael Ellerman
412fa30fe9SMichael EllermanDEFAULT_INSTALL_RULE := $(INSTALL_RULE)
426faeeea4SMichael Ellermanoverride define INSTALL_RULE
436faeeea4SMichael Ellerman	$(DEFAULT_INSTALL_RULE)
44*4ecd0868SBenjamin Gray	+TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install
45*4ecd0868SBenjamin Gray	+TARGET=sampling_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install
46*4ecd0868SBenjamin Gray	+TARGET=event_code_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install
476faeeea4SMichael Ellermanendef
486faeeea4SMichael Ellerman
4969608683SBenjamin GrayDEFAULT_CLEAN := $(CLEAN)
5069608683SBenjamin Grayoverride define CLEAN
5169608683SBenjamin Gray	$(DEFAULT_CLEAN)
52a8ba798bSbamvor.zhangjian@huawei.com	$(RM) $(TEST_GEN_PROGS) $(OUTPUT)/loop.o
53*4ecd0868SBenjamin Gray	+TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean
54*4ecd0868SBenjamin Gray	+TARGET=sampling_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean
55*4ecd0868SBenjamin Gray	+TARGET=event_code_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean
5669608683SBenjamin Grayendef
576faeeea4SMichael Ellerman
586faeeea4SMichael Ellermanebb:
59a8ba798bSbamvor.zhangjian@huawei.com	TARGET=$@; BUILD_TARGET=$$OUTPUT/$$TARGET; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $$TARGET all
603752e453SMichael Ellerman
61c315669eSAthira Rajeevsampling_tests:
62c315669eSAthira Rajeev	TARGET=$@; BUILD_TARGET=$$OUTPUT/$$TARGET; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $$TARGET all
63c315669eSAthira Rajeev
640a110a4bSAthira Rajeevevent_code_tests:
650a110a4bSAthira Rajeev	TARGET=$@; BUILD_TARGET=$$OUTPUT/$$TARGET; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $$TARGET all
660a110a4bSAthira Rajeev
6769608683SBenjamin Gray.PHONY: all run_tests ebb sampling_tests event_code_tests
68