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.

55 lines
1.4KB

  1. ARCH ?= linux
  2. CFLAGS = -MMD -g -Wall -O2
  3. CXXFLAGS = -MMD -g -Wall -std=c++11 -O2 -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 += -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. endif
  29. # Windows
  30. ifeq ($(ARCH), windows)
  31. CC = x86_64-w64-mingw32-gcc
  32. CXX = x86_64-w64-mingw32-g++
  33. SOURCES += lib/noc/noc_file_dialog.c
  34. CFLAGS += -DNOC_FILE_DIALOG_WIN32
  35. CXXFLAGS += -DWINDOWS -D_USE_MATH_DEFINES \
  36. -I$(HOME)/pkg/portaudio-r1891-build/include
  37. LDFLAGS += -lpthread \
  38. -lglfw3 -lgdi32 -lopengl32 -lglew32 \
  39. -lcomdlg32 -lole32 \
  40. -ljansson -lportmidi \
  41. -L$(HOME)/pkg/portaudio-r1891-build/lib/x64/ReleaseMinDependency -lportaudio_x64 \
  42. -Wl,--export-all-symbols,--out-implib,libRack.a -mwindows
  43. TARGET = Rack.exe
  44. endif
  45. all: $(TARGET)
  46. include Makefile.inc