From 31eff98aa7eda5cb06b84489da973c28f996ac4f Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Wed, 21 Mar 2018 07:59:14 -0400 Subject: [PATCH] Fix stripping on Mac --- Makefile | 27 ++++++++++++++------------- plugin.mk | 6 +++++- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index f0171115..c7425ff2 100644 --- a/Makefile +++ b/Makefile @@ -105,10 +105,11 @@ ifeq ($(ARCH), mac) cp -R LICENSE* res $(BUNDLE)/Contents/Resources mkdir -p $(BUNDLE)/Contents/MacOS - cp Rack $(BUNDLE)/Contents/MacOS/ + cp $(TARGET) $(BUNDLE)/Contents/MacOS/ + strip $(BUNDLE)/Contents/MacOS/$(TARGET) cp icon.icns $(BUNDLE)/Contents/Resources/ - otool -L $(BUNDLE)/Contents/MacOS/Rack + otool -L $(BUNDLE)/Contents/MacOS/$(TARGET) cp dep/lib/libGLEW.2.1.0.dylib $(BUNDLE)/Contents/MacOS/ cp dep/lib/libglfw.3.dylib $(BUNDLE)/Contents/MacOS/ @@ -120,17 +121,17 @@ ifeq ($(ARCH), mac) cp dep/lib/librtmidi.4.dylib $(BUNDLE)/Contents/MacOS/ cp dep/lib/libcrypto.1.1.dylib $(BUNDLE)/Contents/MacOS/ - install_name_tool -change /usr/local/lib/libGLEW.2.1.0.dylib @executable_path/libGLEW.2.1.0.dylib $(BUNDLE)/Contents/MacOS/Rack - install_name_tool -change lib/libglfw.3.dylib @executable_path/libglfw.3.dylib $(BUNDLE)/Contents/MacOS/Rack - install_name_tool -change $(PWD)/dep/lib/libjansson.4.dylib @executable_path/libjansson.4.dylib $(BUNDLE)/Contents/MacOS/Rack - install_name_tool -change $(PWD)/dep/lib/libspeexdsp.1.dylib @executable_path/libspeexdsp.1.dylib $(BUNDLE)/Contents/MacOS/Rack - install_name_tool -change $(PWD)/dep/lib/libcurl.4.dylib @executable_path/libcurl.4.dylib $(BUNDLE)/Contents/MacOS/Rack - install_name_tool -change $(PWD)/dep/lib/libzip.5.dylib @executable_path/libzip.5.dylib $(BUNDLE)/Contents/MacOS/Rack - install_name_tool -change librtaudio.dylib @executable_path/librtaudio.dylib $(BUNDLE)/Contents/MacOS/Rack - install_name_tool -change $(PWD)/dep/lib/librtmidi.4.dylib @executable_path/librtmidi.4.dylib $(BUNDLE)/Contents/MacOS/Rack - install_name_tool -change $(PWD)/dep/lib/libcrypto.1.1.dylib @executable_path/libcrypto.1.1.dylib $(BUNDLE)/Contents/MacOS/Rack - - otool -L $(BUNDLE)/Contents/MacOS/Rack + install_name_tool -change /usr/local/lib/libGLEW.2.1.0.dylib @executable_path/libGLEW.2.1.0.dylib $(BUNDLE)/Contents/MacOS/$(TARGET) + install_name_tool -change lib/libglfw.3.dylib @executable_path/libglfw.3.dylib $(BUNDLE)/Contents/MacOS/$(TARGET) + install_name_tool -change $(PWD)/dep/lib/libjansson.4.dylib @executable_path/libjansson.4.dylib $(BUNDLE)/Contents/MacOS/$(TARGET) + install_name_tool -change $(PWD)/dep/lib/libspeexdsp.1.dylib @executable_path/libspeexdsp.1.dylib $(BUNDLE)/Contents/MacOS/$(TARGET) + install_name_tool -change $(PWD)/dep/lib/libcurl.4.dylib @executable_path/libcurl.4.dylib $(BUNDLE)/Contents/MacOS/$(TARGET) + install_name_tool -change $(PWD)/dep/lib/libzip.5.dylib @executable_path/libzip.5.dylib $(BUNDLE)/Contents/MacOS/$(TARGET) + install_name_tool -change librtaudio.dylib @executable_path/librtaudio.dylib $(BUNDLE)/Contents/MacOS/$(TARGET) + install_name_tool -change $(PWD)/dep/lib/librtmidi.4.dylib @executable_path/librtmidi.4.dylib $(BUNDLE)/Contents/MacOS/$(TARGET) + install_name_tool -change $(PWD)/dep/lib/libcrypto.1.1.dylib @executable_path/libcrypto.1.1.dylib $(BUNDLE)/Contents/MacOS/$(TARGET) + + otool -L $(BUNDLE)/Contents/MacOS/$(TARGET) mkdir -p $(BUNDLE)/Contents/Resources/plugins cp -R plugins/Fundamental/dist/Fundamental $(BUNDLE)/Contents/Resources/plugins diff --git a/plugin.mk b/plugin.mk index 0cd005e9..1493c0e9 100644 --- a/plugin.mk +++ b/plugin.mk @@ -41,7 +41,11 @@ dist: all mkdir -p dist/$(SLUG) # Strip and copy plugin binary cp $(TARGET) dist/$(SLUG)/ - strip dist/$(SLUG)/$(TARGET) +ifeq ($(ARCH), mac) + strip -x dist/$(SLUG)/$(TARGET) +else + strip -s dist/$(SLUG)/$(TARGET) +endif # Copy distributables cp -R $(DISTRIBUTABLES) dist/$(SLUG)/ # Create ZIP package