162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only 262306a36Sopenharmony_ciinclude ../../../build/Build.include 362306a36Sopenharmony_ci 462306a36Sopenharmony_ciall: 562306a36Sopenharmony_ci 662306a36Sopenharmony_citop_srcdir = ../../../.. 762306a36Sopenharmony_ciinclude $(top_srcdir)/scripts/subarch.include 862306a36Sopenharmony_ciARCH ?= $(SUBARCH) 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ciifeq ($(ARCH),x86) 1162306a36Sopenharmony_ci ARCH_DIR := x86_64 1262306a36Sopenharmony_cielse ifeq ($(ARCH),arm64) 1362306a36Sopenharmony_ci ARCH_DIR := aarch64 1462306a36Sopenharmony_cielse ifeq ($(ARCH),s390) 1562306a36Sopenharmony_ci ARCH_DIR := s390x 1662306a36Sopenharmony_cielse 1762306a36Sopenharmony_ci ARCH_DIR := $(ARCH) 1862306a36Sopenharmony_ciendif 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ciLIBKVM += lib/assert.c 2162306a36Sopenharmony_ciLIBKVM += lib/elf.c 2262306a36Sopenharmony_ciLIBKVM += lib/guest_modes.c 2362306a36Sopenharmony_ciLIBKVM += lib/io.c 2462306a36Sopenharmony_ciLIBKVM += lib/kvm_util.c 2562306a36Sopenharmony_ciLIBKVM += lib/memstress.c 2662306a36Sopenharmony_ciLIBKVM += lib/guest_sprintf.c 2762306a36Sopenharmony_ciLIBKVM += lib/rbtree.c 2862306a36Sopenharmony_ciLIBKVM += lib/sparsebit.c 2962306a36Sopenharmony_ciLIBKVM += lib/test_util.c 3062306a36Sopenharmony_ciLIBKVM += lib/ucall_common.c 3162306a36Sopenharmony_ciLIBKVM += lib/userfaultfd_util.c 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ciLIBKVM_STRING += lib/string_override.c 3462306a36Sopenharmony_ci 3562306a36Sopenharmony_ciLIBKVM_x86_64 += lib/x86_64/apic.c 3662306a36Sopenharmony_ciLIBKVM_x86_64 += lib/x86_64/handlers.S 3762306a36Sopenharmony_ciLIBKVM_x86_64 += lib/x86_64/hyperv.c 3862306a36Sopenharmony_ciLIBKVM_x86_64 += lib/x86_64/memstress.c 3962306a36Sopenharmony_ciLIBKVM_x86_64 += lib/x86_64/processor.c 4062306a36Sopenharmony_ciLIBKVM_x86_64 += lib/x86_64/svm.c 4162306a36Sopenharmony_ciLIBKVM_x86_64 += lib/x86_64/ucall.c 4262306a36Sopenharmony_ciLIBKVM_x86_64 += lib/x86_64/vmx.c 4362306a36Sopenharmony_ci 4462306a36Sopenharmony_ciLIBKVM_aarch64 += lib/aarch64/gic.c 4562306a36Sopenharmony_ciLIBKVM_aarch64 += lib/aarch64/gic_v3.c 4662306a36Sopenharmony_ciLIBKVM_aarch64 += lib/aarch64/handlers.S 4762306a36Sopenharmony_ciLIBKVM_aarch64 += lib/aarch64/processor.c 4862306a36Sopenharmony_ciLIBKVM_aarch64 += lib/aarch64/spinlock.c 4962306a36Sopenharmony_ciLIBKVM_aarch64 += lib/aarch64/ucall.c 5062306a36Sopenharmony_ciLIBKVM_aarch64 += lib/aarch64/vgic.c 5162306a36Sopenharmony_ci 5262306a36Sopenharmony_ciLIBKVM_s390x += lib/s390x/diag318_test_handler.c 5362306a36Sopenharmony_ciLIBKVM_s390x += lib/s390x/processor.c 5462306a36Sopenharmony_ciLIBKVM_s390x += lib/s390x/ucall.c 5562306a36Sopenharmony_ci 5662306a36Sopenharmony_ciLIBKVM_riscv += lib/riscv/processor.c 5762306a36Sopenharmony_ciLIBKVM_riscv += lib/riscv/ucall.c 5862306a36Sopenharmony_ci 5962306a36Sopenharmony_ci# Non-compiled test targets 6062306a36Sopenharmony_ciTEST_PROGS_x86_64 += x86_64/nx_huge_pages_test.sh 6162306a36Sopenharmony_ci 6262306a36Sopenharmony_ci# Compiled test targets 6362306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 = x86_64/cpuid_test 6462306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/cr4_cpuid_sync_test 6562306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/dirty_log_page_splitting_test 6662306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/get_msr_index_features 6762306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/exit_on_emulation_failure_test 6862306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/fix_hypercall_test 6962306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/hyperv_clock 7062306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/hyperv_cpuid 7162306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/hyperv_evmcs 7262306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/hyperv_extended_hypercalls 7362306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/hyperv_features 7462306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/hyperv_ipi 7562306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/hyperv_svm_test 7662306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/hyperv_tlb_flush 7762306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/kvm_clock_test 7862306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/kvm_pv_test 7962306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/mmio_warning_test 8062306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/monitor_mwait_test 8162306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/nested_exceptions_test 8262306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/platform_info_test 8362306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/pmu_event_filter_test 8462306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/set_boot_cpu_id 8562306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/set_sregs_test 8662306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/smaller_maxphyaddr_emulation_test 8762306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/smm_test 8862306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/state_test 8962306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/vmx_preemption_timer_test 9062306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/svm_vmcall_test 9162306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/svm_int_ctl_test 9262306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/svm_nested_shutdown_test 9362306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/svm_nested_soft_inject_test 9462306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/tsc_scaling_sync 9562306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/sync_regs_test 9662306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/ucna_injection_test 9762306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/userspace_io_test 9862306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/userspace_msr_exit_test 9962306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/vmx_apic_access_test 10062306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/vmx_close_while_nested_test 10162306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/vmx_dirty_log_test 10262306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/vmx_exception_with_invalid_guest_state 10362306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/vmx_msrs_test 10462306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/vmx_invalid_nested_guest_state 10562306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/vmx_set_nested_state_test 10662306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/vmx_tsc_adjust_test 10762306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/vmx_nested_tsc_scaling_test 10862306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/xapic_ipi_test 10962306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/xapic_state_test 11062306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/xcr0_cpuid_test 11162306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/xss_msr_test 11262306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/debug_regs 11362306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/tsc_msrs_test 11462306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/vmx_pmu_caps_test 11562306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/xen_shinfo_test 11662306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/xen_vmcall_test 11762306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/sev_migrate_tests 11862306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/amx_test 11962306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/max_vcpuid_cap_test 12062306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/triple_fault_event_test 12162306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += x86_64/recalc_apic_map_test 12262306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += access_tracking_perf_test 12362306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += demand_paging_test 12462306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += dirty_log_test 12562306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += dirty_log_perf_test 12662306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += guest_print_test 12762306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += hardware_disable_test 12862306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += kvm_create_max_vcpus 12962306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += kvm_page_table_test 13062306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += max_guest_memory_test 13162306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += memslot_modification_stress_test 13262306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += memslot_perf_test 13362306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += rseq_test 13462306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += set_memory_region_test 13562306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += steal_time 13662306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += kvm_binary_stats_test 13762306a36Sopenharmony_ciTEST_GEN_PROGS_x86_64 += system_counter_offset_test 13862306a36Sopenharmony_ci 13962306a36Sopenharmony_ci# Compiled outputs used by test targets 14062306a36Sopenharmony_ciTEST_GEN_PROGS_EXTENDED_x86_64 += x86_64/nx_huge_pages_test 14162306a36Sopenharmony_ci 14262306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += aarch64/aarch32_id_regs 14362306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += aarch64/arch_timer 14462306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += aarch64/debug-exceptions 14562306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += aarch64/hypercalls 14662306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += aarch64/page_fault_test 14762306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += aarch64/psci_test 14862306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += aarch64/smccc_filter 14962306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += aarch64/vcpu_width_config 15062306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += aarch64/vgic_init 15162306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += aarch64/vgic_irq 15262306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += access_tracking_perf_test 15362306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += demand_paging_test 15462306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += dirty_log_test 15562306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += dirty_log_perf_test 15662306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += guest_print_test 15762306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += get-reg-list 15862306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += kvm_create_max_vcpus 15962306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += kvm_page_table_test 16062306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += memslot_modification_stress_test 16162306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += memslot_perf_test 16262306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += rseq_test 16362306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += set_memory_region_test 16462306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += steal_time 16562306a36Sopenharmony_ciTEST_GEN_PROGS_aarch64 += kvm_binary_stats_test 16662306a36Sopenharmony_ci 16762306a36Sopenharmony_ciTEST_GEN_PROGS_s390x = s390x/memop 16862306a36Sopenharmony_ciTEST_GEN_PROGS_s390x += s390x/resets 16962306a36Sopenharmony_ciTEST_GEN_PROGS_s390x += s390x/sync_regs_test 17062306a36Sopenharmony_ciTEST_GEN_PROGS_s390x += s390x/tprot 17162306a36Sopenharmony_ciTEST_GEN_PROGS_s390x += s390x/cmma_test 17262306a36Sopenharmony_ciTEST_GEN_PROGS_s390x += s390x/debug_test 17362306a36Sopenharmony_ciTEST_GEN_PROGS_s390x += demand_paging_test 17462306a36Sopenharmony_ciTEST_GEN_PROGS_s390x += dirty_log_test 17562306a36Sopenharmony_ciTEST_GEN_PROGS_s390x += guest_print_test 17662306a36Sopenharmony_ciTEST_GEN_PROGS_s390x += kvm_create_max_vcpus 17762306a36Sopenharmony_ciTEST_GEN_PROGS_s390x += kvm_page_table_test 17862306a36Sopenharmony_ciTEST_GEN_PROGS_s390x += rseq_test 17962306a36Sopenharmony_ciTEST_GEN_PROGS_s390x += set_memory_region_test 18062306a36Sopenharmony_ciTEST_GEN_PROGS_s390x += kvm_binary_stats_test 18162306a36Sopenharmony_ci 18262306a36Sopenharmony_ciTEST_GEN_PROGS_riscv += demand_paging_test 18362306a36Sopenharmony_ciTEST_GEN_PROGS_riscv += dirty_log_test 18462306a36Sopenharmony_ciTEST_GEN_PROGS_riscv += guest_print_test 18562306a36Sopenharmony_ciTEST_GEN_PROGS_riscv += get-reg-list 18662306a36Sopenharmony_ciTEST_GEN_PROGS_riscv += kvm_create_max_vcpus 18762306a36Sopenharmony_ciTEST_GEN_PROGS_riscv += kvm_page_table_test 18862306a36Sopenharmony_ciTEST_GEN_PROGS_riscv += set_memory_region_test 18962306a36Sopenharmony_ciTEST_GEN_PROGS_riscv += kvm_binary_stats_test 19062306a36Sopenharmony_ci 19162306a36Sopenharmony_ciSPLIT_TESTS += get-reg-list 19262306a36Sopenharmony_ci 19362306a36Sopenharmony_ciTEST_PROGS += $(TEST_PROGS_$(ARCH_DIR)) 19462306a36Sopenharmony_ciTEST_GEN_PROGS += $(TEST_GEN_PROGS_$(ARCH_DIR)) 19562306a36Sopenharmony_ciTEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(ARCH_DIR)) 19662306a36Sopenharmony_ciLIBKVM += $(LIBKVM_$(ARCH_DIR)) 19762306a36Sopenharmony_ci 19862306a36Sopenharmony_ciOVERRIDE_TARGETS = 1 19962306a36Sopenharmony_ci 20062306a36Sopenharmony_ci# lib.mak defines $(OUTPUT), prepends $(OUTPUT)/ to $(TEST_GEN_PROGS), and most 20162306a36Sopenharmony_ci# importantly defines, i.e. overwrites, $(CC) (unless `make -e` or `make CC=`, 20262306a36Sopenharmony_ci# which causes the environment variable to override the makefile). 20362306a36Sopenharmony_ciinclude ../lib.mk 20462306a36Sopenharmony_ci 20562306a36Sopenharmony_ciINSTALL_HDR_PATH = $(top_srcdir)/usr 20662306a36Sopenharmony_ciLINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/ 20762306a36Sopenharmony_ciLINUX_TOOL_INCLUDE = $(top_srcdir)/tools/include 20862306a36Sopenharmony_ciifeq ($(ARCH),x86_64) 20962306a36Sopenharmony_ciLINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/x86/include 21062306a36Sopenharmony_cielse 21162306a36Sopenharmony_ciLINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include 21262306a36Sopenharmony_ciendif 21362306a36Sopenharmony_ciCFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \ 21462306a36Sopenharmony_ci -Wno-gnu-variable-sized-type-not-at-end -MD\ 21562306a36Sopenharmony_ci -fno-builtin-memcmp -fno-builtin-memcpy -fno-builtin-memset \ 21662306a36Sopenharmony_ci -fno-builtin-strnlen \ 21762306a36Sopenharmony_ci -fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \ 21862306a36Sopenharmony_ci -I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \ 21962306a36Sopenharmony_ci -I$(<D) -Iinclude/$(ARCH_DIR) -I ../rseq -I.. $(EXTRA_CFLAGS) \ 22062306a36Sopenharmony_ci $(KHDR_INCLUDES) 22162306a36Sopenharmony_ciifeq ($(ARCH),s390) 22262306a36Sopenharmony_ci CFLAGS += -march=z10 22362306a36Sopenharmony_ciendif 22462306a36Sopenharmony_ci 22562306a36Sopenharmony_cino-pie-option := $(call try-run, echo 'int main(void) { return 0; }' | \ 22662306a36Sopenharmony_ci $(CC) -Werror $(CFLAGS) -no-pie -x c - -o "$$TMP", -no-pie) 22762306a36Sopenharmony_ci 22862306a36Sopenharmony_ci# On s390, build the testcases KVM-enabled 22962306a36Sopenharmony_cipgste-option = $(call try-run, echo 'int main(void) { return 0; }' | \ 23062306a36Sopenharmony_ci $(CC) -Werror -Wl$(comma)--s390-pgste -x c - -o "$$TMP",-Wl$(comma)--s390-pgste) 23162306a36Sopenharmony_ci 23262306a36Sopenharmony_ciLDLIBS += -ldl 23362306a36Sopenharmony_ciLDFLAGS += -pthread $(no-pie-option) $(pgste-option) 23462306a36Sopenharmony_ci 23562306a36Sopenharmony_ciLIBKVM_C := $(filter %.c,$(LIBKVM)) 23662306a36Sopenharmony_ciLIBKVM_S := $(filter %.S,$(LIBKVM)) 23762306a36Sopenharmony_ciLIBKVM_C_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM_C)) 23862306a36Sopenharmony_ciLIBKVM_S_OBJ := $(patsubst %.S, $(OUTPUT)/%.o, $(LIBKVM_S)) 23962306a36Sopenharmony_ciLIBKVM_STRING_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM_STRING)) 24062306a36Sopenharmony_ciLIBKVM_OBJS = $(LIBKVM_C_OBJ) $(LIBKVM_S_OBJ) $(LIBKVM_STRING_OBJ) 24162306a36Sopenharmony_ciSPLIT_TESTS_TARGETS := $(patsubst %, $(OUTPUT)/%, $(SPLIT_TESTS)) 24262306a36Sopenharmony_ciSPLIT_TESTS_OBJS := $(patsubst %, $(ARCH_DIR)/%.o, $(SPLIT_TESTS)) 24362306a36Sopenharmony_ci 24462306a36Sopenharmony_ciTEST_GEN_OBJ = $(patsubst %, %.o, $(TEST_GEN_PROGS)) 24562306a36Sopenharmony_ciTEST_GEN_OBJ += $(patsubst %, %.o, $(TEST_GEN_PROGS_EXTENDED)) 24662306a36Sopenharmony_ciTEST_DEP_FILES = $(patsubst %.o, %.d, $(TEST_GEN_OBJ)) 24762306a36Sopenharmony_ciTEST_DEP_FILES += $(patsubst %.o, %.d, $(LIBKVM_OBJS)) 24862306a36Sopenharmony_ciTEST_DEP_FILES += $(patsubst %.o, %.d, $(SPLIT_TESTS_OBJS)) 24962306a36Sopenharmony_ci-include $(TEST_DEP_FILES) 25062306a36Sopenharmony_ci 25162306a36Sopenharmony_ci$(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED): %: %.o 25262306a36Sopenharmony_ci $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $< $(LIBKVM_OBJS) $(LDLIBS) -o $@ 25362306a36Sopenharmony_ci$(TEST_GEN_OBJ): $(OUTPUT)/%.o: %.c 25462306a36Sopenharmony_ci $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ 25562306a36Sopenharmony_ci 25662306a36Sopenharmony_ci$(SPLIT_TESTS_TARGETS): %: %.o $(SPLIT_TESTS_OBJS) 25762306a36Sopenharmony_ci $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) -o $@ 25862306a36Sopenharmony_ci 25962306a36Sopenharmony_ciEXTRA_CLEAN += $(LIBKVM_OBJS) $(TEST_DEP_FILES) $(TEST_GEN_OBJ) $(SPLIT_TESTS_OBJS) cscope.* 26062306a36Sopenharmony_ci 26162306a36Sopenharmony_cix := $(shell mkdir -p $(sort $(dir $(LIBKVM_C_OBJ) $(LIBKVM_S_OBJ)))) 26262306a36Sopenharmony_ci$(LIBKVM_C_OBJ): $(OUTPUT)/%.o: %.c 26362306a36Sopenharmony_ci $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ 26462306a36Sopenharmony_ci 26562306a36Sopenharmony_ci$(LIBKVM_S_OBJ): $(OUTPUT)/%.o: %.S 26662306a36Sopenharmony_ci $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ 26762306a36Sopenharmony_ci 26862306a36Sopenharmony_ci# Compile the string overrides as freestanding to prevent the compiler from 26962306a36Sopenharmony_ci# generating self-referential code, e.g. without "freestanding" the compiler may 27062306a36Sopenharmony_ci# "optimize" memcmp() by invoking memcmp(), thus causing infinite recursion. 27162306a36Sopenharmony_ci$(LIBKVM_STRING_OBJ): $(OUTPUT)/%.o: %.c 27262306a36Sopenharmony_ci $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -ffreestanding $< -o $@ 27362306a36Sopenharmony_ci 27462306a36Sopenharmony_cix := $(shell mkdir -p $(sort $(dir $(TEST_GEN_PROGS)))) 27562306a36Sopenharmony_ci$(TEST_GEN_PROGS): $(LIBKVM_OBJS) 27662306a36Sopenharmony_ci$(TEST_GEN_PROGS_EXTENDED): $(LIBKVM_OBJS) 27762306a36Sopenharmony_ci 27862306a36Sopenharmony_cicscope: include_paths = $(LINUX_TOOL_INCLUDE) $(LINUX_HDR_PATH) include lib .. 27962306a36Sopenharmony_cicscope: 28062306a36Sopenharmony_ci $(RM) cscope.* 28162306a36Sopenharmony_ci (find $(include_paths) -name '*.h' \ 28262306a36Sopenharmony_ci -exec realpath --relative-base=$(PWD) {} \;; \ 28362306a36Sopenharmony_ci find . -name '*.c' \ 28462306a36Sopenharmony_ci -exec realpath --relative-base=$(PWD) {} \;) | sort -u > cscope.files 28562306a36Sopenharmony_ci cscope -b 286