aboutsummaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2020-03-08 17:12:03 +0100
committercbdev <cb@cbcdn.com>2020-03-08 17:12:03 +0100
commite0000797c80789d9d4559bb5264b982c187e1137 (patch)
tree746a063886aa0a3e51a21ce83bc8e2189d6adcd9 /Makefile
parent8558c3acef273833d7366e1af3659514fff9c942 (diff)
parent5f4b349aff49be0a5f6895631a93c47fcafcff93 (diff)
downloadmidimonster-e0000797c80789d9d4559bb5264b982c187e1137.tar.gz
midimonster-e0000797c80789d9d4559bb5264b982c187e1137.tar.bz2
midimonster-e0000797c80789d9d4559bb5264b982c187e1137.zip
Merge branch 'master' into debian/master
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 14 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 990aec3..bda7bb1 100644
--- a/Makefile
+++ b/Makefile
@@ -18,6 +18,7 @@ midimonster: LDLIBS = -ldl
ifneq "$(GITVERSION)" ""
midimonster: CFLAGS += -DMIDIMONSTER_VERSION=\"$(GITVERSION)\"
midimonster.exe: CFLAGS += -DMIDIMONSTER_VERSION=\"$(GITVERSION)\"
+resource.o: RCCFLAGS += -DMIDIMONSTER_VERSION=\\\"$(GITVERSION)\\\"
endif
# Work around strange linker passing convention differences in Linux and OSX
@@ -54,17 +55,25 @@ backends-full:
midimonster: midimonster.c portability.h $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $< $(OBJS) $(LDLIBS) -o $@
+resource.o: midimonster.rc midimonster.ico
+ $(RCC) $(RCCFLAGS) $< -o $@ --output-format=coff
+
+midimonster.ico: MIDIMonster.svg
+ convert -density 384 $< -define icon:auto-resize $@
+
midimonster.exe: export CC = x86_64-w64-mingw32-gcc
+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)
- $(CC) $(CFLAGS) $(LDFLAGS) $< $(OBJS) $(LDLIBS) -o $@
+midimonster.exe: midimonster.c portability.h $(OBJS) resource.o
+ $(CC) $(CFLAGS) $(LDFLAGS) $< $(OBJS) resource.o $(LDLIBS) -o $@
clean:
$(RM) midimonster
$(RM) midimonster.exe
$(RM) libmmapi.a
+ $(RM) resource.o
$(RM) $(OBJS)
$(MAKE) -C backends clean
@@ -79,8 +88,11 @@ install:
install -d "$(DESTDIR)$(EXAMPLES)"
install -m 0644 configs/* "$(DESTDIR)$(EXAMPLES)"
ifdef DEFAULT_CFG
+# Only install the default configuration if it is not already present to avoid overwriting it
+ifeq (,$(wildcard $(DEFAULT_CFG)))
install -Dm 0644 monster.cfg "$(DESTDIR)$(DEFAULT_CFG)"
endif
+endif
sanitize: export CC = clang
sanitize: export CFLAGS += -g -Wall -Wpedantic -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer