diff --git a/Makefile b/Makefile index 2ff7814f..fb08844d 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,7 @@ ifeq ($(ARCH), mac) -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo \ -Ldep/lib -lGLEW -lglfw -ljansson -lsamplerate -lcurl -lzip -lportaudio -lportmidi TARGET = Rack + BUNDLE = $(TARGET).app endif ifeq ($(ARCH), win) @@ -53,10 +54,70 @@ ifeq ($(ARCH), win) endif clean: - rm -rf $(TARGET) build + rm -rf $(TARGET) build dist # For Windows resources %.res: %.rc windres $^ -O coff -o $@ include compile.mk + + +dist: all +ifndef VERSION + $(error VERSION is not set.) +endif + mkdir -p dist/Rack + mkdir -p dist/Rack/plugins + cp -R LICENSE* res dist/Rack/ +ifeq ($(ARCH), lin) + cp Rack Rack.sh dist/Rack/ + cp dep/lib/libsamplerate.so.0 dist/Rack/ + cp dep/lib/libjansson.so.4 dist/Rack/ + cp dep/lib/libGLEW.so.2.1 dist/Rack/ + cp dep/lib/libglfw.so.3 dist/Rack/ + cp dep/lib/libcurl.so.4 dist/Rack/ + cp dep/lib/libzip.so.5 dist/Rack/ + cp dep/lib/libportaudio.so.2 dist/Rack/ + cp dep/lib/libportmidi.so dist/Rack/ + cp dep/lib/libsamplerate.so.0 dist/Rack/ + cp dep/lib/libsamplerate.so.0 dist/Rack/ +endif +ifeq ($(ARCH), mac) + mkdir -p $(BUNDLE)/Contents + cp Info.plist $(BUNDLE)/Contents/ + + mkdir -p $(BUNDLE)/Contents/MacOS + cp Rack $(BUNDLE)/Contents/MacOS/ + + otool -L $(BUNDLE)/Contents/MacOS/Rack + + # cp /usr/local/opt/glew/lib/libGLEW.2.0.0.dylib $(BUNDLE)/Contents/MacOS/ + # cp /usr/local/opt/jansson/lib/libjansson.4.dylib $(BUNDLE)/Contents/MacOS/ + # cp /usr/local/opt/portaudio/lib/libportaudio.2.dylib $(BUNDLE)/Contents/MacOS/ + # cp /usr/local/opt/portmidi/lib/libportmidi.dylib $(BUNDLE)/Contents/MacOS/ + # cp /usr/local/opt/libsamplerate/lib/libsamplerate.0.dylib $(BUNDLE)/Contents/MacOS/ + # cp /usr/local/opt/libzip/lib/libzip.4.dylib $(BUNDLE)/Contents/MacOS/ + + # install_name_tool -change /usr/local/opt/glew/lib/libGLEW.2.0.0.dylib @executable_path/libGLEW.2.0.0.dylib $(BUNDLE)/Contents/MacOS/Rack + # install_name_tool -change /usr/local/opt/jansson/lib/libjansson.4.dylib @executable_path/libjansson.4.dylib $(BUNDLE)/Contents/MacOS/Rack + # install_name_tool -change /usr/local/opt/portaudio/lib/libportaudio.2.dylib @executable_path/libportaudio.2.dylib $(BUNDLE)/Contents/MacOS/Rack + # install_name_tool -change /usr/local/opt/portmidi/lib/libportmidi.dylib @executable_path/libportmidi.dylib $(BUNDLE)/Contents/MacOS/Rack + # install_name_tool -change /usr/local/opt/libsamplerate/lib/libsamplerate.0.dylib @executable_path/libsamplerate.0.dylib $(BUNDLE)/Contents/MacOS/Rack + # install_name_tool -change /usr/local/opt/libzip/lib/libzip.4.dylib @executable_path/libzip.4.dylib $(BUNDLE)/Contents/MacOS/Rack + + otool -L $(BUNDLE)/Contents/MacOS/Rack + + cp -R Rack.app dist/Rack/ +endif +ifeq ($(ARCH), win) + # TODO Copy dlls + cp Rack/*.dll dist/Rack/ + cp Rack/Rack.exe dist/Rack/ +endif + + # Fundamental + $(MAKE) -C plugins/Fundamental dist + cp -R plugins/Fundamental/dist/Fundamental dist/Rack/plugins/ + + cd dist && zip -5 -r Rack-$(VERSION)-$(ARCH).zip Rack