You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/media-libs/ladspa-sdk/files/ladspa-sdk-1.17-properbuild...

117 lines
3.9 KiB

diff --git a/src/Makefile b/src/Makefile
index 774930a..765f66e 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -14,11 +14,10 @@ INSTALL_BINARY_DIR = /usr/bin/
#
INCLUDES = -I.
-LIBRARIES = -ldl -lm -lsndfile
-CFLAGS = $(INCLUDES) -Wall -Werror -O2 -fPIC \
- -DDEFAULT_LADSPA_PATH=$(INSTALL_PLUGINS_DIR)
-BINFLAGS = -fPIE -pie
-CXXFLAGS = $(CFLAGS)
+DYNAMIC_LD_LIBS = -ldl
+LIBRARIES = $(DYNAMIC_LD_LIBS) -lm -lsndfile
+CFLAGS = -Wall -Werror -O3
+CXXFLAGS = -Wall -Werror -O3
PLUGINS = ../plugins/amp.so \
../plugins/delay.so \
../plugins/filter.so \
@@ -28,34 +27,25 @@ PROGRAMS = ../bin/analyseplugin \
../bin/applyplugin \
../bin/listplugins
CC = cc
-CPP = c++
+CXX = c++
+MKDIR_P = mkdirhier
###############################################################################
#
# RULES TO BUILD PLUGINS FROM C OR C++ CODE
#
+../plugins/filter.so: plugins/filter.c ladspa.h gcc_exports.map
+ $(CC) $(CFLAGS) $(INCLUDES) -fPIC -o plugins/filter.o -c plugins/filter.c
+ $(CC) $(CFLAGS) $(LDFLAGS) -o ../plugins/filter.so plugins/filter.o -nostartfiles -shared -lm
+
../plugins/%.so: plugins/%.c ladspa.h gcc_exports.map
- $(CC) $(CFLAGS) -o plugins/$*.o -c plugins/$*.c
- $(CC) -o ../plugins/$*.so \
- plugins/$*.o \
- -shared \
- $(CFLAGS) \
- -fvisibility=hidden \
- -fvisibility-inlines-hidden \
- -s \
- -Wl,--version-script=gcc_exports.map
+ $(CC) $(CFLAGS) $(INCLUDES) -fPIC -o plugins/$*.o -c plugins/$*.c
+ $(CC) $(CFLAGS) $(LDFLAGS) -o ../plugins/$*.so plugins/$*.o -nostartfiles -shared
../plugins/%.so: plugins/%.cpp ladspa.h gcc_exports.map
- $(CPP) $(CXXFLAGS) -o plugins/$*.o -c plugins/$*.cpp
- $(CPP) -o ../plugins/$*.so \
- plugins/$*.o \
- -shared \
- $(CXXFLAGS) \
- -fvisibility=hidden \
- -fvisibility-inlines-hidden \
- -s \
- -Wl,--version-script=gcc_exports.map
+ $(CXX) $(CXXFLAGS) $(INCLUDES) -fPIC -o plugins/$*.o -c plugins/$*.cpp
+ $(CXX) $(LDFLAGS) -o ../plugins/$*.so plugins/$*.o -shared
###############################################################################
#
@@ -66,7 +56,7 @@ test: /tmp/test.wav ../snd/noise.wav always
@echo ---------------------------------------------
@echo First listen to the white noise input signal:
@echo ---------------------------------------------
- -sndfile-play ../snd/noise.wav
+ @echo -sndfile-play ../snd/noise.wav
@echo -------------------------
@echo Compare to plugin output.
@echo -------------------------
@@ -75,12 +65,12 @@ test: /tmp/test.wav ../snd/noise.wav always
@echo Test complete.
install: targets
- -mkdir -p $(INSTALL_PLUGINS_DIR)
- -mkdir -p $(INSTALL_INCLUDE_DIR)
- -mkdir -p $(INSTALL_BINARY_DIR)
- cp ../plugins/* $(INSTALL_PLUGINS_DIR)
- cp ladspa.h $(INSTALL_INCLUDE_DIR)
- cp ../bin/* $(INSTALL_BINARY_DIR)
+ -$(MKDIR_P) $(DESTDIR)$(INSTALL_PLUGINS_DIR)
+ -$(MKDIR_P) $(DESTDIR)$(INSTALL_INCLUDE_DIR)
+ -$(MKDIR_P) $(DESTDIR)$(INSTALL_BINARY_DIR)
+ cp ../plugins/* $(DESTDIR)$(INSTALL_PLUGINS_DIR)
+ cp ladspa.h $(DESTDIR)$(INSTALL_INCLUDE_DIR)
+ cp ../bin/* $(DESTDIR)$(INSTALL_BINARY_DIR)
/tmp/test.wav: targets ../snd/noise.wav
../bin/listplugins
@@ -106,19 +96,19 @@ targets: $(PLUGINS) $(PROGRAMS)
#
../bin/applyplugin: applyplugin.o load.o default.o
- $(CC) $(CFLAGS) $(BINFLAGS) \
+ $(CC) $(CFLAGS) $(INCLUDES) $(LDFLAGS) \
-o ../bin/applyplugin \
applyplugin.o load.o default.o \
$(LIBRARIES)
../bin/analyseplugin: analyseplugin.o load.o default.o
- $(CC) $(CFLAGS) $(BINFLAGS) \
+ $(CC) $(CFLAGS) $(INCLUDES) $(LDFLAGS) \
-o ../bin/analyseplugin \
analyseplugin.o load.o default.o \
$(LIBRARIES)
../bin/listplugins: listplugins.o search.o
- $(CC) $(CFLAGS) $(BINFLAGS) \
+ $(CC) $(CFLAGS) $(INCLUDES) $(LDFLAGS) \
-o ../bin/listplugins \
listplugins.o search.o \
$(LIBRARIES)