DISTRHO Nekobi
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.

Makefile.mk 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #!/usr/bin/make -f
  2. # Makefile for DISTRHO Plugins #
  3. # ---------------------------- #
  4. # Created by falkTX
  5. #
  6. # NAME, OBJS_DSP and OBJS_UI have been defined before
  7. include ../../Makefile.mk
  8. # --------------------------------------------------------------
  9. # Basic setup
  10. TARGET_DIR = ../../bin
  11. BUILD_C_FLAGS += -I.
  12. BUILD_CXX_FLAGS += -I. -I../../dpf/distrho -I../../dpf/dgl
  13. # --------------------------------------------------------------
  14. # Enable all possible plugin types
  15. all: dssi lv2 vst
  16. # --------------------------------------------------------------
  17. # Set plugin binary file targets
  18. ladspa_dsp = $(TARGET_DIR)/$(NAME)-ladspa.$(EXT)
  19. dssi_dsp = $(TARGET_DIR)/$(NAME)-dssi.$(EXT)
  20. dssi_ui = $(TARGET_DIR)/$(NAME)-dssi/$(NAME)_ui
  21. lv2_dsp = $(TARGET_DIR)/$(NAME).lv2/$(NAME).$(EXT)
  22. lv2_ui = $(TARGET_DIR)/$(NAME).lv2/$(NAME)_ui.$(EXT)
  23. vst = $(TARGET_DIR)/$(NAME)-vst.$(EXT)
  24. ifeq ($(WIN32),true)
  25. dssi_ui += .exe
  26. endif
  27. # TODO: MacOS VST bundle
  28. # --------------------------------------------------------------
  29. # Set distrho code files
  30. DISTRHO_PLUGIN_FILES = ../../dpf/distrho/DistrhoPluginMain.cpp
  31. DISTRHO_UI_FILES = ../../dpf/distrho/DistrhoUIMain.cpp ../../dpf/libdgl.a
  32. # --------------------------------------------------------------
  33. # Handle plugins without UI
  34. ifeq ($(TARGET_NOUI),true)
  35. dssi_ui =
  36. lv2_ui =
  37. DISTRHO_UI_FILES =
  38. DGL_LIBS =
  39. OBJS_UI =
  40. endif
  41. # --------------------------------------------------------------
  42. # Common
  43. %.c.o: %.c
  44. $(CC) $< $(BUILD_C_FLAGS) -c -o $@
  45. %.cpp.o: %.cpp
  46. $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  47. clean:
  48. rm -f *.o
  49. rm -rf $(TARGET_DIR)/$(NAME)-* $(TARGET_DIR)/$(NAME).lv2/
  50. # --------------------------------------------------------------
  51. # DSSI
  52. dssi: $(dssi_dsp) $(dssi_ui)
  53. $(dssi_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES)
  54. mkdir -p $(shell dirname $@)
  55. $(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -lpthread $(SHARED) -DDISTRHO_PLUGIN_TARGET_DSSI -o $@
  56. $(dssi_ui): $(OBJS_UI) $(DISTRHO_UI_FILES)
  57. mkdir -p $(shell dirname $@)
  58. $(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(shell pkg-config --cflags --libs liblo) -DDISTRHO_PLUGIN_TARGET_DSSI -o $@
  59. # --------------------------------------------------------------
  60. # LV2
  61. lv2: $(lv2_dsp) $(lv2_ui)
  62. $(lv2_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES)
  63. mkdir -p $(shell dirname $@)
  64. $(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -lpthread $(SHARED) -DDISTRHO_PLUGIN_TARGET_LV2 -o $@
  65. $(lv2_ui): $(OBJS_UI) $(DISTRHO_UI_FILES)
  66. mkdir -p $(shell dirname $@)
  67. $(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_LV2 -o $@
  68. # --------------------------------------------------------------
  69. # VST
  70. vst: $(vst)
  71. $(vst): $(OBJS_DSP) $(OBJS_UI) $(DISTRHO_PLUGIN_FILES) $(DISTRHO_UI_FILES)
  72. mkdir -p $(shell dirname $@)
  73. $(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) -lpthread $(SHARED) -DDISTRHO_PLUGIN_TARGET_VST -o $@
  74. # --------------------------------------------------------------