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.

92 lines
2.2KB

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