@@ -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
We weren't cleaning api/, rules were needlessly repetitive, and c++ specific flags weren't in CXXFLAGS. Signed-off-by: Radim Krčmář <rkrcmar@redhat.com> --- x86/Makefile.common | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-)