Commit e490e163 authored by Radim Krčmář's avatar Radim Krčmář
Browse files

api/x86: sanitize Makefile

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

Signed-off-by: default avatarRadim Krčmář <>
parent c020e0aa
......@@ -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
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
$(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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment