2 # Makefile for carla-bridges-ui #
3 # ----------------------------- #
8 MODULENAME
=carla-bridge
9 include $(CWD
)/Makefile.mk
11 # ---------------------------------------------------------------------------------------------------------------------
13 BINDIR
:= $(CWD
)/..
/bin
16 OBJDIR
:= $(CWD
)/..
/build
/bridges-ui
/Debug
17 MODULEDIR
:= $(CWD
)/..
/build
/modules
/Debug
19 OBJDIR
:= $(CWD
)/..
/build
/bridges-ui
/Release
20 MODULEDIR
:= $(CWD
)/..
/build
/modules
/Release
23 # ---------------------------------------------------------------------------------------------------------------------
25 BUILD_CXX_FLAGS
+= -DBUILD_BRIDGE
-DBUILD_BRIDGE_UI
-I.
-I
$(CWD
)/backend
-I
$(CWD
)/includes
-I
$(CWD
)/utils
-I
$(CWD
)/modules
26 LINK_FLAGS
+= $(WATER_LIBS
)
30 LINK_FLAGS
+= -lpthread
32 LINK_FLAGS
+= -pthread
36 # ---------------------------------------------------------------------------------------------------------------------
38 BUILD_GTK2_FLAGS
= $(BUILD_CXX_FLAGS
) -DBRIDGE_GTK2
$(X11_FLAGS
)
39 LINK_GTK2_FLAGS
= $(LINK_FLAGS
) $(X11_LIBS
) $(LIBDL_LIBS
)
41 BUILD_GTK3_FLAGS
= $(BUILD_CXX_FLAGS
) -DBRIDGE_GTK3
$(X11_FLAGS
)
42 LINK_GTK3_FLAGS
= $(LINK_FLAGS
) $(X11_LIBS
) $(LIBDL_LIBS
)
44 BUILD_QT4_FLAGS
= $(BUILD_CXX_FLAGS
) -DBRIDGE_QT4
$(shell pkg-config
--cflags QtCore QtGui
) $(X11_FLAGS
) -I
$(OBJDIR
) -I
$(CWD
)/theme
-Wno-unused-variable
45 LINK_QT4_FLAGS
= $(LINK_FLAGS
) $(shell pkg-config
--libs QtCore QtGui
) $(X11_LIBS
) $(LIBDL_LIBS
)
47 BUILD_QT5_FLAGS
= $(BUILD_CXX_FLAGS
) -DBRIDGE_QT5
$(shell pkg-config
--cflags Qt5Core Qt5Gui Qt5Widgets
) -I
$(OBJDIR
) -I
$(CWD
)/theme
48 LINK_QT5_FLAGS
= $(LINK_FLAGS
) $(shell pkg-config
--libs Qt5Core Qt5Gui Qt5Widgets
) $(LIBDL_LIBS
)
50 BUILD_X11_FLAGS
= $(BUILD_CXX_FLAGS
) -DBRIDGE_X11
$(X11_FLAGS
)
51 LINK_X11_FLAGS
= $(LINK_FLAGS
) $(X11_LIBS
) $(LIBDL_LIBS
)
53 BUILD_COCOA_FLAGS
= $(BUILD_CXX_FLAGS
) -DBRIDGE_COCOA
-ObjC
++
54 LINK_COCOA_FLAGS
= $(LINK_FLAGS
) -framework Cocoa
$(LIBDL_LIBS
)
56 BUILD_WINDOWS_FLAGS
= $(BUILD_CXX_FLAGS
) -DBRIDGE_HWND
57 LINK_WINDOWS_FLAGS
= $(LINK_FLAGS
) -static
-mwindows
60 BUILD_GTK2_FLAGS
+= -ObjC
++
61 BUILD_GTK3_FLAGS
+= -ObjC
++
64 ifeq ($(TESTBUILD
),true
)
65 BUILD_QT4_FLAGS
+= -isystem
/usr
/include/qt4
66 BUILD_QT5_FLAGS
+= -isystem
/usr
/include/qt5
67 BUILD_QT5_FLAGS
+= -isystem
/usr
/include/x86_64-linux-gnu
/qt5
70 # ---------------------------------------------------------------------------------------------------------------------
72 TARGETS
+= ui_lv2-gtk2
73 TARGETS
+= ui_lv2-gtk3
75 ifneq ($(MACOS_OR_WINDOWS
),true
)
76 ifeq ($(HAVE_QT4
),true
)
80 ifeq ($(HAVE_QT5
),true
)
84 ifeq ($(HAVE_X11
),true
)
90 TARGETS
+= ui_lv2-cocoa
93 ifeq ($(WINDOWS
),true
)
94 TARGETS
+= ui_lv2-windows
97 # ---------------------------------------------------------------------------------------------------------------------
101 # ---------------------------------------------------------------------------------------------------------------------
104 rm -f
$(OBJDIR
)/*.
cpp $(OBJDIR
)/*.moc
$(OBJDIR
)/*.o
105 rm -f
$(BINDIR
)/$(MODULENAME
)-lv2-gtk
*
106 rm -f
$(BINDIR
)/$(MODULENAME
)-lv2-qt
*
107 rm -f
$(BINDIR
)/$(MODULENAME
)-lv2-cocoa
108 rm -f
$(BINDIR
)/$(MODULENAME
)-lv2-x11
109 rm -f
$(BINDIR
)/$(MODULENAME
)-lv2-windows
114 doxygen
: carla_bridge.doxygen
117 # ---------------------------------------------------------------------------------------------------------------------
119 ui_lv2-gtk2
: $(BINDIR
)/$(MODULENAME
)-lv2-gtk2
$(APP_EXT
)
120 ui_lv2-gtk3
: $(BINDIR
)/$(MODULENAME
)-lv2-gtk3
$(APP_EXT
)
121 ui_lv2-qt4
: $(BINDIR
)/$(MODULENAME
)-lv2-qt4
$(APP_EXT
)
122 ui_lv2-qt5
: $(BINDIR
)/$(MODULENAME
)-lv2-qt5
$(APP_EXT
)
123 ui_lv2-x11
: $(BINDIR
)/$(MODULENAME
)-lv2-x11
$(APP_EXT
)
124 ui_lv2-cocoa
: $(BINDIR
)/$(MODULENAME
)-lv2-cocoa
$(APP_EXT
)
125 ui_lv2-windows
: $(BINDIR
)/$(MODULENAME
)-lv2-windows
$(APP_EXT
)
127 # ---------------------------------------------------------------------------------------------------------------------
131 $(MODULEDIR
)/lilv.a \
132 $(MODULEDIR
)/water.files.a
134 # ---------------------------------------------------------------------------------------------------------------------
137 $(OBJDIR
)/%.
cpp.o
: %.
cpp
140 $(SILENT
)$(CXX
) $< $(BUILD_CXX_FLAGS
) -c
-o
$@
142 # ---------------------------------------------------------------------------------------------------------------------
146 $(OBJDIR
)/CarlaBridgeFormat.
cpp.o \
147 $(OBJDIR
)/CarlaBridgeFormatLV2.cpp-gtk2.o \
148 $(OBJDIR
)/CarlaBridgeToolkitGtk.cpp-gtk2.o
150 $(BINDIR
)/$(MODULENAME
)-lv2-gtk2
$(APP_EXT
): $(OBJS_GTK2
) $(LIBS
)
152 @echo
"Linking $(MODULENAME)-lv2-gtk2$(APP_EXT)"
153 $(SILENT
)$(CXX
) $(OBJS_GTK2
) $(BUILD_CXX_FLAGS
) $(LIBS_START
) $(LIBS
) $(LIBS_END
) $(LINK_GTK2_FLAGS
) -o
$@
155 $(OBJDIR
)/%.cpp-gtk2.o
: %.
cpp
157 @echo
"Compiling $< (GTK2)"
158 $(SILENT
)$(CXX
) $< $(BUILD_GTK2_FLAGS
) -c
-o
$@
160 -include $(OBJS_GTK2
:%.o
=%.d
)
162 # ---------------------------------------------------------------------------------------------------------------------
166 $(OBJDIR
)/CarlaBridgeFormat.
cpp.o \
167 $(OBJDIR
)/CarlaBridgeFormatLV2.cpp-gtk3.o \
168 $(OBJDIR
)/CarlaBridgeToolkitGtk.cpp-gtk3.o
170 $(BINDIR
)/$(MODULENAME
)-lv2-gtk3
$(APP_EXT
): $(OBJS_GTK3
) $(LIBS
)
172 @echo
"Linking $(MODULENAME)-lv2-gtk3$(APP_EXT)"
173 $(SILENT
)$(CXX
) $(OBJS_GTK3
) $(BUILD_CXX_FLAGS
) $(LIBS_START
) $(LIBS
) $(LIBS_END
) $(LINK_GTK3_FLAGS
) -o
$@
175 $(OBJDIR
)/%.cpp-gtk3.o
: %.
cpp
177 @echo
"Compiling $< (GTK3)"
178 $(SILENT
)$(CXX
) $< $(BUILD_GTK3_FLAGS
) -c
-o
$@
180 -include $(OBJS_GTK3
:%.o
=%.d
)
182 # ---------------------------------------------------------------------------------------------------------------------
186 $(OBJDIR
)/CarlaBridgeFormat.
cpp.o \
187 $(OBJDIR
)/CarlaBridgeFormatLV2.cpp-qt4.o \
188 $(OBJDIR
)/CarlaBridgeToolkitQt.cpp-qt4.o
190 $(BINDIR
)/$(MODULENAME
)-lv2-qt4
$(APP_EXT
): $(OBJS_QT4
) $(LIBS
) $(MODULEDIR
)/theme.qt4.a
192 @echo
"Linking $(MODULENAME)-lv2-qt4$(APP_EXT)"
193 $(SILENT
)$(CXX
) $(OBJS_QT4
) $(BUILD_CXX_FLAGS
) $(LIBS_START
) $(LIBS
) $(LIBS_END
) $(MODULEDIR
)/theme.qt4.a
$(LINK_QT4_FLAGS
) -o
$@
195 $(OBJDIR
)/%.cpp-qt4.o
: %.
cpp $(OBJDIR
)/CarlaBridgeToolkitQt4.moc
$(OBJDIR
)/resources.qt4.
cpp
197 @echo
"Compiling $< (QT4)"
198 $(SILENT
)$(CXX
) $< $(BUILD_QT4_FLAGS
) -c
-o
$@
200 $(OBJDIR
)/CarlaBridgeToolkitQt4.moc
: CarlaBridgeToolkitQt.
cpp
202 @echo
"Generating CarlaBridgeToolkitQt4.moc"
203 $(SILENT
)$(MOC_QT4
) $< -DMOC_PARSING
-o
$@
205 $(OBJDIR
)/resources.qt4.
cpp: ..
/..
/resources
/resources-theme.qrc
207 @echo
"Generating resources.qt4.cpp"
208 $(SILENT
)$(RCC_QT4
) $< -o
$@
210 -include $(OBJS_QT4
:%.o
=%.d
)
212 # ---------------------------------------------------------------------------------------------------------------------
216 $(OBJDIR
)/CarlaBridgeFormat.
cpp.o \
217 $(OBJDIR
)/CarlaBridgeFormatLV2.cpp-qt5.o \
218 $(OBJDIR
)/CarlaBridgeToolkitQt.cpp-qt5.o
220 $(BINDIR
)/$(MODULENAME
)-lv2-qt5
$(APP_EXT
): $(OBJS_QT5
) $(LIBS
) $(MODULEDIR
)/theme.qt5.a
222 @echo
"Linking $(MODULENAME)-lv2-qt5$(APP_EXT)"
223 $(SILENT
)$(CXX
) $(OBJS_QT5
) $(BUILD_CXX_FLAGS
) $(LIBS_START
) $(LIBS
) $(LIBS_END
) $(MODULEDIR
)/theme.qt5.a
$(LINK_QT5_FLAGS
) -o
$@
225 $(OBJDIR
)/%.cpp-qt5.o
: %.
cpp $(OBJDIR
)/CarlaBridgeToolkitQt5.moc
$(OBJDIR
)/resources.qt5.
cpp
227 @echo
"Compiling $< (QT5)"
228 $(SILENT
)$(CXX
) $< $(BUILD_QT5_FLAGS
) -c
-o
$@
230 $(OBJDIR
)/CarlaBridgeToolkitQt5.moc
: CarlaBridgeToolkitQt.
cpp
232 @echo
"Generating CarlaBridgeToolkitQt5.moc"
233 $(SILENT
)$(MOC_QT5
) $< -DMOC_PARSING
-o
$@
235 $(OBJDIR
)/resources.qt5.
cpp: ..
/..
/resources
/resources-theme.qrc
237 @echo
"Generating resources.qt5.cpp"
238 $(SILENT
)$(RCC_QT5
) $< -o
$@
240 -include $(OBJS_QT5
:%.o
=%.d
)
242 # ---------------------------------------------------------------------------------------------------------------------
246 $(OBJDIR
)/CarlaBridgeFormat.
cpp.o \
247 $(OBJDIR
)/CarlaBridgeFormatLV2.cpp-x11.o \
248 $(OBJDIR
)/CarlaBridgeToolkitNative.cpp-x11.o
250 $(BINDIR
)/$(MODULENAME
)-lv2-x11
$(APP_EXT
): $(OBJS_X11
) $(LIBS
)
252 @echo
"Linking $(MODULENAME)-lv2-x11$(APP_EXT)"
253 $(SILENT
)$(CXX
) $(OBJS_X11
) $(BUILD_CXX_FLAGS
) $(LIBS_START
) $(LIBS
) $(LIBS_END
) $(LINK_X11_FLAGS
) -o
$@
255 $(OBJDIR
)/%.cpp-x11.o
: %.
cpp
257 @echo
"Compiling $< (X11)"
258 $(SILENT
)$(CXX
) $< $(BUILD_X11_FLAGS
) -c
-o
$@
260 -include $(OBJS_X11
:%.o
=%.d
)
262 # ---------------------------------------------------------------------------------------------------------------------
266 $(OBJDIR
)/CarlaBridgeFormat.
cpp.o \
267 $(OBJDIR
)/CarlaBridgeFormatLV2.cpp-cocoa.o \
268 $(OBJDIR
)/CarlaBridgeToolkitNative.cpp-cocoa.o
270 $(BINDIR
)/$(MODULENAME
)-lv2-cocoa
$(APP_EXT
): $(OBJS_COCOA
) $(LIBS
)
272 @echo
"Linking $(MODULENAME)-lv2-cocoa$(APP_EXT)"
273 $(SILENT
)$(CXX
) $(OBJS_COCOA
) $(BUILD_CXX_FLAGS
) $(LIBS_START
) $(LIBS
) $(LIBS_END
) $(LINK_COCOA_FLAGS
) -o
$@
275 $(OBJDIR
)/%.cpp-cocoa.o
: %.
cpp
277 @echo
"Compiling $< (Cocoa)"
278 $(SILENT
)$(CXX
) $< $(BUILD_COCOA_FLAGS
) -c
-o
$@
280 -include $(OBJS_COCOA
:%.o
=%.d
)
282 # ---------------------------------------------------------------------------------------------------------------------
286 $(OBJDIR
)/CarlaBridgeFormat.
cpp.o \
287 $(OBJDIR
)/CarlaBridgeFormatLV2.cpp-windows.o \
288 $(OBJDIR
)/CarlaBridgeToolkitNative.cpp-windows.o
290 $(BINDIR
)/$(MODULENAME
)-lv2-windows
$(APP_EXT
): $(OBJS_WINDOWS
) $(LIBS
)
292 @echo
"Linking $(MODULENAME)-lv2-windows$(APP_EXT)"
293 $(SILENT
)$(CXX
) $(OBJS_WINDOWS
) $(BUILD_CXX_FLAGS
) $(LIBS_START
) $(LIBS
) $(LIBS_END
) $(LINK_WINDOWS_FLAGS
) -o
$@
295 $(OBJDIR
)/%.cpp-windows.o
: %.
cpp
297 @echo
"Compiling $< (Windows)"
298 $(SILENT
)$(CXX
) $< $(BUILD_WINDOWS_FLAGS
) -c
-o
$@
300 -include $(OBJS_WINDOWS
:%.o
=%.d
)
302 # ---------------------------------------------------------------------------------------------------------------------