Browse Source

Start reworking the makefiles

tags/1.9.6
falkTX 10 years ago
parent
commit
75f263d4f9
8 changed files with 545 additions and 452 deletions
  1. +157
    -132
      Makefile
  2. +0
    -1
      source/Makefile.mk
  3. +73
    -69
      source/backend/Makefile
  4. +13
    -2
      source/backend/Makefile.mk
  5. +51
    -69
      source/backend/engine/Makefile
  6. +41
    -64
      source/backend/plugin/Makefile
  7. +32
    -0
      source/modules/Makefile.mk
  8. +178
    -115
      source/modules/jackbridge/Makefile

+ 157
- 132
Makefile View File

@@ -6,12 +6,9 @@

include source/Makefile.mk

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

PREFIX = /usr/local
DESTDIR =

LINK = ln -sf
LINK := ln -sf

ifeq ($(DEFAULT_QT),4)
PYUIC ?= pyuic4 -w
@@ -21,93 +18,117 @@ PYUIC ?= pyuic5
PYRCC ?= pyrcc5
endif

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

all: BIN RES UI WIDGETS
PREFIX := /usr/local
DESTDIR :=

# --------------------------------------------------------------
# Binaries (native)
BINDIR := $(CURDIR)/bin

BIN: libs backend bridges-plugin bridges-ui discovery interposer plugin theme
ifeq ($(DEBUG),true)
OBJDIR := $(CURDIR)/build/backend/Debug
MODULEDIR := $(CURDIR)/build/modules/Debug
else
OBJDIR := $(CURDIR)/build/backend/Release
MODULEDIR := $(CURDIR)/build/modules/Release
endif

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

ALL_LIBS += source/backend/carla_engine.a
ALL_LIBS += source/backend/carla_engine_plugin.a
ALL_LIBS += source/backend/carla_plugin.a
ALL_LIBS += source/modules/jackbridge.a
ALL_LIBS += source/modules/juce_audio_basics.a
ALL_LIBS += source/modules/juce_audio_formats.a
ALL_LIBS += source/modules/juce_core.a
ALL_LIBS += source/modules/lilv.a
ALL_LIBS += source/modules/native-plugins.a
ALL_LIBS += source/modules/rtmempool.a
all: BIN RES UI WIDGETS

ifeq ($(MACOS_OR_WIN32),true)
ALL_LIBS += source/modules/juce_audio_devices.a
ALL_LIBS += source/modules/juce_audio_processors.a
ALL_LIBS += source/modules/juce_data_structures.a
ALL_LIBS += source/modules/juce_events.a
ALL_LIBS += source/modules/juce_graphics.a
ALL_LIBS += source/modules/juce_gui_basics.a
ifeq ($(MACOS),true)
ALL_LIBS += source/modules/juce_gui_extra.a
endif
else
ALL_LIBS += source/modules/rtaudio.a
ALL_LIBS += source/modules/rtmidi.a
endif
# ----------------------------------------------------------------------------------------------------------------------------
# Binaries (native)

ifeq ($(HAVE_QT4),true)
ALL_LIBS += source/modules/theme.qt4.a
endif
BIN: libs
# backend bridges-plugin bridges-ui discovery interposer plugin theme

ifeq ($(HAVE_QT5),true)
ALL_LIBS += source/modules/theme.qt5.a
endif
# ----------------------------------------------------------------------------------------------------------------------------

ALL_LIBS = $(MODULEDIR)/carla_engine.a
ALL_LIBS += $(MODULEDIR)/carla_engine_plugin.a
ALL_LIBS += $(MODULEDIR)/carla_plugin.a
ALL_LIBS += $(MODULEDIR)/jackbridge.a

# ALL_LIBS += $(MODULEDIR)/juce_audio_basics.a
# ALL_LIBS += $(MODULEDIR)/juce_audio_formats.a
# ALL_LIBS += $(MODULEDIR)/juce_core.a
# ALL_LIBS += $(MODULEDIR)/lilv.a
# ALL_LIBS += $(MODULEDIR)/native-plugins.a
# ALL_LIBS += $(MODULEDIR)/rtmempool.a
#
# ifeq ($(MACOS_OR_WIN32),true)
# ALL_LIBS += $(MODULEDIR)/juce_audio_devices.a
# ALL_LIBS += $(MODULEDIR)/juce_audio_processors.a
# ALL_LIBS += $(MODULEDIR)/juce_data_structures.a
# ALL_LIBS += $(MODULEDIR)/juce_events.a
# ALL_LIBS += $(MODULEDIR)/juce_graphics.a
# ALL_LIBS += $(MODULEDIR)/juce_gui_basics.a
# ifeq ($(MACOS),true)
# ALL_LIBS += $(MODULEDIR)/juce_gui_extra.a
# endif
# else
# ALL_LIBS += $(MODULEDIR)/rtaudio.a
# ALL_LIBS += $(MODULEDIR)/rtmidi.a
# endif
#
# ifeq ($(HAVE_QT4),true)
# ALL_LIBS += $(MODULEDIR)/theme.qt4.a
# endif
#
# ifeq ($(HAVE_QT5),true)
# ALL_LIBS += $(MODULEDIR)/theme.qt5.a
# endif

libs: $(ALL_LIBS)

source/backend/carla_%_plugin.a: .FORCE
$(MAKE) -C source/backend/$* ../carla_$*_plugin.a
$(MODULEDIR)/carla_engine.a: .FORCE
@echo "Building CarlaEngine"
@$(MAKE) -C source/backend/engine

$(MODULEDIR)/carla_engine_plugin.a: $(MODULEDIR)/carla_engine.a .FORCE
@echo "Building CarlaEnginePlugin"
@$(MAKE) -C source/backend/engine

source/backend/carla_%.a: .FORCE
$(MAKE) -C source/backend/$* ../carla_$*.a
$(MODULEDIR)/carla_plugin.a: .FORCE
@echo "Building CarlaPlugin"
@$(MAKE) -C source/backend/plugin

source/modules/%.qt4.a: .FORCE
$(MAKE) -C source/modules/$* ../$*.qt4.a
$(MODULEDIR)/%.qt4.a: .FORCE
$(MAKE) -C source/modules/$* qt4

source/modules/%.qt5.a: .FORCE
$(MAKE) -C source/modules/$* ../$*.qt5.a
$(MODULEDIR)/%.qt5.a: .FORCE
$(MAKE) -C source/modules/$* qt5

source/modules/%.posix32.a: .FORCE
$(MAKE) -C source/modules/$* ../$*.posix32.a
$(MODULEDIR)/%.posix32.a: .FORCE
$(MAKE) -C source/modules/$* posix32

source/modules/%.posix32e.a: .FORCE
$(MAKE) -C source/modules/$* ../$*.posix32e.a
$(MODULEDIR)/%.posix32e.a: .FORCE
$(MAKE) -C source/modules/$* posix32e

