aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-08-09 20:00:22 +0000
committerDavid Robillard <d@drobilla.net>2008-08-09 20:00:22 +0000
commitbeee8b03198cd02c40c23b50a90d8858dd859e72 (patch)
tree57396780622d599bf73a1a4331822ad20337e323
parentde1823907f15b285ce1fe997d1910e29e54122fa (diff)
downloadmda.lv2-beee8b03198cd02c40c23b50a90d8858dd859e72.tar.gz
mda.lv2-beee8b03198cd02c40c23b50a90d8858dd859e72.tar.bz2
mda.lv2-beee8b03198cd02c40c23b50a90d8858dd859e72.zip
Fix compilation on Darwin.
Install to OSX style paths by default on Darwin. git-svn-id: http://svn.drobilla.net/lad/mda-lv2@1338 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--Makefile24
1 files changed, 20 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 7cae036..7a12f90 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,22 @@
#CFLAGS = -O0 -g -ansi -pedantic -Wall -Wextra -Wshadow -Woverloaded-virtual -Wno-unused
CFLAGS += -fPIC -DPIC -Ilvz -I. -DPLUGIN_URI_PREFIX=\"http://drobilla.net/ns/dev/mda-lv2/\"
+SYSTEMNAME = $(shell uname -s)
+
+ifeq ($(SYSTEMNAME),Darwin)
+CFLAGS += -fno-common -flat_namespace
+SHARED_LDFLAGS = -fno-common -flat_namespace -bundle -undefined suppress -lbundle1.o -nostartfiles
+USER_INSTALL_DIR = ~/Library/Audio/Plug-Ins/LV2/
+LOCAL_INSTALL_DIR = /Library/Audio/Plug-Ins/LV2/
+SYSTEM_INSTALL_DIR = /Library/Audio/Plug-Ins/LV2/
+else
+SHARED_LDFLAGS = -shared
+USER_INSTALL_DIR = ~/.lv2/
+SYSTEM_INSTALL_DIR = /usr/lib/lv2/
+LOCAL_INSTALL_DIR = /usr/local/lib/lv2/
+endif
+
+
all: lvz/gendata libs data
bundle:
@@ -60,13 +76,13 @@ install:
fi
install-user:
- INSTALL_DIR=$(HOME)/.lv2 make install
+ INSTALL_DIR=$(USER_INSTALL_DIR) make install
install-local:
- INSTALL_DIR=/usr/local/lib/lv2 make install
+ INSTALL_DIR=$(LOCAL_INSTALL_DIR) make install
install-system:
- INSTALL_DIR=/usr/lib/lv2 make install
+ INSTALL_DIR=$(SYSTEM_INSTALL_DIR) make install
uninstall:
rm -rf $(HOME)/.lv2/mda.lv2
@@ -79,7 +95,7 @@ lvz/gendata: lvz/gendata.cpp lvz/audioeffectx.h
$(CXX) $(CFLAGS) -ldl $< -o $@
mda.lv2/%.so: src/%.cpp lvz/wrapper.cpp
- $(CXX) -shared $(CFLAGS) \
+ $(CXX) $(SHARED_LDFLAGS) $(CFLAGS) \
-DPLUGIN_CLASS=`echo $@ | sed 's/mda.lv2\///' | sed 's/\..*//'` \
-DPLUGIN_URI_SUFFIX=\"`echo $@ | sed 's/mda.lv2\///' | sed 's/^mda//' | sed 's/\..*//'`\" \
-DPLUGIN_HEADER=\"`echo $@ | sed 's/^mda.lv2/src/' | sed 's/\(.*\)\..*/\1/' | sed 's/$$/\.h/'`\" \