Makefile - Add SFML as dependency

This commit is contained in:
madmaurice 2023-09-09 19:20:41 +02:00
parent ec4adf289f
commit dc81fcb4e5
2 changed files with 11 additions and 6 deletions

View file

@ -1,5 +1,11 @@
TARGETS := libemu.a vgbc vgbc.test vgbc.inspect vgbc.gbdif
sfml_packages := sfml-graphics
sfml_CXXFLAGS := $(shell pkg-config --cflags $(sfml_packages))
sfml_LDFLAGS := $(shell pkg-config --libs $(sfml_packages))
CXXFLAGS := -I $(CURDIR) $(sfml_CXXFLAGS)
cmd_libemu.a = ar -rc $@ $^
verb_libemu.a = pack
modules_libemu.a := memory/device.o \
@ -15,13 +21,14 @@ modules_libemu.a := memory/device.o \
modules_vgbc := main.o libemu.a
verb_vgbc := link
LDFLAGS_vgbc := $(sfml_LDFLAGS)
sources_vgbc.test := $(shell find tests/ -name '*.cpp')
objects_vgbc.test := $(patsubst %.cpp,%.o,$(sources_vgbc.test))
modules_vgbc.test := $(objects_vgbc.test) libemu.a
verb_vgbc.test := link
$(objects_vgbc.test): CXX_FLAGS+=-I $(CURDIR)/tests
$(objects_vgbc.test): CXXFLAGS+=-I $(CURDIR)/tests
modules_vgbc.inspect := cartridge/inspector.o libemu.a
verb_vgbc.inspect := link
@ -29,5 +36,3 @@ verb_vgbc.inspect := link
# Game Boy Doctor Interface
modules_vgbc.gbdif := misc/gbdif.o libemu.a
verb_vgbc.gbdif := link
CXX_FLAGS := -I $(CURDIR)

View file

@ -3,7 +3,7 @@
include Makeconf
# Auto tracking of headers
CXX_FLAGS += -MMD
CXXFLAGS += -MMD
all-modules := $(foreach t,$(TARGETS),$(modules_$(t)))
@ -12,7 +12,7 @@ depfiles := $(patsubst %.o,%.d,$(filter %.o,$(all-modules)))
-include $(depfiles)
clean-objs := $(TARGETS) $(all-modules) $(depfiles)
cmd = $(VERBOSE)g++ $(CXX_FLAGS) -o $@ $^
cmd = $(VERBOSE)g++ $(CXXFLAGS) $(LDFLAGS_$@) -o $@ $^
msg = $(or $(verb_$@),finalize) $@
ifneq ($V,1)
@ -34,7 +34,7 @@ test: vgbc.test
%.o: %.cpp
@echo " ... build $@"
$(VERBOSE)g++ $(CXX_FLAGS) -c -o $@ $<
$(VERBOSE)g++ $(CXXFLAGS) -c -o $@ $<
define target_rule
$(1): $$(modules_$(1))