tests - Build o-files for tests

This should reduce build time when rebuilding tests
This commit is contained in:
madmaurice 2023-08-29 23:19:13 +02:00
parent a3730b868c
commit c2d5ca5cfc

View file

@ -1,8 +1,10 @@
include Makeconf include Makeconf
test-srcs := $(wildcard tests/*.cpp)
emu-objs := $(addsuffix .o,$(modules)) emu-objs := $(addsuffix .o,$(modules))
clean-objs := $(emu-objs) libemu.a vgbc vgbc.test clean-objs := $(emu-objs) libemu.a vgbc vgbc.test
test-srcs := $(wildcard tests/*.cpp) test-objs := $(patsubst %.cpp,%.o,$(test-srcs))
headers := $(wildcard */*.h) headers := $(wildcard */*.h)
.PHONY: all test clean .PHONY: all test clean
@ -24,5 +26,5 @@ libemu.a: $(emu-objs)
vgbc: main.c libemu.a vgbc: main.c libemu.a
g++ $(CXX_FLAGS) -o $@ $^ g++ $(CXX_FLAGS) -o $@ $^
vgbc.test: $(test-srcs) libemu.a vgbc.test: $(test-objs) libemu.a
g++ $(CXX_FLAGS) -o $@ $^ g++ $(CXX_FLAGS) -o $@ $^