| @@ -29,17 +29,10 @@ endif | |||||
| ifeq ($(ARCH), win) | ifeq ($(ARCH), win) | ||||
| SOURCES += ext/osdialog/osdialog_win.c | SOURCES += ext/osdialog/osdialog_win.c | ||||
| CXXFLAGS += -DGLEW_STATIC \ | |||||
| -I$(HOME)/pkg/portaudio-r1891-build/include -I/mingw64/lib/libzip/include -I$(HOME)/local/include | |||||
| LDFLAGS += \ | |||||
| -Wl,-Bstatic,--whole-archive \ | |||||
| -ljansson -lsamplerate \ | |||||
| -Wl,-Bdynamic,--no-whole-archive \ | |||||
| -lpthread -lglfw3 -lgdi32 -lglew32 -lopengl32 -lcomdlg32 -lole32 -lzip \ | |||||
| -L $(HOME)/local/lib -lcurl \ | |||||
| -lportmidi \ | |||||
| -L$(HOME)/pkg/portaudio-r1891-build/lib/x64/ReleaseMinDependency -lportaudio_x64 \ | |||||
| -Wl,--export-all-symbols,--out-implib,libRack.a -mwindows | |||||
| LDFLAGS += -static-libgcc -static-libstdc++ -lpthread \ | |||||
| -Wl,--export-all-symbols,--out-implib,libRack.a -mwindows \ | |||||
| -lgdi32 -lopengl32 -lcomdlg32 -lole32 \ | |||||
| -Ldep/lib -lglew32 -lglfw3dll -ljansson -lsamplerate -lcurl -lzip -lportaudio -lportmidi | |||||
| TARGET = Rack.exe | TARGET = Rack.exe | ||||
| # OBJECTS = Rack.res | # OBJECTS = Rack.res | ||||
| endif | endif | ||||
| @@ -54,6 +47,10 @@ endif | |||||
| ifeq ($(ARCH), mac) | ifeq ($(ARCH), mac) | ||||
| DYLD_FALLBACK_LIBRARY_PATH=dep/lib ./$< | DYLD_FALLBACK_LIBRARY_PATH=dep/lib ./$< | ||||
| endif | endif | ||||
| ifeq ($(ARCH), win) | |||||
| # TODO get rid of the mingw64 path | |||||
| env PATH=dep/bin:/mingw64/bin ./$< | |||||
| endif | |||||
| clean: | clean: | ||||
| rm -rf $(TARGET) build | rm -rf $(TARGET) build | ||||
| @@ -20,7 +20,8 @@ ifeq ($(ARCH), mac) | |||||
| endif | endif | ||||
| ifeq ($(ARCH), win) | ifeq ($(ARCH), win) | ||||
| FLAGS += -DARCH_WIN -D_USE_MATH_DEFINES | |||||
| FLAGS += -DARCH_WIN | |||||
| FLAGS += -D_USE_MATH_DEFINES | |||||
| endif | endif | ||||
| @@ -16,9 +16,9 @@ WGET = wget -nc | |||||
| UNTAR = tar xf | UNTAR = tar xf | ||||
| UNZIP = unzip | UNZIP = unzip | ||||
| ifeq ($(ARCH),win) | ifeq ($(ARCH),win) | ||||
| CMAKE = cmake -G 'MSYS Makefiles' | |||||
| CMAKE = cmake -G 'MSYS Makefiles' | |||||
| else | else | ||||
| CMAKE = cmake | |||||
| CMAKE = cmake | |||||
| endif | endif | ||||
| # Packages | # Packages | ||||
| @@ -30,6 +30,7 @@ libcurl = curl-7.54.1 | |||||
| libzip = libzip-1.2.0 | libzip = libzip-1.2.0 | ||||
| portmidi = portmidi | portmidi = portmidi | ||||
| portaudio = portaudio | portaudio = portaudio | ||||
| asio = asiosdk2.3 | |||||
| .NOTPARALLEL: | .NOTPARALLEL: | ||||
| @@ -51,6 +52,10 @@ $(glfw): | |||||
| -DGLFW_USE_CHDIR=ON -DGLFW_USE_MENUBAR=ON -DGLFW_USE_RETINA=ON | -DGLFW_USE_CHDIR=ON -DGLFW_USE_MENUBAR=ON -DGLFW_USE_RETINA=ON | ||||
| $(MAKE) -C $@ | $(MAKE) -C $@ | ||||
| $(MAKE) -C $@ install | $(MAKE) -C $@ install | ||||
| ifeq ($(ARCH),win) | |||||
| # Not sure why the GLFW build system puts a .dll in the lib directory | |||||
| mv "$(LOCAL)/lib/glfw3.dll" "$(LOCAL)/bin/" | |||||
| endif | |||||
| $(jansson): | $(jansson): | ||||
| $(WGET) http://www.digip.org/jansson/releases/$@.tar.gz | $(WGET) http://www.digip.org/jansson/releases/$@.tar.gz | ||||
| @@ -84,15 +89,23 @@ $(libzip): | |||||
| $(portmidi): | $(portmidi): | ||||
| git clone https://github.com/AndrewBelt/portmidi.git $@ | git clone https://github.com/AndrewBelt/portmidi.git $@ | ||||
| # TODO Fix on Windows | |||||
| cd $@ && $(CMAKE) . -DCMAKE_INSTALL_PREFIX="$(LOCAL)" | cd $@ && $(CMAKE) . -DCMAKE_INSTALL_PREFIX="$(LOCAL)" | ||||
| $(MAKE) -C $@ | $(MAKE) -C $@ | ||||
| $(MAKE) -C $@ install | $(MAKE) -C $@ install | ||||
| $(portaudio): | |||||
| $(asio): | |||||
| echo "For ASIO support, download and move the ASIO SDK to $@" | |||||
| exit 1 | |||||
| ifeq ($(ARCH),win) | |||||
| PORTAUDIO_DEPS = $(asio) | |||||
| PORTAUDIO_ASIO = --with-host_os=mingw --with-winapi=wmme,asio --with-asiodir="../$(asio)" | |||||
| endif | |||||
| $(portaudio): $(PORTAUDIO_DEPS) | |||||
| $(WGET) http://www.portaudio.com/archives/pa_stable_v190600_20161030.tgz | $(WGET) http://www.portaudio.com/archives/pa_stable_v190600_20161030.tgz | ||||
| $(UNTAR) pa_stable_v190600_20161030.tgz | $(UNTAR) pa_stable_v190600_20161030.tgz | ||||
| cd $@ && ./configure --prefix="$(LOCAL)" | |||||
| cd $@ && ./configure --prefix="$(LOCAL)" $(PORTAUDIO_ASIO) | |||||
| $(MAKE) -C $@ | $(MAKE) -C $@ | ||||
| $(MAKE) -C $@ install | $(MAKE) -C $@ install | ||||
| @@ -163,6 +163,10 @@ void keyCallback(GLFWwindow* window, int key, int scancode, int action, int mods | |||||
| } | } | ||||
| } | } | ||||
| void errorCallback(int error, const char *description) { | |||||
| fprintf(stderr, "GLFW error %d: %s\n", error, description); | |||||
| } | |||||
| void renderGui() { | void renderGui() { | ||||
| int width, height; | int width, height; | ||||
| glfwGetFramebufferSize(window, &width, &height); | glfwGetFramebufferSize(window, &width, &height); | ||||
| @@ -191,6 +195,7 @@ void guiInit() { | |||||
| int err; | int err; | ||||
| // Set up GLFW | // Set up GLFW | ||||
| glfwSetErrorCallback(errorCallback); | |||||
| err = glfwInit(); | err = glfwInit(); | ||||
| assert(err); | assert(err); | ||||
| @@ -17,8 +17,9 @@ | |||||
| #include <shellapi.h> | #include <shellapi.h> | ||||
| #include <direct.h> | #include <direct.h> | ||||
| #define mkdir(_dir, _perms) _mkdir(_dir) | #define mkdir(_dir, _perms) _mkdir(_dir) | ||||
| #else | |||||
| #include <dlfcn.h> | |||||
| #endif | #endif | ||||
| #include <dlfcn.h> | |||||
| #include <dirent.h> | #include <dirent.h> | ||||
| #include "plugin.hpp" | #include "plugin.hpp" | ||||