2023-08-26 19:04:02 +02:00
|
|
|
include Makeconf
|
|
|
|
|
2023-08-28 21:56:54 +02:00
|
|
|
emu-objs := $(addsuffix .o,$(modules))
|
|
|
|
test-targets := $(patsubst %,tests/%.bin, $(tests))
|
|
|
|
|
|
|
|
clean-objs := $(emu-objs) $(test-targets) libemu.a vgbc
|
|
|
|
|
|
|
|
.PHONY: all test clean
|
|
|
|
|
|
|
|
all: vgbc $(test-targets)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(clean-objs)
|
|
|
|
|
|
|
|
test: $(test-targets)
|
|
|
|
@for test in $(tests); do \
|
|
|
|
if ./tests/$$test.bin; then \
|
|
|
|
echo "-- $$test successful"; \
|
|
|
|
else \
|
|
|
|
echo "-- $$test failed"; \
|
|
|
|
exit 1; \
|
|
|
|
fi \
|
|
|
|
done
|
2023-08-26 19:04:02 +02:00
|
|
|
|
|
|
|
%.o: %.cpp
|
|
|
|
g++ $(CXX_FLAGS) -c -o $@ $^
|
|
|
|
|
2023-08-28 21:56:54 +02:00
|
|
|
libemu.a: $(emu-objs)
|
|
|
|
ar -rc $@ $^
|
|
|
|
|
|
|
|
tests/%.bin: tests/%.cpp libemu.a
|
|
|
|
g++ $(CXX_FLAGS) -o $@ $^
|
|
|
|
|
|
|
|
vgbc: main.c libemu.a
|
|
|
|
g++ $(CXX_FLAGS) -o $@ $^
|