Makefile - let objs depend on all headers

This commit is contained in:
madmaurice 2023-08-29 23:18:51 +02:00
parent 5281ceb0d6
commit a3730b868c

View file

@ -3,6 +3,7 @@ include Makeconf
emu-objs := $(addsuffix .o,$(modules))
clean-objs := $(emu-objs) libemu.a vgbc vgbc.test
test-srcs := $(wildcard tests/*.cpp)
headers := $(wildcard */*.h)
.PHONY: all test clean
@ -14,8 +15,8 @@ clean:
test: vgbc.test
@./$<
%.o: %.cpp
g++ $(CXX_FLAGS) -c -o $@ $^
%.o: %.cpp $(headers)
g++ $(CXX_FLAGS) -c -o $@ $<
libemu.a: $(emu-objs)
ar -rc $@ $^