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.

64 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 gl glew glfw3 jansson libzip portaudio-2.0 samplerate)
  10. CXXFLAGS += $(shell pkg-config --cflags gl glew glfw3 jansson libzip portaudio-2.0 samplerate)
  11. LDFLAGS += -rdynamic \
  12. -lpthread -ldl \
  13. $(shell pkg-config --libs gtk+-2.0 gl glew glfw3 jansson libzip portaudio-2.0 samplerate) \
  14. -Ldep/lib -lcurl -lportmidi
  15. TARGET = Rack
  16. endif
  17. ifeq ($(ARCH), mac)
  18. SOURCES += ext/osdialog/osdialog_mac.m
  19. CXXFLAGS += -DAPPLE -stdlib=libc++
  20. LDFLAGS += -stdlib=libc++ -lpthread -ldl \
  21. -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo \
  22. -Ldep/lib -lGLEW -lglfw -ljansson -lsamplerate -lcurl -lzip -lportaudio -lportmidi
  23. TARGET = Rack
  24. endif
  25. ifeq ($(ARCH), win)
  26. SOURCES += ext/osdialog/osdialog_win.c
  27. LDFLAGS += -static-libgcc -static-libstdc++ -lpthread \
  28. -Wl,--export-all-symbols,--out-implib,libRack.a -mwindows \
  29. -lgdi32 -lopengl32 -lcomdlg32 -lole32 \
  30. -Ldep/lib -lglew32 -lglfw3dll -ljansson -lsamplerate -lcurl -lzip -lportaudio -lportmidi
  31. TARGET = Rack.exe
  32. # OBJECTS = Rack.res
  33. endif
  34. all: $(TARGET)
  35. run: $(TARGET)
  36. ifeq ($(ARCH), lin)
  37. LD_LIBRARY_PATH=dep/lib ./$<
  38. endif
  39. ifeq ($(ARCH), mac)
  40. DYLD_FALLBACK_LIBRARY_PATH=dep/lib ./$<
  41. endif
  42. ifeq ($(ARCH), win)
  43. # TODO get rid of the mingw64 path
  44. env PATH=dep/bin:/mingw64/bin ./$<
  45. endif
  46. clean:
  47. rm -rf $(TARGET) build
  48. # For Windows resources
  49. %.res: %.rc
  50. windres $^ -O coff -o $@
  51. include compile.mk