summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDebian Multimedia Maintainers <debian-multimedia@lists.debian.org>2019-04-13 14:15:23 -0400
committerFelipe Sateler <fsateler@debian.org>2019-07-07 22:51:07 -0400
commit3ea3080a6f9da6adc8ad37f0aed6502cf845e9f4 (patch)
treeda59202f98845d05db8ce9ee139b35a481d2d0ac
parent138708c9813d0f14e8aec97868e4bb1a13dfd8a3 (diff)
Allow passing *FLAGS to make
Allow overriding of build parameters via the standard make variables Forwarded: Yes Gbp-Pq: Name Allow-passing-FLAGS-to-make.patch
-rw-r--r--src/Makefile32
1 files changed, 20 insertions, 12 deletions
diff --git a/src/Makefile b/src/Makefile
index c339524..bcd8966 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -15,10 +15,9 @@ INSTALL_BINARY_DIR = /usr/bin/
INCLUDES = -I.
LIBRARIES = -ldl -lm
-CFLAGS = $(INCLUDES) -Wall -Werror -O2 -fPIC \
- -DDEFAULT_LADSPA_PATH=$(INSTALL_PLUGINS_DIR)
+MANDATORY = $(INCLUDES) -fPIC -DDEFAULT_LADSPA_PATH=$(INSTALL_PLUGINS_DIR)
+CFLAGS ?= -Wall -Werror -O2
BINFLAGS = -fPIE -pie
-CXXFLAGS = $(CFLAGS)
PLUGINS = ../plugins/amp.so \
../plugins/delay.so \
../plugins/filter.so \
@@ -27,8 +26,8 @@ PLUGINS = ../plugins/amp.so \
PROGRAMS = ../bin/analyseplugin \
../bin/applyplugin \
../bin/listplugins
-CC = cc
-CPP = c++
+CC ?= cc
+CXX ?= c++
###############################################################################
#
@@ -36,22 +35,28 @@ CPP = c++
#
../plugins/%.so: plugins/%.c ladspa.h gcc_exports.map
- $(CC) $(CFLAGS) -o plugins/$*.o -c plugins/$*.c
- $(CC) -o ../plugins/$*.so \
+ $(CC) $(MANDATORY) $(CPPFLAGS) $(CFLAGS) -o plugins/$*.o -c plugins/$*.c
+ $(CC) -o ../plugins/$*.so \
plugins/$*.o \
-shared \
+ $(MANDATORY) \
$(CFLAGS) \
+ $(LDFLAGS) \
+ $(LIBRARIES) \
-fvisibility=hidden \
-fvisibility-inlines-hidden \
-s \
-Wl,--version-script=gcc_exports.map
../plugins/%.so: plugins/%.cpp ladspa.h gcc_exports.map
- $(CPP) $(CXXFLAGS) -o plugins/$*.o -c plugins/$*.cpp
- $(CPP) -o ../plugins/$*.so \
+ $(CXX) $(MANDATORY) $(CPPFLAGS) $(CXXFLAGS) -o plugins/$*.o -c plugins/$*.cpp
+ $(CXX) -o ../plugins/$*.so -shared \
plugins/$*.o \
-shared \
+ $(MANDATORY) \
$(CXXFLAGS) \
+ $(LDFLAGS) \
+ $(LIBRARIES) \
-fvisibility=hidden \
-fvisibility-inlines-hidden \
-s \
@@ -109,19 +114,22 @@ targets: $(PLUGINS) $(PROGRAMS)
$(CC) $(CFLAGS) $(BINFLAGS) \
-o ../bin/applyplugin \
applyplugin.o load.o default.o \
- $(LIBRARIES)
+ $(LIBRARIES) \
+ $(LDFLAGS)
../bin/analyseplugin: analyseplugin.o load.o default.o
$(CC) $(CFLAGS) $(BINFLAGS) \
-o ../bin/analyseplugin \
analyseplugin.o load.o default.o \
- $(LIBRARIES)
+ $(LIBRARIES) \
+ $(LDFLAGS)
../bin/listplugins: listplugins.o search.o
$(CC) $(CFLAGS) $(BINFLAGS) \
-o ../bin/listplugins \
listplugins.o search.o \
- $(LIBRARIES)
+ $(LIBRARIES) \
+ $(LDFLAGS)
###############################################################################
#