From fa8f005a6c97480a671146c483cf1183d5f1b083 Mon Sep 17 00:00:00 2001 From: cbdev Date: Sun, 24 Mar 2019 15:20:25 +0100 Subject: Introduce full build target in root --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index cda8fae..5ee9cd9 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: all clean run sanitize backends +.PHONY: all clean run sanitize backends full backends-full OBJS = config.o backend.o plugin.o PLUGINDIR = "\"./backends/\"" @@ -19,9 +19,14 @@ endif all: midimonster backends +full: midimonster backends-full + backends: $(MAKE) -C backends +backends-full: + $(MAKE) -C backends full + # This rule can not be the default rule because OSX the target prereqs are not exactly the build prereqs midimonster: midimonster.c portability.h $(OBJS) $(CC) $(CFLAGS) $(LDFLAGS) $< $(OBJS) $(LDLIBS) -o $@ -- cgit v1.2.3 From 20a6882a063404858588596bd3f12bdd9e53460a Mon Sep 17 00:00:00 2001 From: cbdev Date: Sat, 3 Aug 2019 18:42:39 +0200 Subject: Windows build compatiblity --- Makefile | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 5ee9cd9..b82d6d8 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,14 @@ -.PHONY: all clean run sanitize backends full backends-full +.PHONY: all clean run sanitize backends windows full backends-full OBJS = config.o backend.o plugin.o PLUGINDIR = "\"./backends/\"" +PLUGINDIR_W32 = "\"backends\\\\\"" SYSTEM := $(shell uname -s) -CFLAGS ?= -g -Wall +CFLAGS ?= -g -Wall -Wpedantic +# Hide all non-API symbols for export +CFLAGS += -fvisibility=hidden + #CFLAGS += -DDEBUG midimonster: LDLIBS = -ldl midimonster: CFLAGS += -DPLUGINS=$(PLUGINDIR) @@ -21,6 +25,8 @@ all: midimonster backends full: midimonster backends-full +windows: midimonster.exe + backends: $(MAKE) -C backends @@ -31,8 +37,21 @@ backends-full: midimonster: midimonster.c portability.h $(OBJS) $(CC) $(CFLAGS) $(LDFLAGS) $< $(OBJS) $(LDLIBS) -o $@ +midimonster.exe: export CC = x86_64-w64-mingw32-gcc +#midimonster.exe: CFLAGS += -Wno-format +midimonster.exe: CFLAGS += -DPLUGINS=$(PLUGINDIR_W32) -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 $@ + # The windows build for backends requires the import library generated with the build, + # so the backends can't be a prerequisite for the executable... + $(MAKE) -C backends windows + clean: $(RM) midimonster + $(RM) midimonster.exe + $(RM) libmmapi.a $(RM) $(OBJS) $(MAKE) -C backends clean -- cgit v1.2.3 From 47a5f9a21bd661f9161d6175ebd074962daee255 Mon Sep 17 00:00:00 2001 From: cbdev Date: Wed, 7 Aug 2019 17:25:24 +0200 Subject: Fix export visibilities for GCC --- Makefile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b82d6d8..57fe089 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,7 @@ all: midimonster backends full: midimonster backends-full windows: midimonster.exe + $(MAKE) -C backends windows backends: $(MAKE) -C backends @@ -38,15 +39,11 @@ midimonster: midimonster.c portability.h $(OBJS) $(CC) $(CFLAGS) $(LDFLAGS) $< $(OBJS) $(LDLIBS) -o $@ midimonster.exe: export CC = x86_64-w64-mingw32-gcc -#midimonster.exe: CFLAGS += -Wno-format midimonster.exe: CFLAGS += -DPLUGINS=$(PLUGINDIR_W32) -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 $@ - # The windows build for backends requires the import library generated with the build, - # so the backends can't be a prerequisite for the executable... - $(MAKE) -C backends windows clean: $(RM) midimonster -- cgit v1.2.3 From b4b27aa4a90899d5b025bbef11d444d4c47800d9 Mon Sep 17 00:00:00 2001 From: cbdev Date: Fri, 23 Aug 2019 19:47:53 +0200 Subject: Finalize & publish maweb backend --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 57fe089..2d88c49 100644 --- a/Makefile +++ b/Makefile @@ -56,5 +56,5 @@ run: valgrind --leak-check=full --show-leak-kinds=all ./midimonster sanitize: export CC = clang -sanitize: export CFLAGS = -g -Wall -Wpedantic -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer +sanitize: export CFLAGS += -g -Wall -Wpedantic -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer sanitize: midimonster backends -- cgit v1.2.3 From 350f0d2d2eaff5f0d57b09857102e2df1e96d733 Mon Sep 17 00:00:00 2001 From: cbdev Date: Thu, 7 Nov 2019 18:44:19 +0100 Subject: Makefile install target and packaging instructions (Fixes #28) --- Makefile | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 2d88c49..5a83a2d 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,7 @@ -.PHONY: all clean run sanitize backends windows full backends-full +.PHONY: all clean run sanitize backends windows full backends-full install OBJS = config.o backend.o plugin.o -PLUGINDIR = "\"./backends/\"" -PLUGINDIR_W32 = "\"backends\\\\\"" +PREFIX ?= /usr SYSTEM := $(shell uname -s) CFLAGS ?= -g -Wall -Wpedantic @@ -11,7 +10,6 @@ CFLAGS += -fvisibility=hidden #CFLAGS += -DDEBUG midimonster: LDLIBS = -ldl -midimonster: CFLAGS += -DPLUGINS=$(PLUGINDIR) # Work around strange linker passing convention differences in Linux and OSX ifeq ($(SYSTEM),Linux) @@ -21,6 +19,14 @@ ifeq ($(SYSTEM),Darwin) midimonster: LDFLAGS += -Wl,-export_dynamic endif +# Allow overriding the locations for backend plugins and default configuration +ifdef DEFAULT_CFG +midimonster: CFLAGS += -DDEFAULT_CFG=\"$(DEFAULT_CFG)\" +endif +ifdef PLUGINS +midimonster: CFLAGS += -DPLUGINS=\"$(PLUGINS)\" +endif + all: midimonster backends full: midimonster backends-full @@ -39,7 +45,7 @@ midimonster: midimonster.c portability.h $(OBJS) $(CC) $(CFLAGS) $(LDFLAGS) $< $(OBJS) $(LDLIBS) -o $@ midimonster.exe: export CC = x86_64-w64-mingw32-gcc -midimonster.exe: CFLAGS += -DPLUGINS=$(PLUGINDIR_W32) -Wno-format +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) @@ -55,6 +61,12 @@ clean: run: valgrind --leak-check=full --show-leak-kinds=all ./midimonster +install: + install -d "$(DESTDIR)$(PREFIX)/bin" + install -d "$(DESTDIR)$(PREFIX)/lib/midimonster" + install -m 0755 midimonster "$(DESTDIR)$(PREFIX)/bin" + install -m 0755 backends/*.so "$(DESTDIR)$(PREFIX)/lib/midimonster" + sanitize: export CC = clang sanitize: export CFLAGS += -g -Wall -Wpedantic -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer sanitize: midimonster backends -- cgit v1.2.3 From aed52ce3e67f35c69ef1295f770a012258167496 Mon Sep 17 00:00:00 2001 From: cbdev Date: Sun, 10 Nov 2019 14:24:51 +0100 Subject: Actually use plugin install path in Makefile --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 5a83a2d..40570c8 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ OBJS = config.o backend.o plugin.o PREFIX ?= /usr +PLUGIN_INSTALL = "$(PREFIX)/lib/midimonster" SYSTEM := $(shell uname -s) CFLAGS ?= -g -Wall -Wpedantic @@ -25,6 +26,7 @@ midimonster: CFLAGS += -DDEFAULT_CFG=\"$(DEFAULT_CFG)\" endif ifdef PLUGINS midimonster: CFLAGS += -DPLUGINS=\"$(PLUGINS)\" +PLUGIN_INSTALL = $(PLUGINS) endif all: midimonster backends @@ -63,7 +65,7 @@ run: install: install -d "$(DESTDIR)$(PREFIX)/bin" - install -d "$(DESTDIR)$(PREFIX)/lib/midimonster" + install -d "$(DESTDIR)$(PLUGIN_INSTALL)" install -m 0755 midimonster "$(DESTDIR)$(PREFIX)/bin" install -m 0755 backends/*.so "$(DESTDIR)$(PREFIX)/lib/midimonster" -- cgit v1.2.3 From 5b840d986ae723656aad4163e12f7d24a88e1da3 Mon Sep 17 00:00:00 2001 From: cbdev Date: Sun, 1 Dec 2019 12:56:22 +0100 Subject: Add configuration files and examples to install target --- Makefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 40570c8..caad174 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ OBJS = config.o backend.o plugin.o PREFIX ?= /usr -PLUGIN_INSTALL = "$(PREFIX)/lib/midimonster" +PLUGIN_INSTALL = $(PREFIX)/lib/midimonster SYSTEM := $(shell uname -s) CFLAGS ?= -g -Wall -Wpedantic @@ -65,9 +65,14 @@ run: install: install -d "$(DESTDIR)$(PREFIX)/bin" - install -d "$(DESTDIR)$(PLUGIN_INSTALL)" install -m 0755 midimonster "$(DESTDIR)$(PREFIX)/bin" - install -m 0755 backends/*.so "$(DESTDIR)$(PREFIX)/lib/midimonster" + install -d "$(DESTDIR)$(PLUGIN_INSTALL)" + install -m 0755 backends/*.so "$(DESTDIR)$(PLUGIN_INSTALL)" + install -d "$(DESTDIR)$(PREFIX)/share/midimonster" + install -m 0644 configs/* "$(DESTDIR)$(PREFIX)/share/midimonster" +ifdef DEFAULT_CFG + install -m 0644 monster.cfg "$(DESTDIR)$(DEFAULT_CFG)" +endif sanitize: export CC = clang sanitize: export CFLAGS += -g -Wall -Wpedantic -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer -- cgit v1.2.3 From bb6e54e99b86a71fcc300890b41b49209245ac61 Mon Sep 17 00:00:00 2001 From: cbdev Date: Wed, 4 Dec 2019 21:48:25 +0100 Subject: Have the configuration file be installed in a separate directory --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index caad174..8b2d7ec 100644 --- a/Makefile +++ b/Makefile @@ -71,7 +71,7 @@ install: install -d "$(DESTDIR)$(PREFIX)/share/midimonster" install -m 0644 configs/* "$(DESTDIR)$(PREFIX)/share/midimonster" ifdef DEFAULT_CFG - install -m 0644 monster.cfg "$(DESTDIR)$(DEFAULT_CFG)" + install -Dm 0644 monster.cfg "$(DESTDIR)$(DEFAULT_CFG)" endif sanitize: export CC = clang -- cgit v1.2.3 From 96fe966928cd83f22aed388a11013b67c1a374a1 Mon Sep 17 00:00:00 2001 From: cbdev Date: Fri, 6 Dec 2019 18:58:59 +0100 Subject: Make install path for examples configurable --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 8b2d7ec..8dab638 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ OBJS = config.o backend.o plugin.o PREFIX ?= /usr PLUGIN_INSTALL = $(PREFIX)/lib/midimonster +EXAMPLES ?= $(PREFIX)/share/midimonster SYSTEM := $(shell uname -s) CFLAGS ?= -g -Wall -Wpedantic @@ -68,8 +69,8 @@ install: install -m 0755 midimonster "$(DESTDIR)$(PREFIX)/bin" install -d "$(DESTDIR)$(PLUGIN_INSTALL)" install -m 0755 backends/*.so "$(DESTDIR)$(PLUGIN_INSTALL)" - install -d "$(DESTDIR)$(PREFIX)/share/midimonster" - install -m 0644 configs/* "$(DESTDIR)$(PREFIX)/share/midimonster" + install -d "$(DESTDIR)$(EXAMPLES)" + install -m 0644 configs/* "$(DESTDIR)$(EXAMPLES)" ifdef DEFAULT_CFG install -Dm 0644 monster.cfg "$(DESTDIR)$(DEFAULT_CFG)" endif -- cgit v1.2.3