Browse Source

Update makefiles

pull/5/head
falkTX 7 years ago
parent
commit
e2e2617df5
4 changed files with 56 additions and 38 deletions
  1. +2
    -0
      .gitignore
  2. +30
    -19
      Makefile.mk
  3. +1
    -1
      dpf
  4. +23
    -18
      plugins/Makefile.mk

+ 2
- 0
.gitignore View File

@@ -1,10 +1,12 @@
*.a
*.d
*.o

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

.kdev_include_paths
.kdev4/


+ 30
- 19
Makefile.mk View File

@@ -4,6 +4,7 @@
# Created by falkTX
#

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

@@ -19,38 +20,41 @@ endif
endif

# --------------------------------------------------------------
# Common build and link flags
# Set 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
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
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
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 flags
BASE_OPTS = -O2 -ffast-math
ifneq ($(NOOPT),true)
BASE_OPTS += -march=armv6 -mfpu=vfp -mfloat-abi=hard
endif
# 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 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
# 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

ifneq ($(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
@@ -112,16 +116,23 @@ endif
endif # HAVE_DGL

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

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

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

EXT = so
LIB_EXT = .so

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

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

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


+ 1
- 1
dpf

@@ -1 +1 @@
Subproject commit efbd38a12119073f4b3fecea883cc2f11c298529
Subproject commit 053854daf007c4aeeda43c26de124181e6187cf2

+ 23
- 18
plugins/Makefile.mk View File

@@ -31,14 +31,14 @@ endif
# --------------------------------------------------------------
# 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)
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
@@ -47,14 +47,12 @@ DISTRHO_PLUGIN_FILES = ../../dpf/distrho/DistrhoPluginMain.cpp

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

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

ifeq ($(TARGET_NOUI),true)
ifneq ($(HAVE_DGL),true)
dssi_ui =
lv2_ui =
DISTRHO_UI_FILES =
@@ -71,13 +69,13 @@ all:
# Common

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

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

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

# --------------------------------------------------------------
@@ -87,7 +85,7 @@ 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) -lpthread -DDISTRHO_PLUGIN_TARGET_JACK -o $@
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -lpthread $(DGL_LIBS) $(shell pkg-config --cflags --libs jack) -DDISTRHO_PLUGIN_TARGET_JACK -o $@

# --------------------------------------------------------------
# LADSPA
@@ -96,7 +94,7 @@ 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 $@
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -lpthread $(SHARED) -DDISTRHO_PLUGIN_TARGET_LADSPA -o $@

# --------------------------------------------------------------
# DSSI
@@ -122,7 +120,7 @@ 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) -lpthread $(SHARED) -DDISTRHO_PLUGIN_TARGET_LV2 -o $@
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -lpthread $(DGL_LIBS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_LV2 -o $@

$(lv2_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES)
mkdir -p $(shell dirname $@)
@@ -139,6 +137,13 @@ 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) -lpthread $(SHARED) -DDISTRHO_PLUGIN_TARGET_VST -o $@
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -lpthread $(DGL_LIBS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_VST -o $@

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

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

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

Loading…
Cancel
Save