aboutsummaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2021-06-30 03:03:48 +0200
committercbdev <cb@cbcdn.com>2021-06-30 03:03:48 +0200
commitbc3d80e9e6c038c87a64432586670c663a23e53d (patch)
tree5a28b0004a7f3492455316f34bb2c783e670f944 /Makefile
parent8a0a413f1dd5593189dd6b651babcff9b2495451 (diff)
parentf16f7db86662fcdbf45b6373257c90c824b0b4b0 (diff)
downloadmidimonster-bc3d80e9e6c038c87a64432586670c663a23e53d.tar.gz
midimonster-bc3d80e9e6c038c87a64432586670c663a23e53d.tar.bz2
midimonster-bc3d80e9e6c038c87a64432586670c663a23e53d.zip
Merge branch 'master' into debian/master
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 11 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index bda7bb1..de9b24e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
.PHONY: all clean run sanitize backends windows full backends-full install
-OBJS = config.o backend.o plugin.o
+OBJS = core/config.o core/backend.o core/plugin.o
PREFIX ?= /usr
PLUGIN_INSTALL = $(PREFIX)/lib/midimonster
@@ -13,12 +13,16 @@ CFLAGS ?= -g -Wall -Wpedantic
# Hide all non-API symbols for export
CFLAGS += -fvisibility=hidden
+# Subdirectory objects need the include path
+RCCFLAGS += -I./
+core/%: CFLAGS += -I./
+
midimonster: LDLIBS = -ldl
# Replace version string with current git-describe if possible
ifneq "$(GITVERSION)" ""
midimonster: CFLAGS += -DMIDIMONSTER_VERSION=\"$(GITVERSION)\"
midimonster.exe: CFLAGS += -DMIDIMONSTER_VERSION=\"$(GITVERSION)\"
-resource.o: RCCFLAGS += -DMIDIMONSTER_VERSION=\\\"$(GITVERSION)\\\"
+assets/resource.o: RCCFLAGS += -DMIDIMONSTER_VERSION=\\\"$(GITVERSION)\\\"
endif
# Work around strange linker passing convention differences in Linux and OSX
@@ -55,10 +59,10 @@ backends-full:
midimonster: midimonster.c portability.h $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $< $(OBJS) $(LDLIBS) -o $@
-resource.o: midimonster.rc midimonster.ico
+assets/resource.o: assets/midimonster.rc assets/midimonster.ico
$(RCC) $(RCCFLAGS) $< -o $@ --output-format=coff
-midimonster.ico: MIDIMonster.svg
+assets/midimonster.ico: assets/MIDIMonster.svg
convert -density 384 $< -define icon:auto-resize $@
midimonster.exe: export CC = x86_64-w64-mingw32-gcc
@@ -66,14 +70,14 @@ midimonster.exe: RCC ?= x86_64-w64-mingw32-windres
midimonster.exe: CFLAGS += -Wno-format
midimonster.exe: LDLIBS = -lws2_32
midimonster.exe: LDFLAGS += -Wl,--out-implib,libmmapi.a
-midimonster.exe: midimonster.c portability.h $(OBJS) resource.o
- $(CC) $(CFLAGS) $(LDFLAGS) $< $(OBJS) resource.o $(LDLIBS) -o $@
+midimonster.exe: midimonster.c portability.h $(OBJS) assets/resource.o
+ $(CC) $(CFLAGS) $(LDFLAGS) $< $(OBJS) assets/resource.o $(LDLIBS) -o $@
clean:
$(RM) midimonster
$(RM) midimonster.exe
$(RM) libmmapi.a
- $(RM) resource.o
+ $(RM) assets/resource.o
$(RM) $(OBJS)
$(MAKE) -C backends clean