source/modules/%.posix64.a: .FORCE
$(MAKE) -C source/modules/$* ../$*.posix64.a
$(MODULEDIR)/%.posix64.a: .FORCE
$(MAKE) -C source/modules/$* posix64

source/modules/%.posix64e.a: .FORCE
$(MAKE) -C source/modules/$* ../$*.posix64e.a
$(MODULEDIR)/%.posix64e.a: .FORCE
$(MAKE) -C source/modules/$* posix64e

source/modules/%.win32.a: .FORCE
$(MAKE) -C source/modules/$* ../$*.win32.a
$(MODULEDIR)/%.win32.a: .FORCE
$(MAKE) -C source/modules/$* win32

source/modules/%.win32e.a: .FORCE
$(MAKE) -C source/modules/$* ../$*.win32e.a
$(MODULEDIR)/%.win32e.a: .FORCE
$(MAKE) -C source/modules/$* win32e

source/modules/%.win64.a: .FORCE
$(MAKE) -C source/modules/$* ../$*.win64.a
$(MODULEDIR)/%.win64.a: .FORCE
$(MAKE) -C source/modules/$* win64

source/modules/%.win64e.a: .FORCE
$(MAKE) -C source/modules/$* ../$*.win64e.a
$(MODULEDIR)/%.win64e.a: .FORCE
$(MAKE) -C source/modules/$* win64e

source/modules/%.a: .FORCE
$(MAKE) -C source/modules/$* ../$*.a
$(MODULEDIR)/%.a: .FORCE
@echo "Building $*"
@$(MAKE) -C source/modules/$*

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

backend: bin/libcarla_standalone2$(LIB_EXT) bin/libcarla_utils$(LIB_EXT)

@@ -117,33 +138,33 @@ bin/libcarla_standalone2$(LIB_EXT): libs .FORCE
bin/libcarla_utils$(LIB_EXT): libs .FORCE
$(MAKE) -C source/backend ../../bin/libcarla_utils$(LIB_EXT)

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

bridges-plugin: bin/carla-bridge-native$(APP_EXT)

bin/carla-bridge-native$(APP_EXT): libs .FORCE
$(MAKE) -C source/bridges-plugin

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

bridges-ui: libs .FORCE
$(MAKE) -C source/bridges-ui

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

discovery: bin/carla-discovery-native$(APP_EXT)

bin/carla-discovery-native$(APP_EXT): libs .FORCE
$(MAKE) -C source/discovery

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

interposer: bin/libcarla_interposer.so

bin/libcarla_interposer.so: .FORCE
$(MAKE) -C source/interposer

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

plugin: plugin_build bin/carla.lv2/manifest.ttl

