From bb17953143267b6facf9493c4f794d28815b2056 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Mon, 2 Apr 2018 18:08:09 -0400 Subject: [PATCH] Use generic strip in Makefiles --- Makefile | 7 ++++--- arch.mk | 2 +- plugin.mk | 6 ++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index f561b984..b098602a 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,7 @@ endif include arch.mk +STRIP ?= strip # Sources and build flags @@ -111,7 +112,7 @@ ifeq ($(ARCH), mac) mkdir -p $(BUNDLE)/Contents/MacOS cp $(TARGET) $(BUNDLE)/Contents/MacOS/ - strip -S $(BUNDLE)/Contents/MacOS/$(TARGET) + $(STRIP) -S $(BUNDLE)/Contents/MacOS/$(TARGET) cp icon.icns $(BUNDLE)/Contents/Resources/ otool -L $(BUNDLE)/Contents/MacOS/$(TARGET) @@ -156,7 +157,7 @@ ifeq ($(ARCH), win) cp Bridge/vst/dist/VCV-Bridge-32.dll dist/Rack/Bridge/ cp -R LICENSE* res dist/Rack/ cp $(TARGET) dist/Rack/ - strip -s dist/Rack/$(TARGET) + $(STRIP) -s dist/Rack/$(TARGET) cp /mingw64/bin/libwinpthread-1.dll dist/Rack/ cp /mingw64/bin/zlib1.dll dist/Rack/ cp /mingw64/bin/libstdc++-6.dll dist/Rack/ @@ -182,7 +183,7 @@ ifeq ($(ARCH), lin) mkdir -p dist/Rack cp -R LICENSE* res dist/Rack/ cp $(TARGET) Rack.sh dist/Rack/ - strip -s dist/Rack/$(TARGET) + $(STRIP) -s dist/Rack/$(TARGET) cp dep/lib/libspeexdsp.so dist/Rack/ cp dep/lib/libjansson.so.4 dist/Rack/ cp dep/lib/libGLEW.so.2.1 dist/Rack/ diff --git a/arch.mk b/arch.mk index c9fb5979..06231e16 100644 --- a/arch.mk +++ b/arch.mk @@ -2,7 +2,7 @@ ifndef ARCH -MACHINE = $(shell gcc -dumpmachine) +MACHINE = $(shell $(CC) -dumpmachine) ifneq (, $(findstring linux, $(MACHINE))) # Linux ARCH = lin diff --git a/plugin.mk b/plugin.mk index 8ac3f367..3903c799 100644 --- a/plugin.mk +++ b/plugin.mk @@ -6,6 +6,8 @@ ifndef SLUG $(error SLUG is not defined) endif +STRIP ?= strip + FLAGS += -DSLUG=$(SLUG) FLAGS += -fPIC FLAGS += -I$(RACK_DIR)/include -I$(RACK_DIR)/dep/include @@ -46,9 +48,9 @@ dist: all # Strip and copy plugin binary cp $(TARGET) dist/$(SLUG)/ ifeq ($(ARCH), mac) - strip -S dist/$(SLUG)/$(TARGET) + $(STRIP) -S dist/$(SLUG)/$(TARGET) else - strip -s dist/$(SLUG)/$(TARGET) + $(STRIP) -s dist/$(SLUG)/$(TARGET) endif # Copy distributables cp -R $(DISTRIBUTABLES) dist/$(SLUG)/