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.

61 lines
1.7KB

  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. endif
  30. # Windows
  31. ifeq ($(ARCH), windows)
  32. CC = x86_64-w64-mingw32-gcc
  33. CXX = x86_64-w64-mingw32-g++
  34. SOURCES += ext/noc/noc_file_dialog.c
  35. CFLAGS += -DNOC_FILE_DIALOG_WIN32
  36. CXXFLAGS += -DWINDOWS -D_USE_MATH_DEFINES -DGLEW_STATIC \
  37. -I$(HOME)/pkg/portaudio-r1891-build/include
  38. LDFLAGS += \
  39. -Wl,-Bstatic,--whole-archive \
  40. -lglfw3 -lgdi32 -lglew32 -ljansson -lsamplerate \
  41. -Wl,-Bdynamic,--no-whole-archive \
  42. -lpthread -lopengl32 -lcomdlg32 -lole32 \
  43. -lportmidi \
  44. -L$(HOME)/pkg/portaudio-r1891-build/lib/x64/ReleaseMinDependency -lportaudio_x64 \
  45. -Wl,--export-all-symbols,--out-implib,libRack.a -mwindows
  46. TARGET = Rack.exe
  47. OBJECTS = Rack.res
  48. all: $(TARGET)
  49. %.res: %.rc
  50. windres $^ -O coff -o $@
  51. endif
  52. include Makefile.inc