test: rename kvm/user/test to kvm/user
[qemu-kvm/amd-iommu.git] / kvm / user / config-x86-common.mak
blob9084e2df749999f73f0de24663b11aa237efe5d7
1 #This is a make file with common rules for both x86 & x86-64
3 CFLAGS += -I../include/x86
5 all: test_cases
7 cflatobjs += \
8 lib/x86/io.o \
9 lib/x86/smp.o
11 cflatobjs += lib/x86/fwcfg.o
12 cflatobjs += lib/x86/apic.o
14 $(libcflat): LDFLAGS += -nostdlib
15 $(libcflat): CFLAGS += -ffreestanding -I lib
17 CFLAGS += -m$(bits)
19 libgcc := $(shell $(CC) -m$(bits) --print-libgcc-file-name)
21 FLATLIBS = lib/libcflat.a $(libgcc)
22 %.flat: %.o $(FLATLIBS) flat.lds
23 $(CC) $(CFLAGS) -nostdlib -o $@ -Wl,-T,flat.lds $(filter %.o, $^) $(FLATLIBS)
25 tests-common = $(TEST_DIR)/vmexit.flat $(TEST_DIR)/tsc.flat \
26 $(TEST_DIR)/smptest.flat $(TEST_DIR)/port80.flat \
27 $(TEST_DIR)/realmode.flat $(TEST_DIR)/msr.flat
29 test_cases: $(tests-common) $(tests)
31 $(TEST_DIR)/%.o: CFLAGS += -std=gnu99 -ffreestanding -I lib -I lib/x86
33 $(TEST_DIR)/access.flat: $(cstart.o) $(TEST_DIR)/access.o $(TEST_DIR)/print.o
35 $(TEST_DIR)/hypercall.flat: $(cstart.o) $(TEST_DIR)/hypercall.o $(TEST_DIR)/print.o
37 $(TEST_DIR)/sieve.flat: $(cstart.o) $(TEST_DIR)/sieve.o \
38 $(TEST_DIR)/print.o $(TEST_DIR)/vm.o
40 $(TEST_DIR)/vmexit.flat: $(cstart.o) $(TEST_DIR)/vmexit.o
42 $(TEST_DIR)/smptest.flat: $(cstart.o) $(TEST_DIR)/smptest.o
44 $(TEST_DIR)/emulator.flat: $(cstart.o) $(TEST_DIR)/emulator.o \
45 $(TEST_DIR)/vm.o $(TEST_DIR)/print.o
47 $(TEST_DIR)/port80.flat: $(cstart.o) $(TEST_DIR)/port80.o
49 $(TEST_DIR)/tsc.flat: $(cstart.o) $(TEST_DIR)/tsc.o
51 $(TEST_DIR)/apic.flat: $(cstart.o) $(TEST_DIR)/apic.o $(TEST_DIR)/vm.o \
52 $(TEST_DIR)/print.o
54 $(TEST_DIR)/realmode.flat: $(TEST_DIR)/realmode.o
55 $(CC) -m32 -nostdlib -o $@ -Wl,-T,$(TEST_DIR)/realmode.lds $^
57 $(TEST_DIR)/realmode.o: bits = 32
59 $(TEST_DIR)/msr.flat: $(cstart.o) $(TEST_DIR)/msr.o
61 arch_clean:
62 $(RM) $(TEST_DIR)/*.o $(TEST_DIR)/*.flat \
63 $(TEST_DIR)/.*.d $(TEST_DIR)/lib/.*.d $(TEST_DIR)/lib/*.o
65 -include $(TEST_DIR)/.*.d lib/.*.d lib/x86/.*.d