You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.0KB

  1. ARCH ?= linux
  2. CFLAGS = -MMD -g -Wall -O2
  3. CXXFLAGS = -MMD -g -Wall -std=c++11 -O3 -ffast-math -fno-exceptions \
  4. -I./lib -I./include
  5. LDFLAGS =
  6. SOURCES = $(wildcard src/*.cpp src/*/*.cpp) \
  7. lib/nanovg/src/nanovg.c
  8. # Linux
  9. ifeq ($(ARCH), linux)
  10. CC = gcc
  11. CXX = g++
  12. SOURCES += lib/noc/noc_file_dialog.c
  13. CFLAGS += -DNOC_FILE_DIALOG_GTK $(shell pkg-config --cflags gtk+-2.0)
  14. CXXFLAGS += -DLINUX
  15. LDFLAGS += -rdynamic -lpthread -lGL -lGLEW -lglfw -ldl -ljansson -lportaudio -lportmidi \
  16. $(shell pkg-config --libs gtk+-2.0)
  17. TARGET = Rack
  18. endif
  19. # Apple
  20. ifeq ($(ARCH), apple)
  21. CC = clang
  22. CXX = clang++
  23. SOURCES += lib/noc/noc_file_dialog.m
  24. CFLAGS += -DNOC_FILE_DIALOG_OSX
  25. CXXFLAGS += -DAPPLE -stdlib=libc++ -I$(HOME)/local/include
  26. LDFLAGS += -stdlib=libc++ -L$(HOME)/local/lib -lpthread -lglew -lglfw3 -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo -ldl -ljansson -lportaudio -lportmidi
  27. TARGET = Rack
  28. Rack.app: $(TARGET)
  29. ./bundle.sh
  30. endif
  31. # Windows
  32. ifeq ($(ARCH), windows)
  33. CC = x86_64-w64-mingw32-gcc
  34. CXX = x86_64-w64-mingw32-g++
  35. SOURCES += lib/noc/noc_file_dialog.c
  36. CFLAGS += -DNOC_FILE_DIALOG_WIN32
  37. CXXFLAGS += -DWINDOWS -D_USE_MATH_DEFINES \
  38. -I$(HOME)/pkg/portaudio-r1891-build/include
  39. LDFLAGS += -lpthread \
  40. -lglfw3 -lgdi32 -lopengl32 -lglew32 \
  41. -lcomdlg32 -lole32 \
  42. -ljansson -lportmidi \
  43. -L$(HOME)/pkg/portaudio-r1891-build/lib/x64/ReleaseMinDependency -lportaudio_x64 \
  44. -Wl,--export-all-symbols,--out-implib,libRack.a -mwindows
  45. TARGET = Rack.exe
  46. endif
  47. all: $(TARGET)
  48. dist: $(TARGET)
  49. # Rack
  50. mkdir -p dist/Rack
  51. cp LICENSE* dist/Rack/
  52. ifeq ($(ARCH), linux)
  53. cp Rack dist/Rack/
  54. endif
  55. ifeq ($(ARCH), apple)
  56. ./bundle.sh
  57. cp -R Rack.app dist/Rack/
  58. endif
  59. ifeq ($(ARCH), windows)
  60. cp Rack.exe dist/Rack/
  61. ./copy_dlls.sh
  62. cp *.dll dist/Rack/
  63. endif
  64. cp -R res dist/Rack/
  65. mkdir -p dist/Rack/plugins
  66. # Fundamental
  67. $(MAKE) -C plugins/Fundamental dist
  68. cp -R plugins/Fundamental/dist/Fundamental dist/Rack/plugins/
  69. # zip
  70. cd dist && zip -5 -r Rack.zip Rack
  71. clean:
  72. rm -rfv build $(TARGET) dist
  73. include Makefile.inc