-
Notifications
You must be signed in to change notification settings - Fork 0
/
ladspa-flags.patch
98 lines (88 loc) · 2.83 KB
/
ladspa-flags.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
From: Debian Multimedia Maintainers <[email protected]>
Date: Sat, 13 Apr 2019 14:15:23 -0400
Subject: Allow passing *FLAGS to make
Allow overriding of build parameters via the standard make variables
Forwarded: Yes
---
src/Makefile | 32 ++++++++++++++++++++------------
1 file 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)
###############################################################################
#