@@ -154,7 +175,7 @@ bin/carla.lv2/manifest.ttl: plugin_build bridges-plugin bridges-ui discovery
cd bin && ./carla-lv2-export$(APP_EXT); cd ..
cd bin/carla.lv2 && $(LINK) ../*bridge-* ../carla-discovery-* .; cd ..

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

ifeq ($(HAVE_QT),true)
theme: bin/styles/carlastyle$(LIB_EXT)
@@ -165,98 +186,98 @@ else
theme:
endif

# --------------------------------------------------------------
# ----------------------------------------------------------------------------------------------------------------------------
# Binaries (posix32)

LIBS_POSIX32 += source/modules/jackbridge.posix32.a
LIBS_POSIX32 += source/modules/juce_audio_basics.posix32.a
LIBS_POSIX32 += source/modules/juce_core.posix32.a
LIBS_POSIX32 += source/modules/lilv.posix32.a
LIBS_POSIX32 += source/modules/rtmempool.posix32.a
LIBS_POSIX32 += $(MODULEDIR)/jackbridge.posix32.a
LIBS_POSIX32 += $(MODULEDIR)/juce_audio_basics.posix32.a
LIBS_POSIX32 += $(MODULEDIR)/juce_core.posix32.a
LIBS_POSIX32 += $(MODULEDIR)/lilv.posix32.a
LIBS_POSIX32 += $(MODULEDIR)/rtmempool.posix32.a

ifeq ($(MACOS),true)
LIBS_POSIX32 += source/modules/juce_audio_processors.posix32.a
LIBS_POSIX32 += source/modules/juce_data_structures.posix32.a
LIBS_POSIX32 += source/modules/juce_events.posix32.a
LIBS_POSIX32 += source/modules/juce_graphics.posix32.a
LIBS_POSIX32 += source/modules/juce_gui_basics.posix32.a
LIBS_POSIX32 += source/modules/juce_gui_extra.posix32.a
LIBS_POSIX32 += $(MODULEDIR)/juce_audio_processors.posix32.a
LIBS_POSIX32 += $(MODULEDIR)/juce_data_structures.posix32.a
LIBS_POSIX32 += $(MODULEDIR)/juce_events.posix32.a
LIBS_POSIX32 += $(MODULEDIR)/juce_graphics.posix32.a
LIBS_POSIX32 += $(MODULEDIR)/juce_gui_basics.posix32.a
LIBS_POSIX32 += $(MODULEDIR)/juce_gui_extra.posix32.a
endif

posix32: $(LIBS_POSIX32)
$(MAKE) -C source/bridges-plugin posix32
$(MAKE) -C source/discovery posix32

# --------------------------------------------------------------
# ----------------------------------------------------------------------------------------------------------------------------
# Binaries (posix64)

LIBS_POSIX64 += source/modules/jackbridge.posix64.a
LIBS_POSIX64 += source/modules/juce_audio_basics.posix64.a
LIBS_POSIX64 += source/modules/juce_core.posix64.a
LIBS_POSIX64 += source/modules/lilv.posix64.a
LIBS_POSIX64 += source/modules/rtmempool.posix64.a
LIBS_POSIX64 += $(MODULEDIR)/jackbridge.posix64.a
LIBS_POSIX64 += $(MODULEDIR)/juce_audio_basics.posix64.a
LIBS_POSIX64 += $(MODULEDIR)/juce_core.posix64.a
LIBS_POSIX64 += $(MODULEDIR)/lilv.posix64.a
LIBS_POSIX64 += $(MODULEDIR)/rtmempool.posix64.a

ifeq ($(MACOS),true)
LIBS_POSIX64 += source/modules/juce_audio_processors.posix64.a
LIBS_POSIX64 += source/modules/juce_data_structures.posix64.a
LIBS_POSIX64 += source/modules/juce_events.posix64.a
LIBS_POSIX64 += source/modules/juce_graphics.posix64.a
LIBS_POSIX64 += source/modules/juce_gui_basics.posix64.a
LIBS_POSIX64 += source/modules/juce_gui_extra.posix64.a
LIBS_POSIX64 += $(MODULEDIR)/juce_audio_processors.posix64.a
LIBS_POSIX64 += $(MODULEDIR)/juce_data_structures.posix64.a
LIBS_POSIX64 += $(MODULEDIR)/juce_events.posix64.a
LIBS_POSIX64 += $(MODULEDIR)/juce_graphics.posix64.a
LIBS_POSIX64 += $(MODULEDIR)/juce_gui_basics.posix64.a
LIBS_POSIX64 += $(MODULEDIR)/juce_gui_extra.posix64.a
endif

posix64: $(LIBS_POSIX64)
$(MAKE) -C source/bridges-plugin posix64
$(MAKE) -C source/discovery posix64

# --------------------------------------------------------------
# ----------------------------------------------------------------------------------------------------------------------------
# Binaries (win32)

LIBS_WIN32 += source/modules/jackbridge.win32e.a
LIBS_WIN32 += source/modules/juce_audio_basics.win32.a
LIBS_WIN32 += source/modules/juce_audio_processors.win32.a
LIBS_WIN32 += source/modules/juce_core.win32.a
LIBS_WIN32 += source/modules/juce_data_structures.win32.a
LIBS_WIN32 += source/modules/juce_events.win32.a
LIBS_WIN32 += source/modules/juce_graphics.win32.a
LIBS_WIN32 += source/modules/juce_gui_basics.win32.a
LIBS_WIN32 += source/modules/lilv.win32.a
LIBS_WIN32 += source/modules/rtmempool.win32.a
LIBS_WIN32 += $(MODULEDIR)/jackbridge.win32e.a
LIBS_WIN32 += $(MODULEDIR)/juce_audio_basics.win32.a
LIBS_WIN32 += $(MODULEDIR)/juce_audio_processors.win32.a
LIBS_WIN32 += $(MODULEDIR)/juce_core.win32.a
LIBS_WIN32 += $(MODULEDIR)/juce_data_structures.win32.a
LIBS_WIN32 += $(MODULEDIR)/juce_events.win32.a
LIBS_WIN32 += $(MODULEDIR)/juce_graphics.win32.a
LIBS_WIN32 += $(MODULEDIR)/juce_gui_basics.win32.a
LIBS_WIN32 += $(MODULEDIR)/lilv.win32.a
LIBS_WIN32 += $(MODULEDIR)/rtmempool.win32.a

win32: $(LIBS_WIN32)
$(MAKE) -C source/bridges-plugin win32
$(MAKE) -C source/discovery win32

# --------------------------------------------------------------
# ----------------------------------------------------------------------------------------------------------------------------
# Binaries (win64)

LIBS_WIN64 += source/modules/jackbridge.win64e.a
LIBS_WIN64 += source/modules/juce_audio_basics.win64.a
LIBS_WIN64 += source/modules/juce_audio_processors.win64.a
LIBS_WIN64 += source/modules/juce_core.win64.a
LIBS_WIN64 += source/modules/juce_data_structures.win64.a
LIBS_WIN64 += source/modules/juce_events.win64.a
LIBS_WIN64 += source/modules/juce_graphics.win64.a
LIBS_WIN64 += source/modules/juce_gui_basics.win64.a
LIBS_WIN64 += source/modules/lilv.win64.a
LIBS_WIN64 += source/modules/rtmempool.win64.a
LIBS_WIN64 += $(MODULEDIR)/jackbridge.win64e.a
LIBS_WIN64 += $(MODULEDIR)/juce_audio_basics.win64.a
LIBS_WIN64 += $(MODULEDIR)/juce_audio_processors.win64.a
LIBS_WIN64 += $(MODULEDIR)/juce_core.win64.a
LIBS_WIN64 += $(MODULEDIR)/juce_data_structures.win64.a
LIBS_WIN64 += $(MODULEDIR)/juce_events.win64.a
LIBS_WIN64 += $(MODULEDIR)/juce_graphics.win64.a
LIBS_WIN64 += $(MODULEDIR)/juce_gui_basics.win64.a
LIBS_WIN64 += $(MODULEDIR)/lilv.win64.a
LIBS_WIN64 += $(MODULEDIR)/rtmempool.win64.a

win64: $(LIBS_WIN64)
$(MAKE) -C source/bridges-plugin win64
$(MAKE) -C source/discovery win64

# --------------------------------------------------------------
# ----------------------------------------------------------------------------------------------------------------------------
# Binaries (wine)

wine32:
$(MAKE) -C source/modules/jackbridge wine32
cp -f source/modules/jackbridge-wine32.dll.so bin/jackbridge-wine32.dll
cp -f $(MODULEDIR)/jackbridge-wine32.dll.so $(BINDIR)/jackbridge-wine32.dll

wine64:
$(MAKE) -C source/modules/jackbridge wine64
cp -f source/modules/jackbridge-wine64.dll.so bin/jackbridge-wine64.dll
cp -f $(MODULEDIR)/jackbridge-wine64.dll.so $(BINDIR)/jackbridge-wine64.dll

# --------------------------------------------------------------
# ----------------------------------------------------------------------------------------------------------------------------
# Resources

RES = \
@@ -319,7 +340,7 @@ source/resources_rc.py: resources/resources.qrc resources/*/*.png resources/*/*.
bin/resources/%.py: source/%.py
$(LINK) $(CURDIR)/source/$*.py bin/resources/

# --------------------------------------------------------------
# ----------------------------------------------------------------------------------------------------------------------------
# UI code

UIs = \
@@ -347,7 +368,7 @@ UI: $(UIs)
source/ui_%.py: resources/ui/%.ui
$(PYUIC) $< -o $@

# --------------------------------------------------------------
# ----------------------------------------------------------------------------------------------------------------------------
# Widgets

WIDGETS = \
@@ -365,7 +386,7 @@ WIDGETS: $(WIDGETS)
source/%.py: source/widgets/%.py
$(LINK) widgets/$*.py $@

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

clean:
$(MAKE) clean -C source/backend
@@ -379,13 +400,17 @@ clean:
rm -f $(WIDGETS)
rm -f *~ source/*~ source/*.pyc source/*_rc.py source/ui_*.py

distclean: clean
rm -f bin/*.dll bin/*.so
rm -rf build

debug:
$(MAKE) DEBUG=true

doxygen:
$(MAKE) doxygen -C source/backend

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

install:
# Create directories
@@ -594,7 +619,7 @@ endif
# $(DESTDIR)$(PREFIX)/bin/carla-single \
# $(DESTDIR)$(PREFIX)/bin/carla-control \

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

uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/carla*
@@ -612,7 +637,7 @@ uninstall:
rm -rf $(DESTDIR)$(PREFIX)/lib/vst/carla.vst/
rm -rf $(DESTDIR)$(PREFIX)/share/carla/

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

USE_COLORS=true

@@ -804,9 +829,9 @@ else
@echo "ZynAddSubFX: $(ANS_NO) $(mS)fftw3, mxml or zlib missing$(mE)"
endif

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

.FORCE:
.PHONY: .FORCE

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

+ 0
- 1
source/Makefile.mk View File

@@ -14,7 +14,6 @@ CARLA_VESTIGE_HEADER = true
# DO NOT MODIFY PAST THIS POINT!

AR ?= ar
RM ?= rm -f
CC ?= gcc
CXX ?= g++



+ 73
- 69
source/backend/Makefile View File

@@ -7,102 +7,101 @@
CWD=..
include Makefile.mk

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

STANDALONE_LIBS = carla_engine.a
STANDALONE_LIBS += carla_plugin.a
OBJS = \
$(OBJDIR)/CarlaStandalone.cpp.o \
$(OBJDIR)/CarlaUtils.cpp.o

TARGETS = \
$(BINDIR)/libcarla_standalone2$(LIB_EXT) \
$(BINDIR)/libcarla_utils$(LIB_EXT)

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

STANDALONE_LIBS = $(MODULEDIR)/carla_engine.a
STANDALONE_LIBS += $(MODULEDIR)/carla_plugin.a

STANDALONE_LIBS += ../modules/jackbridge.a
STANDALONE_LIBS += ../modules/juce_audio_basics.a
STANDALONE_LIBS += ../modules/juce_audio_formats.a
STANDALONE_LIBS += ../modules/juce_core.a
STANDALONE_LIBS += ../modules/lilv.a
STANDALONE_LIBS += ../modules/native-plugins.a
STANDALONE_LIBS += ../modules/rtmempool.a
STANDALONE_LIBS += $(MODULEDIR)/jackbridge.a
STANDALONE_LIBS += $(MODULEDIR)/juce_audio_basics.a
STANDALONE_LIBS += $(MODULEDIR)/juce_audio_formats.a
STANDALONE_LIBS += $(MODULEDIR)/juce_core.a
STANDALONE_LIBS += $(MODULEDIR)/lilv.a
STANDALONE_LIBS += $(MODULEDIR)/native-plugins.a
STANDALONE_LIBS += $(MODULEDIR)/rtmempool.a

ifeq ($(MACOS_OR_WIN32),true)
STANDALONE_LIBS += ../modules/juce_audio_devices.a
STANDALONE_LIBS += ../modules/juce_audio_processors.a
STANDALONE_LIBS += ../modules/juce_data_structures.a
STANDALONE_LIBS += ../modules/juce_events.a
STANDALONE_LIBS += ../modules/juce_graphics.a
STANDALONE_LIBS += ../modules/juce_gui_basics.a
STANDALONE_LIBS += $(MODULEDIR)/juce_audio_devices.a
STANDALONE_LIBS += $(MODULEDIR)/juce_audio_processors.a
STANDALONE_LIBS += $(MODULEDIR)/juce_data_structures.a
STANDALONE_LIBS += $(MODULEDIR)/juce_events.a
STANDALONE_LIBS += $(MODULEDIR)/juce_graphics.a
STANDALONE_LIBS += $(MODULEDIR)/juce_gui_basics.a
ifeq ($(MACOS),true)
STANDALONE_LIBS += ../modules/juce_gui_extra.a
STANDALONE_LIBS += $(MODULEDIR)/juce_gui_extra.a
endif
else
STANDALONE_LIBS += ../modules/rtaudio.a
STANDALONE_LIBS += ../modules/rtmidi.a
STANDALONE_LIBS += $(MODULEDIR)/rtaudio.a
STANDALONE_LIBS += $(MODULEDIR)/rtmidi.a
endif

UTILS_LIBS = ../modules/juce_core.a
UTILS_LIBS = $(MODULEDIR)/juce_core.a

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

STANDALONE_FLAGS = $(JACKBRIDGE_LIBS)
STANDALONE_FLAGS += $(JUCE_CORE_LIBS)
STANDALONE_FLAGS += $(JUCE_AUDIO_BASICS_LIBS)
STANDALONE_FLAGS += $(JUCE_AUDIO_FORMATS_LIBS)
STANDALONE_FLAGS += $(LIBLO_LIBS)
STANDALONE_FLAGS += $(LILV_LIBS)
STANDALONE_FLAGS += $(NATIVE_PLUGINS_LIBS)
STANDALONE_FLAGS += $(RTMEMPOOL_LIBS)
STANDALONE_LINK_FLAGS = $(JACKBRIDGE_LIBS)
STANDALONE_LINK_FLAGS += $(JUCE_AUDIO_BASICS_LIBS)
STANDALONE_LINK_FLAGS += $(JUCE_AUDIO_FORMATS_LIBS)
STANDALONE_LINK_FLAGS += $(JUCE_CORE_LIBS)
STANDALONE_LINK_FLAGS += $(LIBLO_LIBS)
STANDALONE_LINK_FLAGS += $(LILV_LIBS)
STANDALONE_LINK_FLAGS += $(NATIVE_PLUGINS_LIBS)
STANDALONE_LINK_FLAGS += $(RTMEMPOOL_LIBS)

ifeq ($(MACOS_OR_WIN32),true)
STANDALONE_FLAGS += $(JUCE_AUDIO_DEVICES_LIBS)
STANDALONE_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS)
STANDALONE_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS)
STANDALONE_FLAGS += $(JUCE_EVENTS_LIBS)
STANDALONE_FLAGS += $(JUCE_GRAPHICS_LIBS)
STANDALONE_FLAGS += $(JUCE_GUI_BASICS_LIBS)
STANDALONE_LINK_FLAGS += $(JUCE_AUDIO_DEVICES_LIBS)
STANDALONE_LINK_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS)
STANDALONE_LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS)
STANDALONE_LINK_FLAGS += $(JUCE_EVENTS_LIBS)
STANDALONE_LINK_FLAGS += $(JUCE_GRAPHICS_LIBS)
STANDALONE_LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS)
ifeq ($(MACOS),true)
STANDALONE_FLAGS += $(JUCE_GUI_EXTRA_LIBS)
STANDALONE_LINK_FLAGS += $(JUCE_GUI_EXTRA_LIBS)
endif
else
STANDALONE_FLAGS += $(RTAUDIO_LIBS)
STANDALONE_FLAGS += $(RTMIDI_LIBS)
STANDALONE_LINK_FLAGS += $(RTAUDIO_LIBS)
STANDALONE_LINK_FLAGS += $(RTMIDI_LIBS)
endif

ifeq ($(HAVE_FLUIDSYNTH),true)
STANDALONE_FLAGS += $(FLUIDSYNTH_LIBS)
STANDALONE_LINK_FLAGS += $(FLUIDSYNTH_LIBS)
endif

ifeq ($(HAVE_LINUXSAMPLER),true)
STANDALONE_FLAGS += $(LINUXSAMPLER_LIBS)
STANDALONE_LINK_FLAGS += $(LINUXSAMPLER_LIBS)
endif

ifeq ($(HAVE_X11),true)
STANDALONE_FLAGS += $(X11_LIBS)
STANDALONE_LINK_FLAGS += $(X11_LIBS)
endif

ifeq ($(UNIX),true)
STANDALONE_FLAGS += -lmagic
STANDALONE_LINK_FLAGS += -lmagic
endif

UTILS_FLAGS = $(JUCE_CORE_LIBS)
UTILS_LINK_FLAGS = $(JUCE_CORE_LIBS)
ifneq ($(HAIKU),true)
UTILS_FLAGS += -lpthread
UTILS_LINK_FLAGS += -lpthread
endif

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

OBJS = \
CarlaStandalone.cpp.o \
CarlaUtils.cpp.o

TARGETS = \
../../bin/libcarla_standalone2$(LIB_EXT) \
../../bin/libcarla_utils$(LIB_EXT)

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

all: $(TARGETS)

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

clean:
$(RM) $(OBJS)
$(RM) $(TARGETS)
rm -f $(OBJS) $(TARGETS)
$(MAKE) clean -C engine
$(MAKE) clean -C plugin

@@ -112,20 +111,25 @@ debug:
doxygen: CarlaBackend.doxygen
doxygen $^

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

CarlaStandalone.cpp.o: $(CARLA_STANDALONE_CPP)
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
$(BINDIR)/libcarla_standalone2$(LIB_EXT): $(OBJDIR)/CarlaStandalone.cpp.o $(STANDALONE_LIBS)
-@mkdir -p $(BINDIR)
@echo "Linking libcarla_standalone2$(LIB_EXT)"
@$(CXX) $< $(LIBS_START) $(STANDALONE_LIBS) $(LIBS_END) $(LINK_FLAGS) $(STANDALONE_LINK_FLAGS) $(SHARED) -o $@

CarlaUtils.cpp.o: $(CARLA_UTILS_CPP)
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
$(BINDIR)/libcarla_utils$(LIB_EXT): $(OBJDIR)/CarlaUtils.cpp.o $(UTILS_LIBS)
-@mkdir -p $(BINDIR)
@echo "Linking libcarla_utils$(LIB_EXT)"
@$(CXX) $< $(LIBS_START) $(UTILS_LIBS) $(LIBS_END) $(LINK_FLAGS) $(UTILS_LINK_FLAGS) $(SHARED) -o $@

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

../../bin/libcarla_standalone2$(LIB_EXT): CarlaStandalone.cpp.o $(STANDALONE_LIBS)
$(CXX) $< $(LIBS_START) $(STANDALONE_LIBS) $(LIBS_END) $(LINK_FLAGS) $(STANDALONE_FLAGS) $(SHARED) -o $@
$(OBJDIR)/%.cpp.o: %.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) -MMD -c -o $@

../../bin/libcarla_utils$(LIB_EXT): CarlaUtils.cpp.o $(UTILS_LIBS)
$(CXX) $< $(LIBS_START) $(UTILS_LIBS) $(LIBS_END) $(LINK_FLAGS) $(UTILS_FLAGS) $(SHARED) -o $@
-include $(OBJS:%.cpp.o=%.cpp.d)

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

+ 13
- 2
source/backend/Makefile.mk View File

@@ -5,14 +5,25 @@
#

ifeq ($(CWD),)
CWD=../..
$(error CWD not defined)
endif

include $(CWD)/Makefile.deps
include $(CWD)/Makefile.mk

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

BINDIR := $(CWD)/../bin

ifeq ($(DEBUG),true)
OBJDIR := $(CWD)/../build/backend/Debug
MODULEDIR := $(CWD)/../build/modules/Debug
else
OBJDIR := $(CWD)/../build/backend/Release
MODULEDIR := $(CWD)/../build/modules/Release
endif

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

BUILD_CXX_FLAGS += -I. -I.. -I$(CWD)/includes -I$(CWD)/utils -isystem $(CWD)/modules
BUILD_CXX_FLAGS += $(LIBLO_FLAGS)



+ 51
- 69
source/backend/engine/Makefile View File

@@ -4,103 +4,85 @@
# Created by falkTX
#

CWD=../..
include ../Makefile.mk

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

OBJS = \
CarlaEngine.cpp.o \
CarlaEngineClient.cpp.o \
CarlaEngineData.cpp.o \
CarlaEngineGraph.cpp.o \
CarlaEngineInternal.cpp.o \
CarlaEngineOsc.cpp.o \
CarlaEngineOscSend.cpp.o \
CarlaEnginePorts.cpp.o \
CarlaEngineThread.cpp.o
$(OBJDIR)/CarlaEngine.cpp.o \
$(OBJDIR)/CarlaEngineClient.cpp.o \
$(OBJDIR)/CarlaEngineData.cpp.o \
$(OBJDIR)/CarlaEngineGraph.cpp.o \
$(OBJDIR)/CarlaEngineInternal.cpp.o \
$(OBJDIR)/CarlaEngineOsc.cpp.o \
$(OBJDIR)/CarlaEngineOscSend.cpp.o \
$(OBJDIR)/CarlaEnginePorts.cpp.o \
$(OBJDIR)/CarlaEngineThread.cpp.o

OBJSa = $(OBJS) \
CarlaEngineJack.cpp.o \
CarlaEngineNative.cpp.o
$(OBJDIR)/CarlaEngineJack.cpp.o \
$(OBJDIR)/CarlaEngineNative.cpp.o

ifeq ($(MACOS_OR_WIN32),true)
OBJSa += CarlaEngineJuce.cpp.o
OBJSa += \
$(OBJDIR)/CarlaEngineJuce.cpp.o
else
OBJSa += CarlaEngineRtAudio.cpp.o
OBJSa += \
$(OBJDIR)/CarlaEngineRtAudio.cpp.o
endif

OBJSp = $(OBJS) \
CarlaEngineNative.cpp.exp.o
OBJSp = $(OBJS) \
$(OBJDIR)/CarlaEngineNative.cpp.exp.o

TARGETS = \
../carla_engine.a \
../carla_engine_plugin.a
$(MODULEDIR)/carla_engine.a \
$(MODULEDIR)/carla_engine_plugin.a

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

all: $(TARGETS)

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

clean:
$(RM) $(OBJSa) $(OBJSp)
$(RM) $(TARGETS)
rm -f $(OBJSa) $(OBJSp) $(TARGETS)

debug:
$(MAKE) DEBUG=true

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

../carla_engine.a: $(OBJSa)
$(RM) $@
$(AR) crs $@ $^
$(MODULEDIR)/carla_engine.a: $(OBJSa)
-@mkdir -p $(MODULEDIR)
@echo "Creating carla_engine.a"
@rm -f $@
@$(AR) crs $@ $^

../carla_engine_plugin.a: $(OBJSp)
$(RM) $@
$(AR) crs $@ $^
$(MODULEDIR)/carla_engine_plugin.a: $(OBJSp)
-@mkdir -p $(MODULEDIR)
@echo "Creating carla_engine_plugin.a"
@rm -f $@
@$(AR) crs $@ $^

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

CarlaEngine.cpp.o: CarlaEngine.cpp $(CARLA_ENGINE_CPP_DEPS)
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
$(OBJDIR)/CarlaEngineRtAudio.cpp.o: CarlaEngineRtAudio.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling CarlaEngineRtAudio.cpp"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(RTAUDIO_FLAGS) $(RTMIDI_FLAGS) -MMD -c -o $@

CarlaEngineClient.cpp.o: CarlaEngineClient.cpp $(CARLA_ENGINE_CLIENT_CPP_DEPS)
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
$(OBJDIR)/CarlaEngineNative.cpp.exp.o: CarlaEngineNative.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling CarlaEngineNative.cpp (plugin)"
@$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_EXPORT -MMD -c -o $@

CarlaEngineData.cpp.o: CarlaEngineData.cpp $(CARLA_ENGINE_DATA_CPP_DEPS)
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
$(OBJDIR)/%.cpp.o: %.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) -MMD -c -o $@

CarlaEngineGraph.cpp.o: CarlaEngineGraph.cpp $(CARLA_ENGINE_GRAPH_CPP_DEPS)
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
-include $(OBJSa:%.cpp.o=%.cpp.d)
-include $(OBJDIR)/CarlaEngineNative.cpp.exp.d

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

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

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

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

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

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

CarlaEngineRtAudio.cpp.o: CarlaEngineRtAudio.cpp $(CARLA_ENGINE_RTAUDIO_CPP_DEPS)
$(CXX) $< $(BUILD_CXX_FLAGS) $(RTAUDIO_FLAGS) $(RTMIDI_FLAGS) -c -o $@

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

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

CarlaEngineNative.cpp.exp.o: CarlaEngineNative.cpp $(CARLA_ENGINE_NATIVE_CPP_DEPS)
$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_EXPORT -c -o $@

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

+ 41
- 64
source/backend/plugin/Makefile View File

@@ -4,90 +4,67 @@
# Created by falkTX
#

CWD=../..
include ../Makefile.mk

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

OBJS = \
CarlaPlugin.cpp.o \
CarlaPluginInternal.cpp.o \
CarlaPluginThread.cpp.o \
NativePlugin.cpp.o \
BridgePlugin.cpp.o \
LadspaPlugin.cpp.o \
DssiPlugin.cpp.o \
Lv2Plugin.cpp.o \
VstPlugin.cpp.o \
Vst3Plugin.cpp.o \
AuPlugin.cpp.o \
JucePlugin.cpp.o \
FluidSynthPlugin.cpp.o \
LinuxSamplerPlugin.cpp.o
$(OBJDIR)/CarlaPlugin.cpp.o \
$(OBJDIR)/CarlaPluginInternal.cpp.o \
$(OBJDIR)/CarlaPluginThread.cpp.o \
$(OBJDIR)/NativePlugin.cpp.o \
$(OBJDIR)/BridgePlugin.cpp.o \
$(OBJDIR)/LadspaPlugin.cpp.o \
$(OBJDIR)/DssiPlugin.cpp.o \
$(OBJDIR)/Lv2Plugin.cpp.o \
$(OBJDIR)/VstPlugin.cpp.o \
$(OBJDIR)/Vst3Plugin.cpp.o \
$(OBJDIR)/AuPlugin.cpp.o \
$(OBJDIR)/JucePlugin.cpp.o \
$(OBJDIR)/FluidSynthPlugin.cpp.o \
$(OBJDIR)/LinuxSamplerPlugin.cpp.o

TARGETS = \
../carla_plugin.a
$(MODULEDIR)/carla_plugin.a

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

all: $(TARGETS)

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

clean:
$(RM) $(OBJS)
$(RM) $(TARGETS)
rm -f $(OBJS) $(TARGETS)

debug:
$(MAKE) DEBUG=true

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

../carla_plugin.a: $(OBJS)
$(RM) $@
$(AR) crs $@ $^
$(MODULEDIR)/carla_plugin.a: $(OBJS)
-@mkdir -p $(MODULEDIR)
@echo "Creating carla_plugin.a"
@rm -f $@
@$(AR) crs $@ $^

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

CarlaPlugin.cpp.o: CarlaPlugin.cpp $(CARLA_PLUGIN_CPP_DEPS)
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
$(OBJDIR)/FluidSynthPlugin.cpp.o: FluidSynthPlugin.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(FLUIDSYNTH_FLAGS) -MMD -c -o $@

CarlaPluginInternal.cpp.o: CarlaPluginInternal.cpp $(CARLA_PLUGIN_INTERNAL_CPP_DEPS)
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
$(OBJDIR)/LinuxSamplerPlugin.cpp.o: LinuxSamplerPlugin.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(LINUXSAMPLER_FLAGS) -MMD -c -o $@

CarlaPluginThread.cpp.o: CarlaPluginThread.cpp $(CARLA_PLUGIN_THREAD_CPP_DEPS)
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
$(OBJDIR)/%.cpp.o: %.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) -MMD -c -o $@

NativePlugin.cpp.o: NativePlugin.cpp $(NATIVE_PLUGIN_CPP_DEPS)
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
-include $(OBJS:%.cpp.o=%.cpp.d)

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

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

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

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

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

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

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

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

FluidSynthPlugin.cpp.o: FluidSynthPlugin.cpp $(FLUIDSYNTH_PLUGIN_CPP_DEPS)
$(CXX) $< $(BUILD_CXX_FLAGS) $(FLUIDSYNTH_FLAGS) -c -o $@

LinuxSamplerPlugin.cpp.o: LinuxSamplerPlugin.cpp $(LINUXSAMPLER_PLUGIN_CPP_DEPS)
$(CXX) $< $(BUILD_CXX_FLAGS) $(LINUXSAMPLER_FLAGS) -c -o $@

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

+ 32
- 0
source/modules/Makefile.mk View File

@@ -0,0 +1,32 @@
#!/usr/bin/make -f
# Makefile for carla-modules #
# -------------------------- #
# Created by falkTX
#

ifeq ($(CWD),)
$(error CWD not defined)
endif
ifeq ($(MODULENAME),)
$(error MODULENAME not defined)
endif

include $(CWD)/Makefile.mk

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

BINDIR := $(CWD)/../bin

ifeq ($(DEBUG),true)
OBJDIR := $(CWD)/../build/$(MODULENAME)/Debug
MODULEDIR := $(CWD)/../build/modules/Debug
else
OBJDIR := $(CWD)/../build/$(MODULENAME)/Release
MODULEDIR := $(CWD)/../build/modules/Release
endif

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

BUILD_CXX_FLAGS += -I. -I$(CWD)/includes -I$(CWD)/utils

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

+ 178
- 115
source/modules/jackbridge/Makefile View File

@@ -4,142 +4,205 @@
# Created by falkTX
#

include ../../Makefile.mk
CWD=../..
MODULENAME=jackbridge
include ../Makefile.mk

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

WINECXX ?= wineg++

BUILD_CXX_FLAGS += $(JACKBRIDGE_FLAGS) -I. -I../../includes -I../../utils
BUILD_CXX_FLAGS += $(JACKBRIDGE_FLAGS)
LINK_FLAGS += $(JACKBRIDGE_LIBS)

ifeq ($(MACOS),true)
WINE_32BIT_FLAGS = $(32BIT_FLAGS)
WINE_64BIT_FLAGS = $(64BIT_FLAGS)
WINE_LINK_FLAGS = $(LINK_FLAGS) -ldl -lpthread
else
WINE_32BIT_FLAGS = $(32BIT_FLAGS) -L/usr/lib32/wine -L/usr/lib/i386-linux-gnu/wine
WINE_64BIT_FLAGS = $(64BIT_FLAGS) -L/usr/lib64/wine -L/usr/lib/x86_64-linux-gnu/wine
WINE_LINK_FLAGS = $(LINK_FLAGS) -ldl -lrt -lpthread
endif

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

OBJS = JackBridge1.cpp.o JackBridge2.cpp.o
OBJS_posix32 = JackBridge1.cpp.posix32.o JackBridge2.cpp.posix32.o
OBJS_posix64 = JackBridge1.cpp.posix64.o JackBridge2.cpp.posix64.o
OBJS_win32 = JackBridge1.cpp.win32.o JackBridge2.cpp.win32.o
OBJS_win64 = JackBridge1.cpp.win64.o JackBridge2.cpp.win64.o
OBJS = $(OBJDIR)/JackBridge1.cpp.o $(OBJDIR)/JackBridge2.cpp.o
OBJS_posix32 = $(OBJDIR)/JackBridge1.cpp.posix32.o $(OBJDIR)/JackBridge2.cpp.posix32.o
OBJS_posix64 = $(OBJDIR)/JackBridge1.cpp.posix64.o $(OBJDIR)/JackBridge2.cpp.posix64.o
OBJS_win32 = $(OBJDIR)/JackBridge1.cpp.win32.o $(OBJDIR)/JackBridge2.cpp.win32.o
OBJS_win64 = $(OBJDIR)/JackBridge1.cpp.win64.o $(OBJDIR)/JackBridge2.cpp.win64.o
OBJS_wine32 = $(OBJDIR)/JackBridge1.cpp.wine32.o $(OBJDIR)/JackBridge2.cpp.wine32.o $(OBJDIR)/JackBridge3.cpp.wine32.o
OBJS_wine64 = $(OBJDIR)/JackBridge1.cpp.wine64.o $(OBJDIR)/JackBridge2.cpp.wine64.o $(OBJDIR)/JackBridge3.cpp.wine64.o

OBJS_posix32e = JackBridgeExport.cpp.posix32e.o
OBJS_posix64e = JackBridgeExport.cpp.posix64e.o
OBJS_win64e = JackBridgeExport.cpp.win64e.o
OBJS_win32e = JackBridgeExport.cpp.win32e.o
OBJS_posix32e = $(OBJDIR)/JackBridgeExport.cpp.posix32e.o
OBJS_posix64e = $(OBJDIR)/JackBridgeExport.cpp.posix64e.o
OBJS_win64e = $(OBJDIR)/JackBridgeExport.cpp.win64e.o
OBJS_win32e = $(OBJDIR)/JackBridgeExport.cpp.win32e.o

OBJS_wine32 = JackBridge1.cpp.wine32.o JackBridge2.cpp.wine32.o JackBridge3.cpp.wine32.o
OBJS_wine64 = JackBridge1.cpp.wine64.o JackBridge2.cpp.wine64.o JackBridge3.cpp.wine64.o
# ----------------------------------------------------------------------------------------------------------------------------

# --------------------------------------------------------------
all: $(MODULEDIR)/jackbridge.a

all: ../jackbridge.a
posix32: $(MODULEDIR)/jackbridge.posix32.a
posix64: $(MODULEDIR)/jackbridge.posix64.a
posix32e: $(MODULEDIR)/jackbridge.posix32e.a
posix64e: $(MODULEDIR)/jackbridge.posix64e.a

posix32: ../jackbridge.posix32.a
posix64: ../jackbridge.posix64.a
posix32e: ../jackbridge.posix32e.a
posix64e: ../jackbridge.posix64e.a
win32: $(MODULEDIR)/jackbridge.win32.a
win64: $(MODULEDIR)/jackbridge.win64.a
win32e: $(MODULEDIR)/jackbridge.win32e.a
win64e: $(MODULEDIR)/jackbridge.win64e.a

win32: ../jackbridge.win32.a
win64: ../jackbridge.win64.a
win32e: ../jackbridge.win32e.a
win64e: ../jackbridge.win64e.a
wine32: $(MODULEDIR)/jackbridge-wine32.dll$(LIB_EXT)
wine64: $(MODULEDIR)/jackbridge-wine64.dll$(LIB_EXT)

wine32: ../jackbridge-wine32.dll.so
wine64: ../jackbridge-wine64.dll.so

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

clean:
$(RM) *.o ../jackbridge*.*
rm -f $(OBJDIR)/JackBridge*.o $(MODULEDIR)/jackbridge*.*

debug:
$(MAKE) DEBUG=true

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

../jackbridge.a: $(OBJS)
$(RM) $@
$(AR) crs $@ $^

../jackbridge.posix32.a: $(OBJS_posix32)
$(RM) $@
$(AR) crs $@ $^

../jackbridge.posix64.a: $(OBJS_posix64)
$(RM) $@
$(AR) crs $@ $^

../jackbridge.win32.a: $(OBJS_win32)
$(RM) $@
$(AR) crs $@ $^

../jackbridge.win64.a: $(OBJS_win64)
$(RM) $@
$(AR) crs $@ $^

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

../jackbridge.posix32e.a: $(OBJS_posix32e)
$(RM) $@
$(AR) crs $@ $^

../jackbridge.posix64e.a: $(OBJS_posix64e)
$(RM) $@
$(AR) crs $@ $^

../jackbridge.win32e.a: $(OBJS_win32e)
$(RM) $@
$(AR) crs $@ $^

../jackbridge.win64e.a: $(OBJS_win64e)
$(RM) $@
$(AR) crs $@ $^

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

../jackbridge-wine32.dll.so: $(OBJS_wine32) JackBridgeExport.def
$(WINECXX) $^ -shared $(WINE_32BIT_FLAGS) $(WINE_LINK_FLAGS) -o $@

../jackbridge-wine64.dll.so: $(OBJS_wine64) JackBridgeExport.def
$(WINECXX) $^ -shared $(WINE_64BIT_FLAGS) $(WINE_LINK_FLAGS) -o $@

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

JackBridge1.cpp.o: JackBridge1.cpp JackBridge.hpp
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@

JackBridge2.cpp.o: JackBridge2.cpp JackBridge.hpp
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@

JackBridgeExport.cpp.%32e.o: JackBridgeExport.cpp JackBridgeExport.hpp JackBridge.hpp
$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -fpermissive -c -o $@

JackBridgeExport.cpp.%64e.o: JackBridgeExport.cpp JackBridgeExport.hpp JackBridge.hpp
$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -fpermissive -c -o $@

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

%.posix32.o: %
$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@

%.posix64.o: %
$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@

%.win32.o: %
$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@

%.win64.o: %
$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@

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

%.wine32.o: %
$(WINECXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@

%.wine64.o: %
$(WINECXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@

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

$(MODULEDIR)/jackbridge.a: $(OBJS)
-@mkdir -p $(MODULEDIR)
@echo "Creating jackbridge.a"
@rm -f $@
@$(AR) crs $@ $^

$(MODULEDIR)/jackbridge.posix32.a: $(OBJS_posix32)
-@mkdir -p $(MODULEDIR)
@echo "Creating jackbridge.posix32.a"
@rm -f $@
@$(AR) crs $@ $^

$(MODULEDIR)/jackbridge.posix64.a: $(OBJS_posix64)
-@mkdir -p $(MODULEDIR)
@echo "Creating jackbridge.posix64.a"
@rm -f $@
@$(AR) crs $@ $^

$(MODULEDIR)/jackbridge.win32.a: $(OBJS_win32)
-@mkdir -p $(MODULEDIR)
@echo "Creating jackbridge.win32.a"
@rm -f $@
@$(AR) crs $@ $^

$(MODULEDIR)/jackbridge.win64.a: $(OBJS_win64)
-@mkdir -p $(MODULEDIR)
@echo "Creating jackbridge.win64.a"
@rm -f $@
@$(AR) crs $@ $^

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

$(MODULEDIR)/jackbridge.posix32e.a: $(OBJS_posix32e)
-@mkdir -p $(MODULEDIR)
@echo "Creating jackbridge.posix32e.a"
@rm -f $@
@$(AR) crs $@ $^

$(MODULEDIR)/jackbridge.posix64e.a: $(OBJS_posix64e)
-@mkdir -p $(MODULEDIR)
@echo "Creating jackbridge.posix64e.a"
@rm -f $@
@$(AR) crs $@ $^

$(MODULEDIR)/jackbridge.win32e.a: $(OBJS_win32e)
-@mkdir -p $(MODULEDIR)
@echo "Creating jackbridge.win32e.a"
@rm -f $@
@$(AR) crs $@ $^

$(MODULEDIR)/jackbridge.win64e.a: $(OBJS_win64e)
-@mkdir -p $(MODULEDIR)
@echo "Creating jackbridge.win64e.a"
@rm -f $@
@$(AR) crs $@ $^

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

$(MODULEDIR)/jackbridge-wine32.dll$(LIB_EXT): $(OBJS_wine32) JackBridgeExport.def
-@mkdir -p $(MODULEDIR)
@echo "Linking jackbridge-wine32.dll$(LIB_EXT)"
@$(WINECXX) $^ $(WINE_32BIT_FLAGS) $(WINE_LINK_FLAGS) $(SHARED) -o $@

$(MODULEDIR)/jackbridge-wine64.dll$(LIB_EXT): $(OBJS_wine64) JackBridgeExport.def
-@mkdir -p $(MODULEDIR)
@echo "Linking jackbridge-wine64.dll$(LIB_EXT)"
@$(WINECXX) $^ $(WINE_64BIT_FLAGS) $(WINE_LINK_FLAGS) $(SHARED) -o $@

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

$(OBJDIR)/JackBridge1.cpp.o: JackBridge1.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling JackBridge1.cpp"
@$(CXX) $< $(BUILD_CXX_FLAGS) -MMD -c -o $@

$(OBJDIR)/JackBridge2.cpp.o: JackBridge2.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling JackBridge2.cpp"
@$(CXX) $< $(BUILD_CXX_FLAGS) -MMD -c -o $@

-include $(OBJS:%.cpp.o=%.cpp.d)

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

$(OBJDIR)/JackBridgeExport.cpp.%32e.o: JackBridgeExport.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -MMD -fpermissive -c -o $@

$(OBJDIR)/JackBridgeExport.cpp.%64e.o: JackBridgeExport.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -MMD -fpermissive -c -o $@

-include $(OBJDIR)/JackBridgeExport.cpp.posix32e.d
-include $(OBJDIR)/JackBridgeExport.cpp.posix64e.d
-include $(OBJDIR)/JackBridgeExport.cpp.win32e.d
-include $(OBJDIR)/JackBridgeExport.cpp.win64e.d

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

$(OBJDIR)/%.cpp.posix32.o: %.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $< (posix32)"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -MMD -c -o $@

$(OBJDIR)/%.cpp.posix64.o: %.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $< (posix64)"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -MMD -c -o $@

$(OBJDIR)/%.cpp.win32.o: %.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $< (win32)"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -MMD -c -o $@

$(OBJDIR)/%.cpp.win64.o: %.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $< (win64)"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -MMD -c -o $@

$(OBJDIR)/%.cpp.wine32.o: %.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $< (wine32)"
@$(WINECXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -MMD -c -o $@

$(OBJDIR)/%.cpp.wine64.o: %.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $< (wine64)"
@$(WINECXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -MMD -c -o $@

-include $(OBJS_posix32:%.cpp.posix32.o=%.cpp.posix32.d)
-include $(OBJS_posix64:%.cpp.posix64.o=%.cpp.posix64.d)
-include $(OBJS_win32:%.cpp.win32.o=%.cpp.win32.d)
-include $(OBJS_win64:%.cpp.win64.o=%.cpp.win64.d)
-include $(OBJS_wine32:%.cpp.wine32.o=%.cpp.wine32.d)
-include $(OBJS_wine64:%.cpp.wine64.o=%.cpp.wine64.d)

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

Loading…
Cancel
Save