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.

66 lines
1.6KB

  1. FLAGS += \
  2. -Iinclude \
  3. -Idep/include -Idep/lib/libzip/include
  4. SOURCES = $(wildcard src/*.cpp src/*/*.cpp) \
  5. ext/nanovg/src/nanovg.c
  6. include arch.mk
  7. ifeq ($(ARCH), lin)
  8. SOURCES += ext/osdialog/osdialog_gtk2.c
  9. CFLAGS += $(shell pkg-config --cflags gtk+-2.0)
  10. LDFLAGS += -rdynamic \
  11. -lpthread -lGL -ldl \
  12. $(shell pkg-config --libs gtk+-2.0) \
  13. -Ldep/lib -lGLEW -lglfw -ljansson -lsamplerate -lcurl -lzip -lportaudio -lportmidi
  14. TARGET = Rack
  15. endif
  16. ifeq ($(ARCH), mac)
  17. SOURCES += ext/osdialog/osdialog_mac.m
  18. CXXFLAGS += -DAPPLE -stdlib=libc++
  19. LDFLAGS += -stdlib=libc++ -lpthread -ldl \
  20. -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo \
  21. -Ldep/lib -lGLEW -lglfw -ljansson -lsamplerate -lcurl -lzip -lportaudio -lportmidi
  22. TARGET = Rack
  23. endif
  24. ifeq ($(ARCH), win)
  25. SOURCES += ext/osdialog/osdialog_win.c
  26. CXXFLAGS += -DGLEW_STATIC \
  27. -I$(HOME)/pkg/portaudio-r1891-build/include -I/mingw64/lib/libzip/include -I$(HOME)/local/include
  28. LDFLAGS += \
  29. -Wl,-Bstatic,--whole-archive \
  30. -ljansson -lsamplerate \
  31. -Wl,-Bdynamic,--no-whole-archive \
  32. -lpthread -lglfw3 -lgdi32 -lglew32 -lopengl32 -lcomdlg32 -lole32 -lzip \
  33. -L $(HOME)/local/lib -lcurl \
  34. -lportmidi \
  35. -L$(HOME)/pkg/portaudio-r1891-build/lib/x64/ReleaseMinDependency -lportaudio_x64 \
  36. -Wl,--export-all-symbols,--out-implib,libRack.a -mwindows
  37. TARGET = Rack.exe
  38. # OBJECTS = Rack.res
  39. endif
  40. all: $(TARGET)
  41. run: $(TARGET)
  42. ifeq ($(ARCH), lin)
  43. LD_LIBRARY_PATH=dep/lib ./$<
  44. endif
  45. ifeq ($(ARCH), mac)
  46. DYLD_FALLBACK_LIBRARY_PATH=dep/lib ./$<
  47. endif
  48. clean:
  49. rm -rf $(TARGET) build
  50. # For Windows resources
  51. %.res: %.rc
  52. windres $^ -O coff -o $@
  53. include compile.mk