Browse Source

Misc makefile work

tags/1.9.4
falkTX 12 years ago
parent
commit
c133d2024e
8 changed files with 81 additions and 67 deletions
  1. +70
    -62
      source/Makefile.mk
  2. +5
    -0
      source/backend/standalone/Makefile
  3. +1
    -1
      source/modules/juce_audio_devices/AppConfig.h
  4. +1
    -1
      source/modules/juce_audio_processors/Makefile
  5. +1
    -1
      source/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp
  6. +1
    -1
      source/modules/juce_gui_basics/Makefile
  7. +1
    -1
      source/modules/juce_gui_extra/Makefile
  8. +1
    -0
      source/plugin/Makefile

+ 70
- 62
source/Makefile.mk View File

@@ -43,53 +43,24 @@ endif

BASE_FLAGS = -Wall -Wextra -pipe -DREAL_BUILD
BASE_OPTS = -O2 -ffast-math -mtune=generic -msse -msse2 -mfpmath=sse -fdata-sections -ffunction-sections
LINK_OPTS = -fdata-sections -ffunction-sections
# -Wl,--strip-all
LINK_OPTS = -fdata-sections -ffunction-sections -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections -Wl,--strip-all

ifeq ($(TESTBUILD),true)
BASE_FLAGS += -Werror -Wcast-qual -Wconversion -Wformat-security -Wredundant-decls -Wshadow -Wstrict-overflow -fstrict-overflow -Wundef -Wwrite-strings
CFLAGS += -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes
CXXFLAGS += -Wnon-virtual-dtor -Woverloaded-virtual
ifneq ($(CC),clang)
BASE_FLAGS += -Wcast-align -Wunsafe-loop-optimizations
endif
ifeq ($(LINUX),true)
CFLAGS += -isystem /opt/kxstudio/include
CXXFLAGS += -isystem /opt/kxstudio/include -isystem /usr/include/qt4
endif
ifeq ($(MACOS),true)
CFLAGS += -isystem /opt/local/include/
CXXFLAGS += -isystem /opt/local/include/
endif
ifeq ($(WIN32),true)
CFLAGS += -isystem /opt/mingw32/include
CXXFLAGS += -isystem /opt/mingw32/include -isystem /opt/mingw32/include/qt4
endif
# MacOS linker flags
LINK_OPTS = -fdata-sections -ffunction-sections -Wl,-dead_strip -Wl,-dead_strip_dylibs
endif

ifneq ($(MACOS),true)
LINK_OPTS += -Wl,-O1 -Wl,--gc-sections
ifneq ($(CC),clang)
BASE_FLAGS += -Wlogical-op
endif
ifeq ($(TESTBUILD),true)
BASE_FLAGS += -Wmissing-declarations -Wsign-conversion
# -Wsuggest-attribute=noreturn
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 ($(WIN32),true)
BASE_FLAGS += -msse -msse2
else
ifneq ($(WIN32),true)
# not needed for Windows
BASE_FLAGS += -fPIC -DPIC
endif

ifeq ($(RASPPI),true)
# Raspberry-Pi optimization flags
BASE_OPTS = -O3 -ffast-math -march=armv6 -mfpu=vfp -mfloat-abi=hard
LINK_OPTS =
endif

ifeq ($(DEBUG),true)
BASE_FLAGS += -DDEBUG -O0 -g
LINK_OPTS =
@@ -111,6 +82,34 @@ BUILD_CXX_FLAGS = $(BASE_FLAGS) $(CXXFLAGS)
LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS)
endif

# --------------------------------------------------------------
# Strict test build

