Rework makefiles to make build-deps optional

This commit is contained in:
falkTX 2015-02-21 13:12:48 +00:00
parent 380e004bba
commit a38e818998
5 changed files with 65 additions and 24 deletions

View File

@ -4,12 +4,16 @@
# Created by falkTX # Created by falkTX
# #
include Makefile.mk
all: libs plugins gen all: libs plugins gen
# -------------------------------------------------------------- # --------------------------------------------------------------
libs: libs:
ifeq ($(HAVE_DGL),true)
$(MAKE) -C dpf/dgl $(MAKE) -C dpf/dgl
endif
plugins: libs plugins: libs
$(MAKE) all -C plugins/Nekobi $(MAKE) all -C plugins/Nekobi
@ -26,7 +30,9 @@ dpf/utils/lv2_ttl_generator:
# -------------------------------------------------------------- # --------------------------------------------------------------
clean: clean:
ifeq ($(HAVE_DGL),true)
$(MAKE) clean -C dpf/dgl $(MAKE) clean -C dpf/dgl
endif
$(MAKE) clean -C dpf/utils/lv2-ttl-generator $(MAKE) clean -C dpf/utils/lv2-ttl-generator
$(MAKE) clean -C plugins/Nekobi $(MAKE) clean -C plugins/Nekobi

View File

@ -75,27 +75,27 @@ LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS)
endif endif
# -------------------------------------------------------------- # --------------------------------------------------------------
# Check for required libs # Check for optional libs
ifeq ($(LINUX),true) ifeq ($(LINUX),true)
ifneq ($(shell pkg-config --exists jack && echo true),true) # HAVE_DGL = $(shell pkg-config --exists gl x11 && echo true)
$(error JACK missing, cannot continue) HAVE_JACK = $(shell pkg-config --exists jack && echo true)
endif HAVE_LIBLO = $(shell pkg-config --exists liblo && echo true)
ifneq ($(shell pkg-config --exists gl && echo true),true)
$(error OpenGL missing, cannot continue)
endif
ifneq ($(shell pkg-config --exists x11 && echo true),true)
$(error X11 missing, cannot continue)
endif
endif endif
ifneq ($(shell pkg-config --exists liblo && echo true),true) ifeq ($(MACOS),true)
$(error liblo missing, cannot continue) HAVE_DGL = true
endif
ifeq ($(WIN32),true)
HAVE_DGL = true
endif endif
# -------------------------------------------------------------- # --------------------------------------------------------------
# Set libs stuff # Set libs stuff
ifeq ($(HAVE_DGL),true)
ifeq ($(LINUX),true) ifeq ($(LINUX),true)
DGL_FLAGS = $(shell pkg-config --cflags gl x11) DGL_FLAGS = $(shell pkg-config --cflags gl x11)
DGL_LIBS = $(shell pkg-config --libs gl x11) DGL_LIBS = $(shell pkg-config --libs gl x11)
@ -109,6 +109,8 @@ ifeq ($(WIN32),true)
DGL_LIBS = -lopengl32 -lgdi32 DGL_LIBS = -lopengl32 -lgdi32
endif endif
endif # HAVE_DGL
# -------------------------------------------------------------- # --------------------------------------------------------------
# Set extension # Set extension

2
dpf

@ -1 +1 @@
Subproject commit 7169815782a5d14447e16a1ac3adf3ab32d7d92b Subproject commit 17befcdaa6d5e281aea22c5d83e3326f6ee9373c

View File

