[kvm-unit-tests PATCH 2/2] api/x86: sanitize Makefile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We weren't cleaning api/, rules were needlessly repetitive, and c++
specific flags weren't in CXXFLAGS.

Signed-off-by: Radim Krčmář <rkrcmar@xxxxxxxxxx>
---
 x86/Makefile.common | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/x86/Makefile.common b/x86/Makefile.common
index 57e8e45388cd..7bb6b50c3975 100644
--- a/x86/Makefile.common
+++ b/x86/Makefile.common
@@ -51,14 +51,12 @@ tests-common = $(TEST_DIR)/vmexit.flat $(TEST_DIR)/tsc.flat \
                $(TEST_DIR)/hyperv_synic.flat $(TEST_DIR)/hyperv_stimer.flat \
 
 ifdef API
-tests-common += api/api-sample
-tests-common += api/dirty-log
-tests-common += api/dirty-log-perf
+tests-api = api/api-sample api/dirty-log api/dirty-log-perf
 
 OBJDIRS += api
 endif
 
-test_cases: $(tests-common) $(tests)
+test_cases: $(tests-common) $(tests) $(tests-api)
 
 $(TEST_DIR)/%.o: CFLAGS += -std=gnu99 -ffreestanding -I $(SRCDIR)/lib -I $(SRCDIR)/lib/x86 -I lib
 
@@ -75,9 +73,10 @@ $(TEST_DIR)/hyperv_stimer.elf: $(TEST_DIR)/hyperv.o
 
 arch_clean:
 	$(RM) $(TEST_DIR)/*.o $(TEST_DIR)/*.flat $(TEST_DIR)/*.elf \
-	$(TEST_DIR)/.*.d lib/x86/.*.d
+	$(TEST_DIR)/.*.d lib/x86/.*.d \
+	$(tests-api) api/*.o api/*.a api/.*.d
 
-api/%.o: CFLAGS += -m32 -std=gnu++11
+api/%.o: CXXFLAGS += -m32 -std=gnu++11
 
 api/%: LDLIBS += -lstdc++ -lpthread -lrt
 api/%: LDFLAGS += -m32
@@ -85,8 +84,4 @@ api/%: LDFLAGS += -m32
 api/libapi.a: api/kvmxx.o api/identity.o api/exception.o api/memmap.o
 	$(AR) rcs $@ $^
 
-api/api-sample: api/api-sample.o api/libapi.a
-
-api/dirty-log: api/dirty-log.o api/libapi.a
-
-api/dirty-log-perf: api/dirty-log-perf.o api/libapi.a
+$(tests-api) : % : %.o api/libapi.a
-- 
2.13.0




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux