Browse Source

Use DPF for the makefile magic

master
falkTX 3 years ago
parent
commit
6ccf1745dc
14 changed files with 42 additions and 344 deletions
  1. +2
    -5
      .gitignore
  2. +9
    -6
      Makefile
  3. +0
    -147
      Makefile.mk
  4. +0
    -3
      bin/README
  5. +1
    -1
      dpf
  6. +3
    -3
      plugins/Info/InfoExamplePlugin.cpp
  7. +5
    -5
      plugins/Info/Makefile
  8. +3
    -3
      plugins/Latency/Makefile
  9. +0
    -153
      plugins/Makefile.mk
  10. +1
    -0
      plugins/Makefile.mk
  11. +5
    -5
      plugins/Meters/Makefile
  12. +3
    -3
      plugins/MidiThrough/Makefile
  13. +5
    -5
      plugins/Parameters/Makefile
  14. +5
    -5
      plugins/States/Makefile

+ 2
- 5
.gitignore View File

@@ -12,8 +12,5 @@
.kdev4/
.DS_Store

bin/*-dssi/
bin/*.lv2/
bin/d_*
bin/ducka
bin/roomy
bin/
build/

+ 9
- 6
Makefile View File

@@ -4,18 +4,18 @@
# Created by falkTX
#

include Makefile.mk
include dpf/Makefile.base.mk

all: libs plugins gen
all: dgl plugins gen

# --------------------------------------------------------------

libs:
dgl:
ifeq ($(HAVE_DGL),true)
$(MAKE) -C dpf/dgl
endif

plugins: libs
plugins: dgl
$(MAKE) all -C plugins/Info
$(MAKE) all -C plugins/Latency
$(MAKE) all -C plugins/Meters
@@ -23,6 +23,7 @@ plugins: libs
$(MAKE) all -C plugins/Parameters
$(MAKE) all -C plugins/States

ifneq ($(CROSS_COMPILING),true)
gen: plugins dpf/utils/lv2_ttl_generator
@$(CURDIR)/dpf/utils/generate-ttl.sh
ifeq ($(MACOS),true)
@@ -31,13 +32,14 @@ endif

dpf/utils/lv2_ttl_generator:
$(MAKE) -C dpf/utils/lv2-ttl-generator
else
gen:
endif

# --------------------------------------------------------------

clean:
ifeq ($(HAVE_DGL),true)
$(MAKE) clean -C dpf/dgl
endif
$(MAKE) clean -C dpf/utils/lv2-ttl-generator
$(MAKE) clean -C plugins/Info
$(MAKE) clean -C plugins/Latency
@@ -45,6 +47,7 @@ endif
$(MAKE) clean -C plugins/MidiThrough
$(MAKE) clean -C plugins/Parameters
$(MAKE) clean -C plugins/States
rm -rf bin build

# --------------------------------------------------------------



+ 0
- 147
Makefile.mk View File

@@ -1,147 +0,0 @@
#!/usr/bin/make -f
# Makefile for DISTRHO Plugins #
# ---------------------------- #
# Created by falkTX
#

AR ?= ar
CC ?= gcc
CXX ?= g++

# --------------------------------------------------------------
# Fallback to Linux if no other OS defined

ifneq ($(HAIKU),true)
ifneq ($(MACOS),true)
ifneq ($(WIN32),true)
LINUX=true
endif
endif
endif

# --------------------------------------------------------------
# Set build and link flags

BASE_FLAGS = -Wall -Wextra -pipe
BASE_OPTS = -O2 -ffast-math -mtune=generic -msse -msse2 -fdata-sections -ffunction-sections

ifneq ($(MACOS),true)
# MacOS doesn't support this
BASE_OPTS += -mfpmath=sse
endif

ifeq ($(MACOS),true)
# MacOS linker flags
LINK_OPTS = -fdata-sections -ffunction-sections -Wl,-dead_strip -Wl,-dead_strip_dylibs
else
# Common linker flags
LINK_OPTS = -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,-O1 -Wl,--as-needed -Wl,--strip-all
endif

ifeq ($(RASPPI),true)
# Raspberry-Pi optimization flags
BASE_OPTS = -O2 -ffast-math -march=armv6 -mfpu=vfp -mfloat-abi=hard
LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all
endif

ifeq ($(PANDORA),true)
# OpenPandora optimization flags
BASE_OPTS = -O2 -ffast-math -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all
endif

ifeq ($(NOOPT),true)
# No optimization flags
BASE_OPTS = -O2 -ffast-math -fdata-sections -ffunction-sections
endif

ifneq ($(WIN32),true)
# not needed for Windows
BASE_FLAGS += -fPIC -DPIC
endif

ifeq ($(DEBUG),true)
BASE_FLAGS += -DDEBUG -O0 -g
LINK_OPTS =
else
BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden
CXXFLAGS += -fvisibility-inlines-hidden
endif

BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS)
BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++0x -std=gnu++0x $(CXXFLAGS) $(CPPFLAGS)
LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS)

ifeq ($(MACOS),true)
# No C++11 support
BUILD_CXX_FLAGS = $(BASE_FLAGS) $(CXXFLAGS) $(CPPFLAGS)
LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS)
endif

# --------------------------------------------------------------
# Check for optional libs

ifeq ($(LINUX),true)
HAVE_DGL = $(shell pkg-config --exists gl x11 && echo true)
HAVE_JACK = $(shell pkg-config --exists jack && echo true)
HAVE_LIBLO = $(shell pkg-config --exists liblo && echo true)
endif

ifeq ($(MACOS),true)
HAVE_DGL = true
endif

ifeq ($(WIN32),true)
HAVE_DGL = true
endif

# --------------------------------------------------------------
# Set libs stuff

ifeq ($(HAVE_DGL),true)

ifeq ($(LINUX),true)
DGL_FLAGS = $(shell pkg-config --cflags gl x11)
DGL_LIBS = $(shell pkg-config --libs gl x11)
endif

ifeq ($(MACOS),true)
DGL_LIBS = -framework OpenGL -framework Cocoa
endif

ifeq ($(WIN32),true)
DGL_LIBS = -lopengl32 -lgdi32
endif

endif # HAVE_DGL

# --------------------------------------------------------------
# Set app extension

ifeq ($(WIN32),true)
APP_EXT = .exe
endif

# --------------------------------------------------------------
# Set shared lib extension

LIB_EXT = .so

ifeq ($(MACOS),true)
LIB_EXT = .dylib
endif

ifeq ($(WIN32),true)
LIB_EXT = .dll
endif

# --------------------------------------------------------------
# Set shared library CLI arg

SHARED = -shared

ifeq ($(MACOS),true)
SHARED = -dynamiclib
endif

# --------------------------------------------------------------

+ 0
- 3
bin/README View File

@@ -1,3 +0,0 @@
All final plugin builds will be placed in this folder.

There is no "make install" process, simply copy those files to their appropriate place.

+ 1
- 1
dpf

@@ -1 +1 @@
Subproject commit 9dc2c376e5adde08e470f20e84a49638576cea83
Subproject commit 705bff94cc8b4066f4f1fe36aa7591575ade2585

+ 3
- 3
plugins/Info/InfoExamplePlugin.cpp View File

@@ -220,9 +220,9 @@ protected:
const TimePosition& timePos(getTimePosition());
// set basic values
fParameters[kParameterTimePlaying] = timePos.playing ? 1.0f : 0.0f;
fParameters[kParameterTimeFrame] = timePos.frame;
fParameters[kParameterTimeValidBBT] = timePos.bbt.valid ? 1.0f : 0.0f;
fParameters[kParameterTimePlaying] = timePos.playing ? 1.0f : 0.0f;
fParameters[kParameterTimeFrame] = timePos.frame;
fParameters[kParameterTimeValidBBT] = timePos.bbt.valid ? 1.0f : 0.0f;
// set bbt
if (timePos.bbt.valid)


+ 5
- 5
plugins/Info/Makefile View File

@@ -12,16 +12,16 @@ NAME = d_info
# --------------------------------------------------------------
# Files to build

OBJS_DSP = \
InfoExamplePlugin.cpp.o
FILES_DSP = \
InfoExamplePlugin.cpp

OBJS_UI = \
InfoExampleUI.cpp.o
FILES_UI = \
InfoExampleUI.cpp

# --------------------------------------------------------------
# Do some magic

include ../Makefile.mk
include ../../dpf/Makefile.plugins.mk

# --------------------------------------------------------------
# Enable all possible plugin types


+ 3
- 3
plugins/Latency/Makefile View File

@@ -12,13 +12,13 @@ NAME = d_latency
# --------------------------------------------------------------
# Files to build

OBJS_DSP = \
LatencyExamplePlugin.cpp.o
FILES_DSP = \
LatencyExamplePlugin.cpp

# --------------------------------------------------------------
# Do some magic

include ../Makefile.mk
include ../../dpf/Makefile.plugins.mk

# --------------------------------------------------------------
# Enable all possible plugin types


+ 0
- 153
plugins/Makefile.mk View File

@@ -1,153 +0,0 @@
#!/usr/bin/make -f
# Makefile for DISTRHO Plugins #
# ---------------------------- #
# Created by falkTX
#

# NAME, OBJS_DSP and OBJS_UI have been defined before

include ../../Makefile.mk

ifeq ($(OBJS_UI),)
HAVE_DGL = false
endif

# --------------------------------------------------------------
# Basic setup

TARGET_DIR = ../../bin

BUILD_C_FLAGS += -I.
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

jack = $(TARGET_DIR)/$(NAME)$(APP_EXT)
ladspa_dsp = $(TARGET_DIR)/$(NAME)-ladspa$(LIB_EXT)
dssi_dsp = $(TARGET_DIR)/$(NAME)-dssi$(LIB_EXT)
dssi_ui = $(TARGET_DIR)/$(NAME)-dssi/$(NAME)_ui$(APP_EXT)
lv2 = $(TARGET_DIR)/$(NAME).lv2/$(NAME)$(LIB_EXT)
lv2_dsp = $(TARGET_DIR)/$(NAME).lv2/$(NAME)_dsp$(LIB_EXT)
lv2_ui = $(TARGET_DIR)/$(NAME).lv2/$(NAME)_ui$(LIB_EXT)
vst = $(TARGET_DIR)/$(NAME)-vst$(LIB_EXT)

# --------------------------------------------------------------
# Set distrho code files

DISTRHO_PLUGIN_FILES = ../../dpf/distrho/DistrhoPluginMain.cpp

ifeq ($(HAVE_DGL),true)
DISTRHO_UI_FILES = ../../dpf/distrho/DistrhoUIMain.cpp ../../dpf/libdgl.a
endif

# --------------------------------------------------------------
# Handle plugins without UI

ifneq ($(HAVE_DGL),true)
dssi_ui =
lv2_ui =
DISTRHO_UI_FILES =
DGL_LIBS =
OBJS_UI =
endif

# --------------------------------------------------------------
# all needs to be first

all:

# --------------------------------------------------------------
# Common

%.c.o: %.c
$(CC) $< $(BUILD_C_FLAGS) -MD -MP -c -o $@

%.cpp.o: %.cpp
$(CXX) $< $(BUILD_CXX_FLAGS) -MD -MP -c -o $@

clean:
rm -f *.d *.o
rm -rf $(TARGET_DIR)/$(NAME) $(TARGET_DIR)/$(NAME)-* $(TARGET_DIR)/$(NAME).lv2/

# --------------------------------------------------------------
# JACK

jack: $(jack)

$(jack): $(OBJS_DSP) $(OBJS_UI) $(DISTRHO_PLUGIN_FILES) $(DISTRHO_UI_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(shell pkg-config --cflags --libs jack) -DDISTRHO_PLUGIN_TARGET_JACK -o $@

# --------------------------------------------------------------
# LADSPA

ladspa: $(ladspa_dsp)

$(ladspa_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_LADSPA -o $@

# --------------------------------------------------------------
# DSSI

dssi: $(dssi_dsp) $(dssi_ui)
dssi_dsp: $(dssi_dsp)
dssi_ui: $(dssi_ui)

$(dssi_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_DSSI -o $@

$(dssi_ui): $(OBJS_UI) $(DISTRHO_UI_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(shell pkg-config --cflags --libs liblo) -DDISTRHO_PLUGIN_TARGET_DSSI -o $@

# --------------------------------------------------------------
# LV2

lv2_one: $(lv2)
lv2_dsp: $(lv2_dsp)
lv2_sep: $(lv2_dsp) $(lv2_ui)

$(lv2): $(OBJS_DSP) $(OBJS_UI) $(DISTRHO_PLUGIN_FILES) $(DISTRHO_UI_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_LV2 -o $@

$(lv2_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_LV2 -o $@

$(lv2_ui): $(OBJS_UI) $(DISTRHO_UI_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_LV2 -o $@

# --------------------------------------------------------------
# VST

vst: $(vst)

$(vst): $(OBJS_DSP) $(OBJS_UI) $(DISTRHO_PLUGIN_FILES) $(DISTRHO_UI_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_VST -o $@

# --------------------------------------------------------------

-include $(OBJS_DSP:%.o=%.d)
ifeq ($(HAVE_DGL),true)
-include $(OBJS_UI:%.o=%.d)
endif

# --------------------------------------------------------------

+ 1
- 0
plugins/Makefile.mk View File

@@ -0,0 +1 @@
../dpf/examples/Makefile.mk

+ 5
- 5
plugins/Meters/Makefile View File

@@ -12,16 +12,16 @@ NAME = d_meters
# --------------------------------------------------------------
# Files to build

OBJS_DSP = \
ExamplePluginMeters.cpp.o
FILES_DSP = \
ExamplePluginMeters.cpp

OBJS_UI = \
ExampleUIMeters.cpp.o
FILES_UI = \
ExampleUIMeters.cpp

# --------------------------------------------------------------
# Do some magic

include ../Makefile.mk
include ../../dpf/Makefile.plugins.mk

# --------------------------------------------------------------
# Enable all possible plugin types


+ 3
- 3
plugins/MidiThrough/Makefile View File

@@ -12,13 +12,13 @@ NAME = d_midiThrough
# --------------------------------------------------------------
# Files to build

OBJS_DSP = \
MidiThroughExamplePlugin.cpp.o
FILES_DSP = \
MidiThroughExamplePlugin.cpp

# --------------------------------------------------------------
# Do some magic

include ../Makefile.mk
include ../../dpf/Makefile.plugins.mk

# --------------------------------------------------------------
# Enable all possible plugin types


+ 5
- 5
plugins/Parameters/Makefile View File

@@ -12,16 +12,16 @@ NAME = d_parameters
# --------------------------------------------------------------
# Files to build

OBJS_DSP = \
ExamplePluginParameters.cpp.o
FILES_DSP = \
ExamplePluginParameters.cpp

OBJS_UI = \
ExampleUIParameters.cpp.o
FILES_UI = \
ExampleUIParameters.cpp

# --------------------------------------------------------------
# Do some magic

include ../Makefile.mk
include ../../dpf/Makefile.plugins.mk

# --------------------------------------------------------------
# Enable all possible plugin types


+ 5
- 5
plugins/States/Makefile View File

@@ -12,16 +12,16 @@ NAME = d_states
# --------------------------------------------------------------
# Files to build

OBJS_DSP = \
ExamplePluginStates.cpp.o
FILES_DSP = \
ExamplePluginStates.cpp

OBJS_UI = \
ExampleUIStates.cpp.o
FILES_UI = \
ExampleUIStates.cpp

# --------------------------------------------------------------
# Do some magic

include ../Makefile.mk
include ../../dpf/Makefile.plugins.mk

# --------------------------------------------------------------
# Enable all possible plugin types


Loading…
Cancel
Save