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 11*0a110a4bSAthira 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) 28a8ba798bSbamvor.zhangjian@huawei.com TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests 29c315669eSAthira Rajeev TARGET=sampling_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests 30*0a110a4bSAthira Rajeev 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) 36a8ba798bSbamvor.zhangjian@huawei.com TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -s -C $$TARGET emit_tests 37c315669eSAthira Rajeev TARGET=sampling_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -s -C $$TARGET emit_tests 38*0a110a4bSAthira Rajeev 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) 4468bd42d9SMichael Ellerman TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install 45c315669eSAthira Rajeev TARGET=sampling_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install 46*0a110a4bSAthira Rajeev TARGET=event_code_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install 476faeeea4SMichael Ellermanendef 486faeeea4SMichael Ellerman 496faeeea4SMichael Ellermanclean: 50a8ba798bSbamvor.zhangjian@huawei.com $(RM) $(TEST_GEN_PROGS) $(OUTPUT)/loop.o 5168bd42d9SMichael Ellerman TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean 52c315669eSAthira Rajeev TARGET=sampling_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean 53*0a110a4bSAthira Rajeev TARGET=event_code_tests; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean 546faeeea4SMichael Ellerman 556faeeea4SMichael Ellermanebb: 56a8ba798bSbamvor.zhangjian@huawei.com TARGET=$@; BUILD_TARGET=$$OUTPUT/$$TARGET; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $$TARGET all 573752e453SMichael Ellerman 58c315669eSAthira Rajeevsampling_tests: 59c315669eSAthira Rajeev TARGET=$@; BUILD_TARGET=$$OUTPUT/$$TARGET; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $$TARGET all 60c315669eSAthira Rajeev 61*0a110a4bSAthira Rajeevevent_code_tests: 62*0a110a4bSAthira Rajeev TARGET=$@; BUILD_TARGET=$$OUTPUT/$$TARGET; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $$TARGET all 63*0a110a4bSAthira Rajeev 64*0a110a4bSAthira Rajeev.PHONY: all run_tests clean ebb sampling_tests event_code_tests 65