@@ -18,7 +18,7 @@ STRIP ?= strip | |||
SOURCES += dep/nanovg/src/nanovg.c | |||
SOURCES += $(wildcard src/*.cpp src/*/*.cpp) | |||
ifeq ($(ARCH), mac) | |||
ifdef ARCH_MAC | |||
SOURCES += dep/osdialog/osdialog_mac.m | |||
CXXFLAGS += -stdlib=libc++ | |||
LDFLAGS += -stdlib=libc++ -lpthread -ldl \ | |||
@@ -28,7 +28,7 @@ ifeq ($(ARCH), mac) | |||
BUNDLE := dist/$(TARGET).app | |||
endif | |||
ifeq ($(ARCH), win) | |||
ifdef ARCH_WIN | |||
SOURCES += dep/osdialog/osdialog_win.c | |||
LDFLAGS += -static \ | |||
-Wl,--export-all-symbols,--out-implib,libRack.a -mwindows \ | |||
@@ -38,7 +38,7 @@ ifeq ($(ARCH), win) | |||
OBJECTS += Rack.res | |||
endif | |||
ifeq ($(ARCH), lin) | |||
ifdef ARCH_LIN | |||
SOURCES += dep/osdialog/osdialog_gtk2.c | |||
CFLAGS += $(shell pkg-config --cflags gtk+-2.0) | |||
LDFLAGS += -rdynamic \ | |||
@@ -61,25 +61,25 @@ run: $(TARGET) | |||
./$< | |||
debug: $(TARGET) | |||
ifeq ($(ARCH), mac) | |||
ifdef ARCH_MAC | |||
lldb -ex run ./$< | |||
endif | |||
ifeq ($(ARCH), win) | |||
ifdef ARCH_WIN | |||
gdb -ex run ./$< | |||
endif | |||
ifeq ($(ARCH), lin) | |||
ifdef ARCH_LIN | |||
gdb -ex run ./$< | |||
endif | |||
perf: $(TARGET) | |||
ifeq ($(ARCH), lin) | |||
ifdef ARCH_LIN | |||
perf record --call-graph dwarf ./Rack | |||
endif | |||
clean: | |||
rm -rfv $(TARGET) libRack.a Rack.res build dist | |||
ifeq ($(ARCH), win) | |||
ifdef ARCH_WIN | |||
# For Windows resources | |||
%.res: %.rc | |||
windres $^ -O coff -o $@ | |||
@@ -95,7 +95,7 @@ endif | |||
# Rack distribution | |||
$(MAKE) -C plugins/Fundamental dist | |||
ifeq ($(ARCH), mac) | |||
ifdef ARCH_MAC | |||
mkdir -p $(BUNDLE) | |||
mkdir -p $(BUNDLE)/Contents | |||
mkdir -p $(BUNDLE)/Contents/Resources | |||
@@ -117,7 +117,7 @@ ifeq ($(ARCH), mac) | |||
cd dist && ln -s /Library/Audio/Plug-Ins/VST VST | |||
cd dist && hdiutil create -srcfolder . -volname Rack -ov -format UDZO Rack-$(VERSION)-$(ARCH).dmg | |||
endif | |||
ifeq ($(ARCH), win) | |||
ifdef ARCH_WIN | |||
mkdir -p dist/Rack | |||
mkdir -p dist/Rack/Bridge | |||
cp Bridge/vst/dist/VCV-Bridge-64.dll dist/Rack/Bridge/ | |||
@@ -135,7 +135,7 @@ ifeq ($(ARCH), win) | |||
makensis installer.nsi | |||
mv Rack-setup.exe dist/Rack-$(VERSION)-$(ARCH).exe | |||
endif | |||
ifeq ($(ARCH), lin) | |||
ifdef ARCH_LIN | |||
mkdir -p dist/Rack | |||
cp -R LICENSE* res dist/Rack/ | |||
cp $(TARGET) dist/Rack/ | |||
@@ -153,7 +153,7 @@ endif | |||
cp -R include dist/Rack-SDK/ | |||
mkdir -p dist/Rack-SDK/dep/ | |||
cp -R dep/include dist/Rack-SDK/dep/ | |||
ifeq ($(ARCH), win) | |||
ifdef ARCH_WIN | |||
cp libRack.a dist/Rack-SDK/ | |||
endif | |||
cd dist && zip -5 -r Rack-SDK-$(VERSION).zip Rack-SDK | |||
@@ -162,14 +162,14 @@ endif | |||
# Obviously this will only work if you have the private keys to my server | |||
UPLOAD_URL := vortico@vcvrack.com:files/ | |||
upload: | |||
ifeq ($(ARCH), mac) | |||
ifdef ARCH_MAC | |||
rsync dist/*.dmg $(UPLOAD_URL) -zP | |||
endif | |||
ifeq ($(ARCH), win) | |||
ifdef ARCH_WIN | |||
rsync dist/*.exe $(UPLOAD_URL) -P | |||
rsync dist/*.zip $(UPLOAD_URL) -P | |||
endif | |||
ifeq ($(ARCH), lin) | |||
ifdef ARCH_LIN | |||
rsync dist/*.zip $(UPLOAD_URL) -zP | |||
endif | |||
rsync plugins/*/dist/*.zip $(UPLOAD_URL) -zP | |||
@@ -1,24 +1,20 @@ | |||
# Detect architecture if ARCH is not defined | |||
ifndef ARCH | |||
MACHINE = $(shell $(CC) -dumpmachine) | |||
ifneq (, $(findstring linux, $(MACHINE))) | |||
# Linux | |||
ARCH = lin | |||
else ifneq (, $(findstring apple, $(MACHINE))) | |||
# Mac | |||
ARCH = mac | |||
ifneq (, $(findstring apple, $(MACHINE))) | |||
ARCH_MAC := 1 | |||
ARCH := mac | |||
else ifneq (, $(findstring mingw, $(MACHINE))) | |||
# Windows | |||
ARCH = win | |||
ifneq ( ,$(findstring x86_64, $(MACHINE))) | |||
BITS = 64 | |||
else ifneq (, $(findstring i686, $(MACHINE))) | |||
BITS = 32 | |||
endif | |||
ARCH_WIN := 1 | |||
ARCH := win | |||
ifneq ( ,$(findstring x86_64, $(MACHINE))) | |||
ARCH_WIN_64 := 1 | |||
BITS := 64 | |||
else ifneq (, $(findstring i686, $(MACHINE))) | |||
ARCH_WIN_32 := 1 | |||
BITS := 32 | |||
endif | |||
else ifneq (, $(findstring linux, $(MACHINE))) | |||
ARCH_LIN := 1 | |||
ARCH := lin | |||
else | |||
$(error Could not determine machine type. Try hacking around in arch.mk) | |||
$(error Could not determine architecture. Try hacking around in arch.mk) | |||
endif | |||
endif |
@@ -22,10 +22,10 @@ endif | |||
CXXFLAGS += -std=c++11 | |||
ifeq ($(ARCH), lin) | |||
ifdef ARCH_LIN | |||
FLAGS += -DARCH_LIN | |||
endif | |||
ifeq ($(ARCH), mac) | |||
ifdef ARCH_MAC | |||
FLAGS += -DARCH_MAC | |||
CXXFLAGS += -stdlib=libc++ | |||
LDFLAGS += -stdlib=libc++ | |||
@@ -33,7 +33,7 @@ ifeq ($(ARCH), mac) | |||
FLAGS += $(MAC_SDK_FLAGS) | |||
LDFLAGS += $(MAC_SDK_FLAGS) | |||
endif | |||
ifeq ($(ARCH), win) | |||
ifdef ARCH_WIN | |||
FLAGS += -DARCH_WIN | |||
FLAGS += -D_USE_MATH_DEFINES | |||
endif | |||
@@ -6,7 +6,7 @@ RACK_DIR ?= .. | |||
include $(RACK_DIR)/arch.mk | |||
ifeq ($(ARCH), lin) | |||
ifdef ARCH_LIN | |||
glew = lib/libGLEW.a | |||
glfw = lib/libglfw3.a | |||
jansson = lib/libjansson.a | |||
@@ -19,7 +19,7 @@ ifeq ($(ARCH), lin) | |||
openssl = lib/libssl.a | |||
endif | |||
ifeq ($(ARCH), mac) | |||
ifdef ARCH_MAC | |||
glew = lib/libGLEW.a | |||
glfw = lib/libglfw3.a | |||
jansson = lib/libjansson.a | |||
@@ -32,7 +32,7 @@ ifeq ($(ARCH), mac) | |||
openssl = lib/libssl.a | |||
endif | |||
ifeq ($(ARCH), win) | |||
ifdef ARCH_WIN | |||
glew = lib/libglew32.a | |||
glfw = lib/libglfw3.a | |||
jansson = lib/libjansson.a | |||
@@ -112,7 +112,7 @@ $(libzip): $(zlib) | |||
$(zlib): | |||
$(WGET) "https://www.zlib.net/zlib-1.2.11.tar.gz" | |||
$(UNTAR) zlib-1.2.11.tar.gz | |||
ifeq ($(ARCH), win) | |||
ifdef ARCH_WIN | |||
$(MAKE) -C zlib-1.2.11 -f win32/Makefile.gcc | |||
$(MAKE) -C zlib-1.2.11 -f win32/Makefile.gcc BINARY_PATH="$(realpath $(DEP_LOCAL))/bin" INCLUDE_PATH="$(realpath $(DEP_LOCAL))/include" LIBRARY_PATH="$(realpath $(DEP_LOCAL))/lib" install | |||
else | |||
@@ -128,21 +128,21 @@ $(rtmidi): | |||
$(MAKE) -C rtmidi | |||
$(MAKE) -C rtmidi install | |||
ifeq ($(ARCH), mac) | |||
ifdef ARCH_MAC | |||
RTAUDIO_FLAGS += -DAUDIO_OSX_CORE=ON | |||
endif | |||
ifeq ($(ARCH), win) | |||
ifdef ARCH_WIN | |||
RTAUDIO_FLAGS += -DAUDIO_WINDOWS_DS=ON -DAUDIO_WINDOWS_WASAPI=ON -DAUDIO_WINDOWS_ASIO=ON | |||
endif | |||
ifeq ($(ARCH), lin) | |||
ifdef ARCH_LIN | |||
RTAUDIO_FLAGS += -DAUDIO_LINUX_ALSA=ON -DAUDIO_UNIX_JACK=ON | |||
endif | |||
ifdef RTAUDIO_ALL_APIS | |||
ifeq ($(ARCH), mac) | |||
ifdef ARCH_MAC | |||
RTAUDIO_FLAGS += -DAUDIO_UNIX_JACK=ON | |||
endif | |||
ifeq ($(ARCH), lin) | |||
ifdef ARCH_LIN | |||
RTAUDIO_FLAGS += -DAUDIO_LINUX_PULSE=ON | |||
endif | |||
endif | |||
@@ -15,19 +15,19 @@ FLAGS += -I$(RACK_DIR)/include -I$(RACK_DIR)/dep/include | |||
include $(RACK_DIR)/arch.mk | |||
ifeq ($(ARCH), lin) | |||
ifdef ARCH_LIN | |||
LDFLAGS += -shared | |||
TARGET := plugin.so | |||
RACK_USER_DIR ?= $(HOME)/.Rack | |||
endif | |||
ifeq ($(ARCH), mac) | |||
ifdef ARCH_MAC | |||
LDFLAGS += -shared -undefined dynamic_lookup | |||
TARGET := plugin.dylib | |||
RACK_USER_DIR ?= $(HOME)/Documents/Rack | |||
endif | |||
ifeq ($(ARCH), win) | |||
ifdef ARCH_WIN | |||
LDFLAGS += -shared -L$(RACK_DIR) -lRack | |||
TARGET := plugin.dll | |||
RACK_USER_DIR ?= $(USERPROFILE)/Documents/Rack | |||
@@ -50,7 +50,7 @@ dist: all | |||
mkdir -p dist/$(SLUG) | |||
# Strip and copy plugin binary | |||
cp $(TARGET) dist/$(SLUG)/ | |||
ifeq ($(ARCH), mac) | |||
ifdef ARCH_MAC | |||
$(STRIP) -S dist/$(SLUG)/$(TARGET) | |||
else | |||
$(STRIP) -s dist/$(SLUG)/$(TARGET) | |||