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.

87 lines
2.1KB

  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 -lsamplerate \
  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 -lsamplerate
  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 -DGLEW_STATIC \
  38. -I$(HOME)/pkg/portaudio-r1891-build/include
  39. LDFLAGS += \
  40. -Wl,-Bstatic,--whole-archive \
  41. -lglfw3 -lgdi32 -lglew32 -ljansson -lsamplerate \
  42. -Wl,-Bdynamic,--no-whole-archive \
  43. -lpthread -lopengl32 -lcomdlg32 -lole32 \
  44. -lportmidi \
  45. -L$(HOME)/pkg/portaudio-r1891-build/lib/x64/ReleaseMinDependency -lportaudio_x64 \
  46. -Wl,--export-all-symbols,--out-implib,libRack.a -mwindows
  47. TARGET = Rack.exe
  48. endif
  49. all: $(TARGET)
  50. dist: $(TARGET)
  51. # Rack
  52. mkdir -p dist/Rack
  53. cp LICENSE* dist/Rack/
  54. ifeq ($(ARCH), linux)
  55. cp Rack dist/Rack/
  56. endif
  57. ifeq ($(ARCH), apple)
  58. ./bundle.sh
  59. cp -R Rack.app dist/Rack/
  60. endif
  61. ifeq ($(ARCH), windows)
  62. cp Rack.exe dist/Rack/
  63. ./copy_dlls.sh
  64. cp *.dll dist/Rack/
  65. endif
  66. cp -R res dist/Rack/
  67. mkdir -p dist/Rack/plugins
  68. # Fundamental
  69. $(MAKE) -C plugins/Fundamental dist
  70. cp -R plugins/Fundamental/dist/Fundamental dist/Rack/plugins/
  71. # zip
  72. cd dist && zip -5 -r Rack.zip Rack
  73. clean:
  74. rm -rfv build $(TARGET) dist
  75. include Makefile.inc