ifeq ($(TESTBUILD),true)
BASE_FLAGS += -Werror -Wcast-qual -Wconversion -Wformat -Wformat-security -Wredundant-decls -Wshadow -Wstrict-overflow -fstrict-overflow -Wundef -Wwrite-strings
# ifneq ($(CC),clang)
BASE_FLAGS += -Wcast-align -Wunsafe-loop-optimizations
# endif
# -Wsuggest-attribute=noreturn
ifneq ($(MACOS),true)
BASE_FLAGS += -Wlogical-op -Wmissing-declarations -Wsign-conversion
endif
CFLAGS += -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes
CXXFLAGS += -Wnon-virtual-dtor -Woverloaded-virtual
ifeq ($(LINUX),true)
CFLAGS += -isystem /opt/kxstudio/include
CXXFLAGS += -isystem /opt/kxstudio/include -isystem /usr/include/qt4
endif
ifeq ($(MACOS),true)
CFLAGS += -isystem /opt/local/include/
CXXFLAGS += -isystem /opt/local/include/
endif
ifeq ($(WIN32),true)
CFLAGS += -isystem /opt/mingw32/include
CXXFLAGS += -isystem /opt/mingw32/include -isystem /opt/mingw32/include/qt4
endif
endif

# --------------------------------------------------------------
# Check for qt, set default version (prefer qt4)

@@ -182,6 +181,7 @@ endif
HAVE_FFMPEG = $(shell pkg-config --exists libavcodec libavformat libavutil && echo true)
HAVE_GTK2 = $(shell pkg-config --exists gtk+-2.0 && echo true)
HAVE_GTK3 = $(shell pkg-config --exists gtk+-3.0 && echo true)
HAVE_WAYLAND = $(shell pkg-config --exists wayland-client && echo true)
HAVE_X11 = $(shell pkg-config --exists x11 && echo true)

ifeq ($(LINUX),true)
@@ -201,7 +201,7 @@ HAVE_LINUXSAMPLER = $(shell pkg-config --exists linuxsampler && echo true)
endif

# --------------------------------------------------------------
# Check for optional libs (needed by internal plugins)
# Check for optional libs (required by internal plugins)

HAVE_AF_DEPS = $(shell pkg-config --exists sndfile && echo true)
HAVE_MF_DEPS = $(shell pkg-config --exists smf && echo true)
@@ -209,7 +209,7 @@ HAVE_ZYN_DEPS = $(shell pkg-config --exists fftw3 mxml zlib && echo true)
HAVE_ZYN_UI_DEPS = $(shell pkg-config --exists ntk_images ntk && echo true)

# --------------------------------------------------------------
# Force some things on MacOS and Windows
# Force some features on MacOS and Windows

ifeq ($(MACOS),true)
FORCE_FEATURES = true
@@ -225,7 +225,7 @@ HAVE_X11 = false
endif

# --------------------------------------------------------------
# Set base stuff
# Set base defines

ifeq ($(HAVE_DGL),true)
BASE_FLAGS += -DHAVE_DGL
@@ -239,6 +239,10 @@ ifeq ($(HAVE_JUCE),true)
BASE_FLAGS += -DHAVE_JUCE
endif

ifeq ($(HAVE_WAYLAND),true)
BASE_FLAGS += -DHAVE_WAYLAND
endif

ifeq ($(HAVE_X11),true)
BASE_FLAGS += -DHAVE_X11
endif
@@ -246,8 +250,8 @@ endif
# --------------------------------------------------------------
# Set libs stuff (part 1)

LIBLO_FLAGS = $(shell pkg-config --cflags liblo)
LIBLO_LIBS = $(shell pkg-config --libs liblo)
LIBLO_FLAGS = $(shell pkg-config --cflags liblo)
LIBLO_LIBS = $(shell pkg-config --libs liblo)

ifeq ($(DEFAULT_QT),5)
QTCORE_FLAGS = $(shell pkg-config --cflags Qt5Core)
@@ -277,8 +281,8 @@ LINUXSAMPLER_LIBS = $(shell pkg-config --libs linuxsampler)
endif

ifeq ($(HAVE_WAYLAND),true)
WAYLAND_FLAGS = $(shell pkg-config --cflags x11)
WAYLAND_LIBS = $(shell pkg-config --libs x11)
WAYLAND_FLAGS = $(shell pkg-config --cflags wayland-client)
WAYLAND_LIBS = $(shell pkg-config --libs wayland-client)
endif

ifeq ($(HAVE_X11),true)
@@ -286,10 +290,6 @@ X11_FLAGS = $(shell pkg-config --cflags x11)
X11_LIBS = $(shell pkg-config --libs x11)
endif

