diff --git a/.gitignore b/.gitignore index 3a45ac4..414f4f5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,12 @@ *.a +*.d *.o *.exe *.dll *.dylib *.so +*.zip .kdev_include_paths .kdev4/ diff --git a/Makefile.mk b/Makefile.mk index 443fba1..8a77abe 100644 --- a/Makefile.mk +++ b/Makefile.mk @@ -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 @@ -75,11 +79,11 @@ LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) endif # -------------------------------------------------------------- -# Check for optional libs +# Check for optional & required libs ifeq ($(LINUX),true) -HAVE_DGL = $(shell pkg-config --exists gl x11 && echo true) -HAVE_JACK = $(shell pkg-config --exists jack && echo true) +HAVE_DGL = $(shell pkg-config --exists gl x11 && echo true) +HAVE_JACK = $(shell pkg-config --exists jack && echo true) endif ifeq ($(MACOS),true) @@ -90,9 +94,6 @@ ifeq ($(WIN32),true) HAVE_DGL = true endif -# -------------------------------------------------------------- -# Check for required libs - ifneq ($(HAVE_DGL),true) $(error OpenGL missing, cannot continue) endif @@ -118,16 +119,23 @@ DGL_LIBS = -lopengl32 -lgdi32 endif # -------------------------------------------------------------- -# 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 # -------------------------------------------------------------- diff --git a/dpf b/dpf index 28822a2..053854d 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit 28822a20701a75444b755463daeb82e640e1ceea +Subproject commit 053854daf007c4aeeda43c26de124181e6187cf2 diff --git a/plugins/Makefile.mk b/plugins/Makefile.mk index faeb73e..1cfa685 100644 --- a/plugins/Makefile.mk +++ b/plugins/Makefile.mk @@ -25,14 +25,9 @@ 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) +lv2 = $(TARGET_DIR)/$(NAME).lv2/$(NAME)$(LIB_EXT) +vst = $(TARGET_DIR)/$(NAME)-vst$(LIB_EXT) # -------------------------------------------------------------- # Set distrho code files @@ -40,17 +35,6 @@ vst = $(TARGET_DIR)/$(NAME)-vst.$(EXT) 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 @@ -60,13 +44,13 @@ all: # Common %.c.o: %.c - $(CC) $< $(BUILD_C_FLAGS) -c -o $@ + $(CC) $< $(BUILD_C_FLAGS) -MD -MP -c -o $@ -%.cpp.o: %.cpp ../../dpf/distrho/* - $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ +%.cpp.o: %.cpp + $(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/ # -------------------------------------------------------------- @@ -78,49 +62,15 @@ $(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 libprojectM) -lpthread -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) $(shell pkg-config --cflags --libs libprojectM) -lpthread $(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) $(shell pkg-confi --cflags --libs libprojectM) -lpthread $(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 libprojectM) -lpthread -DDISTRHO_PLUGIN_TARGET_DSSI -o $@ - # -------------------------------------------------------------- # LV2 -lv2_one: $(lv2) -lv2_dsp: $(lv2_dsp) -lv2_sep: $(lv2_dsp) $(lv2_ui) +lv2: $(lv2) $(lv2): $(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 libprojectM) -lpthread $(SHARED) -DDISTRHO_PLUGIN_TARGET_LV2 -o $@ -$(lv2_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES) - mkdir -p $(shell dirname $@) - $(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(shell pkg-config --cflags --libs libprojectM) -lpthread $(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) $(shell pkg-config --cflags --libs libprojectM) -lpthread $(SHARED) -DDISTRHO_PLUGIN_TARGET_LV2 -o $@ - # -------------------------------------------------------------- # VST @@ -131,3 +81,8 @@ $(vst): $(OBJS_DSP) $(OBJS_UI) $(DISTRHO_PLUGIN_FILES) $(DISTRHO_UI_FILES) $(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(shell pkg-config --cflags --libs libprojectM) -lpthread $(SHARED) -DDISTRHO_PLUGIN_TARGET_VST -o $@ # -------------------------------------------------------------- + +-include $(OBJS_DSP:%.o=%.d) +-include $(OBJS_UI:%.o=%.d) + +# -------------------------------------------------------------- diff --git a/plugins/ProM/DistrhoPluginInfo.h b/plugins/ProM/DistrhoPluginInfo.h index 57cda7f..4d0ea29 100644 --- a/plugins/ProM/DistrhoPluginInfo.h +++ b/plugins/ProM/DistrhoPluginInfo.h @@ -1,6 +1,6 @@ /* * DISTRHO ProM Plugin - * Copyright (C) 2014 Filipe Coelho + * Copyright (C) 2015 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/ProM/DistrhoPluginProM.cpp b/plugins/ProM/DistrhoPluginProM.cpp index 4efad33..5d9dabf 100644 --- a/plugins/ProM/DistrhoPluginProM.cpp +++ b/plugins/ProM/DistrhoPluginProM.cpp @@ -1,6 +1,6 @@ /* * DISTRHO ProM Plugin - * Copyright (C) 2014 Filipe Coelho + * Copyright (C) 2015 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/ProM/DistrhoPluginProM.hpp b/plugins/ProM/DistrhoPluginProM.hpp index 377afcb..64f3544 100644 --- a/plugins/ProM/DistrhoPluginProM.hpp +++ b/plugins/ProM/DistrhoPluginProM.hpp @@ -1,6 +1,6 @@ /* * DISTRHO ProM Plugin - * Copyright (C) 2014 Filipe Coelho + * Copyright (C) 2015 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/ProM/DistrhoUIProM.cpp b/plugins/ProM/DistrhoUIProM.cpp index 7408257..3e4547a 100644 --- a/plugins/ProM/DistrhoUIProM.cpp +++ b/plugins/ProM/DistrhoUIProM.cpp @@ -1,6 +1,6 @@ /* * DISTRHO ProM Plugin - * Copyright (C) 2014 Filipe Coelho + * Copyright (C) 2015 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/ProM/DistrhoUIProM.hpp b/plugins/ProM/DistrhoUIProM.hpp index 32a09bc..2cfbf8d 100644 --- a/plugins/ProM/DistrhoUIProM.hpp +++ b/plugins/ProM/DistrhoUIProM.hpp @@ -1,6 +1,6 @@ /* * DISTRHO ProM Plugin - * Copyright (C) 2014 Filipe Coelho + * Copyright (C) 2015 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/ProM/Makefile b/plugins/ProM/Makefile index 776d28e..45f26e6 100644 --- a/plugins/ProM/Makefile +++ b/plugins/ProM/Makefile @@ -29,7 +29,7 @@ include ../Makefile.mk ifeq ($(HAVE_JACK),true) TARGETS += jack endif -TARGETS += lv2_one +TARGETS += lv2 TARGETS += vst all: $(TARGETS)