1 # SPDX-License-Identifier: GPL-2.0 2 noarg: 3 $(MAKE) -C ../ 4 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 7 8 top_srcdir = ../../../../.. 9 include ../../lib.mk 10 include ../flags.mk 11 12 SUB_DIRS := ebb sampling_tests event_code_tests 13 14 all: $(TEST_GEN_PROGS) $(SUB_DIRS) 15 16 $(TEST_GEN_PROGS): $(EXTRA_SOURCES) 17 18 # loop.S can only be built 64-bit 19 $(OUTPUT)/count_instructions: CFLAGS += -m64 20 $(OUTPUT)/count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES) 21 22 $(OUTPUT)/count_stcx_fail: CFLAGS += -m64 23 $(OUTPUT)/count_stcx_fail: loop.S $(EXTRA_SOURCES) 24 25 26 $(OUTPUT)/per_event_excludes: ../utils.c 27 28 $(SUB_DIRS): 29 BUILD_TARGET=$(OUTPUT)/$@; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $@ all 30 31 DEFAULT_RUN_TESTS := $(RUN_TESTS) 32 override define RUN_TESTS 33 $(DEFAULT_RUN_TESTS) 34 +@for TARGET in $(SUB_DIRS); do \ 35 BUILD_TARGET=$(OUTPUT)/$$TARGET; \ 36 $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests; \ 37 done; 38 endef 39 40 emit_tests: 41 for TEST in $(TEST_GEN_PROGS); do \ 42 BASENAME_TEST=`basename $$TEST`; \ 43 echo "$(COLLECTION):$$BASENAME_TEST"; \ 44 done 45 +@for TARGET in $(SUB_DIRS); do \ 46 BUILD_TARGET=$(OUTPUT)/$$TARGET; \ 47 $(MAKE) OUTPUT=$$BUILD_TARGET COLLECTION=$(COLLECTION)/$$TARGET -s -C $$TARGET emit_tests; \ 48 done; 49 50 DEFAULT_INSTALL_RULE := $(INSTALL_RULE) 51 override define INSTALL_RULE 52 $(DEFAULT_INSTALL_RULE) 53 +@for TARGET in $(SUB_DIRS); do \ 54 BUILD_TARGET=$(OUTPUT)/$$TARGET; \ 55 $(MAKE) OUTPUT=$$BUILD_TARGET INSTALL_PATH=$$INSTALL_PATH/$$TARGET -C $$TARGET install; \ 56 done; 57 endef 58 59 DEFAULT_CLEAN := $(CLEAN) 60 override define CLEAN 61 $(DEFAULT_CLEAN) 62 $(RM) $(TEST_GEN_PROGS) $(OUTPUT)/loop.o 63 +@for TARGET in $(SUB_DIRS); do \ 64 BUILD_TARGET=$(OUTPUT)/$$TARGET; \ 65 $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean; \ 66 done; 67 endef 68 69 70 .PHONY: all run_tests ebb sampling_tests event_code_tests emit_tests
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.