ifneq ($(HAIKU),true)
RTMEMPOOL_LIBS = -lpthread
endif

# --------------------------------------------------------------
# Set libs stuff (part 2)

@@ -309,6 +309,10 @@ RTAUDIO_FLAGS += -D__RTAUDIO_DEBUG__
RTMIDI_FLAGS += -D__RTMIDI_DEBUG__
endif

ifneq ($(HAIKU),true)
RTMEMPOOL_LIBS = -lpthread
endif

ifeq ($(LINUX),true)
ifeq ($(HAVE_DGL),true)
DGL_FLAGS = $(shell pkg-config --cflags gl x11)
@@ -338,18 +342,22 @@ endif
endif

ifeq ($(MACOS),true)
DGL_LIBS = -framework OpenGL -framework Cocoa
JACKBRIDGE_LIBS = -ldl -lpthread
JUCE_AUDIO_BASICS_LIBS = -framework Accelerate
JUCE_AUDIO_DEVICES_LIBS = -framework AudioToolbox -framework CoreAudio -framework CoreMIDI -framework DiscRecording
JUCE_AUDIO_FORMATS_LIBS = -framework CoreAudio -framework CoreMIDI -framework QuartzCore -framework AudioToolbox
JUCE_CORE_LIBS = -framework Cocoa -framework IOKit
JUCE_GRAPHICS_LIBS = -framework Cocoa -framework QuartzCore
JUCE_GUI_BASICS_LIBS = -framework Cocoa -framework Carbon -framework QuartzCore
LILV_LIBS = -ldl -lm
RTAUDIO_FLAGS += -D__MACOSX_CORE__
RTAUDIO_LIBS += -lpthread
RTMIDI_FLAGS += -D__MACOSX_CORE__
DGL_LIBS = -framework OpenGL -framework Cocoa
JACKBRIDGE_LIBS = -ldl -lpthread
JUCE_AUDIO_BASICS_LIBS = -framework Accelerate
JUCE_AUDIO_DEVICES_LIBS = -framework AppKit -framework AudioToolbox -framework CoreAudio -framework CoreMIDI
JUCE_AUDIO_FORMATS_LIBS = -framework AudioToolbox -framework CoreFoundation
JUCE_AUDIO_PROCESSORS_LIBS = -framework Cocoa -framework Carbon
JUCE_CORE_LIBS = -framework AppKit
JUCE_EVENTS_LIBS = -framework AppKit
JUCE_GRAPHICS_LIBS = -framework Cocoa -framework QuartzCore
JUCE_GUI_BASICS_LIBS = -framework Cocoa
JUCE_GUI_EXTRA_LIBS = -framework Cocoa -framework IOKit
LILV_LIBS = -ldl -lm
RTAUDIO_FLAGS += -D__MACOSX_CORE__
RTAUDIO_LIBS += -framework CoreAudio -framework CoreFoundation -lpthread
RTMIDI_FLAGS += -D__MACOSX_CORE__
RTMIDI_LIBS += -framework CoreAudio -framework CoreMIDI -framework CoreFoundation
endif

ifeq ($(WIN32),true)
@@ -357,7 +365,7 @@ DGL_LIBS = -lopengl32 -lgdi32
JACKBRIDGE_LIBS = -lpthread
JUCE_AUDIO_DEVICES_LIBS = -lwinmm -lole32
JUCE_CORE_LIBS = -luuid -lwsock32 -lwininet -lversion -lole32 -lws2_32 -loleaut32 -limm32 -lcomdlg32 -lshlwapi -lrpcrt4 -lwinmm
JUCE_EVENTS_LIBS = -lole32
# JUCE_EVENTS_LIBS = -lole32
JUCE_GRAPHICS_LIBS = -lgdi32
JUCE_GUI_BASICS_LIBS = -lgdi32 -limm32 -lcomdlg32 -lole32
LILV_LIBS = -lm


+ 5
- 0
source/backend/standalone/Makefile View File

