30 lines
528 B
Makefile
30 lines
528 B
Makefile
include Makeconf
|
|
|
|
test-srcs := $(wildcard tests/*.cpp)
|
|
|
|
emu-objs := $(addsuffix .o,$(modules))
|
|
clean-objs := $(emu-objs) libemu.a vgbc vgbc.test
|
|
test-objs := $(patsubst %.cpp,%.o,$(test-srcs))
|
|
headers := $(wildcard */*.h)
|
|
|
|
.PHONY: all test clean
|
|
|
|
all: vgbc $(test-targets)
|
|
|
|
clean:
|
|
rm -rf $(clean-objs)
|
|
|
|
test: vgbc.test
|
|
@./$<
|
|
|
|
%.o: %.cpp $(headers)
|
|
g++ $(CXX_FLAGS) -c -o $@ $<
|
|
|
|
libemu.a: $(emu-objs)
|
|
ar -rc $@ $^
|
|
|
|
vgbc: main.c libemu.a
|
|
g++ $(CXX_FLAGS) -o $@ $^
|
|
|
|
vgbc.test: $(test-objs) libemu.a
|
|
g++ $(CXX_FLAGS) -o $@ $^
|