@ -16,6 +16,18 @@ TARGET_DIR = ../../bin
BUILD_C_FLAGS += -I. BUILD_C_FLAGS += -I.
BUILD_CXX_FLAGS += -I. -I../../dpf/distrho -I../../dpf/dgl BUILD_CXX_FLAGS += -I. -I../../dpf/distrho -I../../dpf/dgl
ifeq ($(HAVE_DGL),true)
BASE_FLAGS += -DHAVE_DGL
endif
ifeq ($(HAVE_JACK),true)
BASE_FLAGS += -DHAVE_JACK
endif
ifeq ($(HAVE_LIBLO),true)
BASE_FLAGS += -DHAVE_LIBLO
endif
# -------------------------------------------------------------- # --------------------------------------------------------------
# Set plugin binary file targets # Set plugin binary file targets
@ -28,17 +40,16 @@ lv2_dsp = $(TARGET_DIR)/$(NAME).lv2/$(NAME)_dsp.$(EXT)
lv2_ui = $(TARGET_DIR)/$(NAME).lv2/$(NAME)_ui.$(EXT) lv2_ui = $(TARGET_DIR)/$(NAME).lv2/$(NAME)_ui.$(EXT)
vst = $(TARGET_DIR)/$(NAME)-vst.$(EXT) vst = $(TARGET_DIR)/$(NAME)-vst.$(EXT)
ifeq ($(WIN32),true)
dssi_ui += .exe
endif
# TODO: MacOS VST bundle
# -------------------------------------------------------------- # --------------------------------------------------------------
# Set distrho code files # Set distrho code files
DISTRHO_PLUGIN_FILES = ../../dpf/distrho/DistrhoPluginMain.cpp DISTRHO_PLUGIN_FILES = ../../dpf/distrho/DistrhoPluginMain.cpp
ifeq ($(HAVE_DGL),true)
DISTRHO_UI_FILES = ../../dpf/distrho/DistrhoUIMain.cpp ../../dpf/libdgl.a DISTRHO_UI_FILES = ../../dpf/distrho/DistrhoUIMain.cpp ../../dpf/libdgl.a
else
TARGET_NOUI = true
endif
# -------------------------------------------------------------- # --------------------------------------------------------------
# Handle plugins without UI # Handle plugins without UI
@ -91,6 +102,8 @@ $(ladspa_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES)
# DSSI # DSSI
dssi: $(dssi_dsp) $(dssi_ui) dssi: $(dssi_dsp) $(dssi_ui)
dssi_dsp: $(dssi_dsp)
dssi_ui: $(dssi_ui)
$(dssi_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES) $(dssi_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES)
mkdir -p $(shell dirname $@) mkdir -p $(shell dirname $@)
@ -104,6 +117,7 @@ $(dssi_ui): $(OBJS_UI) $(DISTRHO_UI_FILES)
# LV2 # LV2
lv2_one: $(lv2) lv2_one: $(lv2)
lv2_dsp: $(lv2_dsp)
lv2_sep: $(lv2_dsp) $(lv2_ui) lv2_sep: $(lv2_dsp) $(lv2_ui)
$(lv2): $(OBJS_DSP) $(OBJS_UI) $(DISTRHO_PLUGIN_FILES) $(DISTRHO_UI_FILES) $(lv2): $(OBJS_DSP) $(OBJS_UI) $(DISTRHO_PLUGIN_FILES) $(DISTRHO_UI_FILES)

View File

@ -27,10 +27,29 @@ include ../Makefile.mk
# -------------------------------------------------------------- # --------------------------------------------------------------
# Enable all possible plugin types # Enable all possible plugin types
ifeq ($(LINUX),true) ifeq ($(HAVE_DGL),true)
all: jack dssi lv2_sep vst ifeq ($(HAVE_JACK),true)
else TARGETS += jack
all: dssi lv2_sep vst endif
endif endif
ifeq ($(LINUX),true)
TARGETS += dssi_dsp
ifeq ($(HAVE_DGL),true)
ifeq ($(HAVE_LIBLO),true)
TARGETS += dssi_ui
endif
endif
endif
ifeq ($(HAVE_DGL),true)
TARGETS += lv2_sep
else
TARGETS += lv2_dsp
endif
TARGETS += vst
all: $(TARGETS)
# -------------------------------------------------------------- # --------------------------------------------------------------