vgbc/Makefile

32 lines
526 B
Makefile
Raw Normal View History

2023-08-26 19:04:02 +02:00
include Makeconf
test-srcs := $(wildcard tests/*.cpp)
emu-objs := $(addsuffix .o,$(modules))
test-objs := $(patsubst %.cpp,%.o,$(test-srcs))
2023-08-29 23:22:20 +02:00
clean-objs := $(emu-objs) $(test-objs) libemu.a vgbc vgbc.test
headers := $(wildcard */*.h)
.PHONY: all test clean
all: vgbc
clean:
rm -rf $(clean-objs)
2023-08-28 22:31:24 +02:00
test: vgbc.test
2023-08-28 23:07:53 +02:00
@./$<
2023-08-26 19:04:02 +02:00
%.o: %.cpp $(headers)
g++ $(CXX_FLAGS) -c -o $@ $<
2023-08-26 19:04:02 +02:00
libemu.a: $(emu-objs)
ar -rc $@ $^
2023-08-28 22:31:24 +02:00
vgbc: main.c libemu.a
g++ $(CXX_FLAGS) -o $@ $^
vgbc.test: $(test-objs) libemu.a
g++ $(CXX_FLAGS) -o $@ $^