162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ciinclude ../../../../../build/Build.include
362306a36Sopenharmony_ci
462306a36Sopenharmony_cinoarg:
562306a36Sopenharmony_ci	$(MAKE) -C ../../
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci# The EBB handler is 64-bit code and everything links against it
862306a36Sopenharmony_ciCFLAGS += -m64
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ciTMPOUT = $(OUTPUT)/TMPDIR/
1162306a36Sopenharmony_ci# Toolchains may build PIE by default which breaks the assembly
1262306a36Sopenharmony_cino-pie-option := $(call try-run, echo 'int main() { return 0; }' | \
1362306a36Sopenharmony_ci        $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -no-pie -x c - -o "$$TMP", -no-pie)
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ciLDFLAGS += $(no-pie-option)
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ciTEST_GEN_PROGS := reg_access_test event_attributes_test cycles_test	\
1862306a36Sopenharmony_ci	 cycles_with_freeze_test pmc56_overflow_test		\
1962306a36Sopenharmony_ci	 ebb_vs_cpu_event_test cpu_event_vs_ebb_test		\
2062306a36Sopenharmony_ci	 cpu_event_pinned_vs_ebb_test task_event_vs_ebb_test	\
2162306a36Sopenharmony_ci	 task_event_pinned_vs_ebb_test multi_ebb_procs_test	\
2262306a36Sopenharmony_ci	 multi_counter_test pmae_handling_test			\
2362306a36Sopenharmony_ci	 close_clears_pmcc_test instruction_count_test		\
2462306a36Sopenharmony_ci	 fork_cleanup_test ebb_on_child_test			\
2562306a36Sopenharmony_ci	 ebb_on_willing_child_test back_to_back_ebbs_test	\
2662306a36Sopenharmony_ci	 lost_exception_test no_handler_test			\
2762306a36Sopenharmony_ci	 cycles_with_mmcr2_test regs_access_pmccext_test
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_citop_srcdir = ../../../../../..
3062306a36Sopenharmony_ciinclude ../../../lib.mk
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci$(TEST_GEN_PROGS): ../../harness.c ../../utils.c ../event.c ../lib.c \
3362306a36Sopenharmony_ci	       ebb.c ebb_handler.S trace.c busy_loop.S
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ci$(OUTPUT)/instruction_count_test: ../loop.S
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci$(OUTPUT)/lost_exception_test: ../lib.c
38