Browse Source

Simplify makefiles

master
falkTX 1 year ago
parent
commit
3a2809dbde
13 changed files with 61 additions and 323 deletions
  1. +4
    -8
      .gitignore
  2. +1
    -1
      .gitmodules
  3. +15
    -3
      Makefile
  4. +0
    -137
      Makefile.mk
  5. +0
    -3
      bin/README
  6. +1
    -1
      dpf
  7. +0
    -130
      plugins/Makefile.mk
  8. +8
    -8
      plugins/PowerJuice/Makefile
  9. +8
    -8
      plugins/PowerJuiceX2/Makefile
  10. +6
    -6
      plugins/StutterJuice/Makefile
  11. +6
    -6
      plugins/TriggerJuice/Makefile
  12. +6
    -6
      plugins/VectorJuice/Makefile
  13. +6
    -6
      plugins/WobbleJuice/Makefile

+ 4
- 8
.gitignore View File

@@ -1,19 +1,15 @@
*.a
*.d
*.o

*.exe
*.dll
*.dylib
*.so
*.zip

.kdev_include_paths
.kdev4/

bin/*-dssi/
bin/*.lv2/
bin/PowerJuice
bin/PowerJuiceX2
bin/StutterJuice
bin/TriggerJuice
bin/VectorJuice
bin/WobbleJuice
bin/
build/

+ 1
- 1
.gitmodules View File

@@ -1,3 +1,3 @@
[submodule "dpf"]
path = dpf
url = git://github.com/DISTRHO/DPF
url = https://github.com/DISTRHO/DPF

+ 15
- 3
Makefile View File

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

all: libs plugins gen
include dpf/Makefile.base.mk

all: dgl plugins gen

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

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

plugins: libs
plugins: dgl
$(MAKE) all -C plugins/PowerJuice
$(MAKE) all -C plugins/PowerJuiceX2
$(MAKE) all -C plugins/StutterJuice
@@ -19,11 +23,18 @@ plugins: libs
$(MAKE) all -C plugins/VectorJuice
$(MAKE) all -C plugins/WobbleJuice

ifneq ($(CROSS_COMPILING),true)
gen: plugins dpf/utils/lv2_ttl_generator
@$(CURDIR)/dpf/utils/generate-ttl.sh
ifeq ($(MACOS),true)
@$(CURDIR)/dpf/utils/generate-vst-bundles.sh
endif

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

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

@@ -36,6 +47,7 @@ clean:
$(MAKE) clean -C plugins/TriggerJuice
$(MAKE) clean -C plugins/VectorJuice
$(MAKE) clean -C plugins/WobbleJuice
rm -rf bin build

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



+ 0
- 137
Makefile.mk View File

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

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

# --------------------------------------------------------------
# Common build and link flags

BASE_FLAGS = -Wall -Wextra -pipe
BASE_OPTS = -O2 -ffast-math -fdata-sections -ffunction-sections
ifneq ($(NOOPT),true)
BASE_OPTS += -mtune=generic -msse -msse2 -mfpmath=sse
endif
LINK_OPTS = -fdata-sections -ffunction-sections -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections -Wl,--strip-all

ifeq ($(MACOS),true)
# MacOS linker flags
LINK_OPTS = -fdata-sections -ffunction-sections -Wl,-dead_strip -Wl,-dead_strip_dylibs
endif

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

ifeq ($(PANDORA),true)
# OpenPandora flags
BASE_OPTS = -O2 -ffast-math
ifneq ($(NOOPT),true)
BASE_OPTS += -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
endif
LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all
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 required libs

# FIXME
BASE_FLAGS += -DHAVE_JACK -DHAVE_LIBLO -DHAVE_DGL

ifeq ($(LINUX),true)
ifneq ($(shell pkg-config --exists jack && echo true),true)
$(error JACK missing, cannot continue)
endif
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

ifneq ($(shell pkg-config --exists liblo && echo true),true)
$(error liblo missing, cannot continue)
endif

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

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

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

EXT = so

ifeq ($(MACOS),true)
EXT = dylib
endif

ifeq ($(WIN32),true)
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 d13014bb1b5cf9bc3ac0cf107fccca1c8db6e535
Subproject commit eb1ec93eedb24e33c5e6d8442d7f2d1bd7038a13

+ 0
- 130
plugins/Makefile.mk View File

@@ -1,130 +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

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

TARGET_DIR = ../../bin

BUILD_C_FLAGS += -I.
BUILD_CXX_FLAGS += -I. -I../../dpf/distrho -I../../dpf/dgl

# --------------------------------------------------------------
# Set plugin binary file targets

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

ifeq ($(WIN32),true)
dssi_ui += .exe
endif

# TODO: MacOS VST bundle

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

DISTRHO_PLUGIN_FILES = ../../dpf/distrho/DistrhoPluginMain.cpp
DISTRHO_UI_FILES = ../../dpf/distrho/DistrhoUIMain.cpp ../../dpf/libdgl.a

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

ifeq ($(TARGET_NOUI),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) -c -o $@

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

clean:
rm -f *.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): $(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_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 $@

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

+ 8
- 8
plugins/PowerJuice/Makefile View File

@@ -12,25 +12,25 @@ NAME = PowerJuice
# --------------------------------------------------------------
# Files to build

OBJS_DSP = \
PowerJuicePlugin.cpp.o
FILES_DSP = \
PowerJuicePlugin.cpp

OBJS_UI = \
PowerJuiceArtwork.cpp.o \
PowerJuiceUI.cpp.o
FILES_UI = \
PowerJuiceArtwork.cpp \
PowerJuiceUI.cpp

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

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

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

ifeq ($(LINUX),true)
all: jack lv2_one vst
all: jack lv2 vst
else
all: lv2_one vst
all: lv2 vst
endif

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

+ 8
- 8
plugins/PowerJuiceX2/Makefile View File

@@ -12,25 +12,25 @@ NAME = PowerJuiceX2
# --------------------------------------------------------------
# Files to build

OBJS_DSP = \
PowerJuiceX2Plugin.cpp.o
FILES_DSP = \
PowerJuiceX2Plugin.cpp

OBJS_UI = \
PowerJuiceX2Artwork.cpp.o \
PowerJuiceX2UI.cpp.o
FILES_UI = \
PowerJuiceX2Artwork.cpp \
PowerJuiceX2UI.cpp

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

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

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

ifeq ($(LINUX),true)
all: jack lv2_one vst
all: jack lv2 vst
else
all: lv2_one vst
all: lv2 vst
endif

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

+ 6
- 6
plugins/StutterJuice/Makefile View File

@@ -12,17 +12,17 @@ NAME = StutterJuice
# --------------------------------------------------------------
# Files to build

OBJS_DSP = \
StutterJuicePlugin.cpp.o
FILES_DSP = \
StutterJuicePlugin.cpp

OBJS_UI = \
StutterJuiceArtwork.cpp.o \
StutterJuiceUI.cpp.o
FILES_UI = \
StutterJuiceArtwork.cpp \
StutterJuiceUI.cpp

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

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

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


+ 6
- 6
plugins/TriggerJuice/Makefile View File

@@ -12,17 +12,17 @@ NAME = TriggerJuice
# --------------------------------------------------------------
# Files to build

OBJS_DSP = \
TriggerJuicePlugin.cpp.o
FILES_DSP = \
TriggerJuicePlugin.cpp

OBJS_UI = \
TriggerJuiceArtwork.cpp.o \
TriggerJuiceUI.cpp.o
FILES_UI = \
TriggerJuiceArtwork.cpp \
TriggerJuiceUI.cpp

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

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

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


+ 6
- 6
plugins/VectorJuice/Makefile View File

@@ -12,17 +12,17 @@ NAME = VectorJuice
# --------------------------------------------------------------
# Files to build

OBJS_DSP = \
VectorJuicePlugin.cpp.o
FILES_DSP = \
VectorJuicePlugin.cpp

OBJS_UI = \
VectorJuiceArtwork.cpp.o \
VectorJuiceUI.cpp.o
FILES_UI = \
VectorJuiceArtwork.cpp \
VectorJuiceUI.cpp

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

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

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


+ 6
- 6
plugins/WobbleJuice/Makefile View File

@@ -12,17 +12,17 @@ NAME = WobbleJuice
# --------------------------------------------------------------
# Files to build

OBJS_DSP = \
WobbleJuicePlugin.cpp.o
FILES_DSP = \
WobbleJuicePlugin.cpp

OBJS_UI = \
WobbleJuiceArtwork.cpp.o \
WobbleJuiceUI.cpp.o
FILES_UI = \
WobbleJuiceArtwork.cpp \
WobbleJuiceUI.cpp

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

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

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


Loading…
Cancel
Save