@@ -36,6 +36,7 @@ STATIC_LIBS += ../../modules/juce_gui_basics.a
STATIC_LIBS += ../../modules/juce_gui_extra.a
LINK_FLAGS += $(JUCE_AUDIO_BASICS_LIBS)
LINK_FLAGS += $(JUCE_AUDIO_DEVICES_LIBS)
LINK_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS)
LINK_FLAGS += $(JUCE_CORE_LIBS)
LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS)
LINK_FLAGS += $(JUCE_EVENTS_LIBS)
@@ -78,6 +79,10 @@ ifeq ($(HAVE_LINUXSAMPLER),true)
LINK_FLAGS += $(LINUXSAMPLER_LIBS)
endif

# ifeq ($(HAVE_WAYLAND),true)
# LINK_FLAGS += $(WAYLAND_LIBS)
# endif

ifeq ($(HAVE_X11),true)
LINK_FLAGS += $(X11_LIBS)
endif


+ 1
- 1
source/modules/juce_audio_devices/AppConfig.h View File

@@ -45,7 +45,7 @@
/** Config: JUCE_ALSA
Enables ALSA audio devices (Linux only).
*/
#if JUCE_LINUX
#if 0 //JUCE_LINUX
#define JUCE_ALSA 1
#define JUCE_ALSA_MIDI_INPUT_NAME "Carla"
#define JUCE_ALSA_MIDI_OUTPUT_NAME "Carla"


+ 1
- 1
source/modules/juce_audio_processors/Makefile View File

@@ -9,7 +9,7 @@ include ../../Makefile.mk
# --------------------------------------------------------------

BUILD_CXX_FLAGS += $(JUCE_AUDIO_PROCESSORS_FLAGS) -I. -I../../includes/ladspa -I../../includes/vst -I../../includes/vst3 -w
LINK_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS) -L.. -ljuce_audio_basics -ljuce_gui_basics -ljuce_graphics -ljuce_data_structures -ljuce_events -ljuce_core
LINK_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS) -L.. -ljuce_gui_extra -ljuce_gui_basics -ljuce_graphics -ljuce_data_structures -ljuce_events -ljuce_audio_basics -ljuce_core

ifeq ($(CARLA_VESTIGE_HEADER),true)
BUILD_CXX_FLAGS += -DVESTIGE_HEADER


+ 1
- 1
source/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp View File

@@ -1758,7 +1758,7 @@ private:
//==============================================================================
VST3ModuleHandle::Ptr module;
friend VST3HostContext;
friend class VST3HostContext;
ComSmartPtr<VST3HostContext> host;
// Information objects:


+ 1
- 1
source/modules/juce_gui_basics/Makefile View File

@@ -9,7 +9,7 @@ include ../../Makefile.mk
# --------------------------------------------------------------

BUILD_CXX_FLAGS += $(JUCE_GUI_BASICS_FLAGS) -I. -w
LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS) -L.. -ljuce_data_structures -ljuce_graphics -ljuce_events -ljuce_core
LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS) -L.. -ljuce_graphics -ljuce_data_structures -ljuce_events -ljuce_core

ifeq ($(MACOS),true)
BUILD_CXX_FLAGS += -ObjC++


+ 1
- 1
source/modules/juce_gui_extra/Makefile View File

@@ -9,7 +9,7 @@ include ../../Makefile.mk
# --------------------------------------------------------------

BUILD_CXX_FLAGS += $(JUCE_GUI_EXTRA_FLAGS) -I. -w
LINK_FLAGS += $(JUCE_GUI_EXTRA_LIBS) -L.. -ljuce_gui_basics
LINK_FLAGS += $(JUCE_GUI_EXTRA_LIBS) -L.. -ljuce_gui_basics -ljuce_graphics -ljuce_data_structures -ljuce_events -ljuce_core

ifeq ($(MACOS),true)
BUILD_CXX_FLAGS += -ObjC++


+ 1
- 0
source/plugin/Makefile View File

@@ -59,6 +59,7 @@ endif

ifeq ($(HAVE_JUCE),true)
LINK_FLAGS += $(JUCE_AUDIO_BASICS_LIBS)
LINK_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS)
LINK_FLAGS += $(JUCE_CORE_LIBS)
LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS)
LINK_FLAGS += $(JUCE_EVENTS_LIBS)


Loading…
Cancel
Save