2 # Makefile for carla-frontend #
3 # --------------------------- #
8 include $(CWD
)/Makefile.mk
10 # ---------------------------------------------------------------------------------------------------------------------
12 BINDIR
:= $(CWD
)/..
/bin
13 RESDIR
:= $(CWD
)/..
/resources
16 OBJDIR
:= $(CWD
)/..
/build
/frontend
/Debug
18 OBJDIR
:= $(CWD
)/..
/build
/frontend
/Release
21 # ---------------------------------------------------------------------------------------------------------------------
23 BUILD_CXX_FLAGS
+= -I.
-Iutils
25 BUILD_CXX_FLAGS
+= -I..
/backend
26 BUILD_CXX_FLAGS
+= -I..
/includes
27 BUILD_CXX_FLAGS
+= -I..
/modules
28 BUILD_CXX_FLAGS
+= -I..
/utils
30 # ---------------------------------------------------------------------------------------------------------------------
32 ifeq ($(WINDOWS
),true
)
33 QT5_LINK_FLAGS
= $(shell echo
$(LINK_FLAGS
) | awk
'sub(" -static","")')
35 QT5_LINK_FLAGS
= $(LINK_FLAGS
)
38 ifeq ($(HAVE_QT5
),true
)
39 QT5_PREFIX
= $(shell $(PKG_CONFIG
) --variable
=prefix Qt5Core
)
40 BUILD_CXX_FLAGS
+= $(shell $(PKG_CONFIG
) --cflags Qt5Core Qt5Gui Qt5Widgets
)
41 QT5_LINK_FLAGS
+= -Wl
,-rpath
,$(QT5_PREFIX
)/lib
$(shell $(PKG_CONFIG
) --libs Qt5Core Qt5Gui Qt5Widgets
)
42 else ifeq ($(HAVE_QT5PKG
),true
)
43 QT5_PREFIX
= $(shell $(PKG_CONFIG
) --variable
=prefix Qt5OpenGLExtensions
)
44 BUILD_CXX_FLAGS
+= -DQT_CORE_LIB
-DQT_GUI_LIB
-DQT_WIDGETS_LIB
-I
$(QT5_PREFIX
)/include/qt5
45 QT5_LINK_FLAGS
+= -Wl
,-rpath
,$(QT5_PREFIX
)/lib
-F
$(QT5_PREFIX
)/lib
-framework QtCore
-framework QtGui
-framework QtWidgets
47 $(error Trying to build frontend without Qt5
, cannot continue
)
50 ifeq ($(WINDOWS
),true
)
51 QT5_LINK_FLAGS
+= -L
$(BINDIR
) $(BINDIR
)/libcarla_utils.dll
53 QT5_LINK_FLAGS
+= -L
$(BINDIR
) -lcarla_utils
57 QT5_LINK_FLAGS
+= -install_name @rpath
/libcarla_frontend.dylib
58 # FIXME this does not work: -Wl,-rpath,@loader_path
60 QT5_LINK_FLAGS
+= -Wl
,-rpath
,'$${ORIGIN}'
63 # ---------------------------------------------------------------------------------------------------------------------
66 TSs
= $(patsubst %,translations
/carla_
%.ts
,$(I18N_LANGUAGES
))
67 QMs
= $(patsubst %,translations
/carla_
%.qm
,$(I18N_LANGUAGES
))
69 # ---------------------------------------------------------------------------------------------------------------------
74 dialogs
/aboutjucedialog.
cpp \
75 dialogs
/jackappdialog.
cpp \
76 pluginlist
/pluginlistdialog.
cpp
78 OBJS
= $(CPP_FILES
:%=$(OBJDIR
)/%.o
)
80 # ---------------------------------------------------------------------------------------------------------------------
85 $(BINDIR
)/resources
/modgui \
86 $(BINDIR
)/resources
/patchcanvas \
87 $(BINDIR
)/resources
/widgets \
88 $(BINDIR
)/resources
/bigmeter-ui \
89 $(BINDIR
)/resources
/carla-plugin \
90 $(BINDIR
)/resources
/carla-plugin-patchbay \
91 $(BINDIR
)/resources
/carla_app.py \
92 $(BINDIR
)/resources
/carla_backend.py \
93 $(BINDIR
)/resources
/carla_backend_qt.py \
94 $(BINDIR
)/resources
/carla_host.py \
95 $(BINDIR
)/resources
/carla_host_control.py \
96 $(BINDIR
)/resources
/carla_modgui.py \
97 $(BINDIR
)/resources
/carla_settings.py \
98 $(BINDIR
)/resources
/carla_skin.py \
99 $(BINDIR
)/resources
/carla_shared.py \
100 $(BINDIR
)/resources
/carla_utils.py \
101 $(BINDIR
)/resources
/carla_widgets.py \
102 $(BINDIR
)/resources
/externalui.py \
103 $(BINDIR
)/resources
/midipattern-ui \
104 $(BINDIR
)/resources
/notes-ui \
105 $(BINDIR
)/resources
/xycontroller-ui \
106 $(BINDIR
)/resources
/resources_rc.py \
107 $(BINDIR
)/resources
/ui_carla_about.py \
108 $(BINDIR
)/resources
/ui_carla_edit.py \
109 $(BINDIR
)/resources
/ui_carla_host.py \
110 $(BINDIR
)/resources
/ui_carla_osc_connect.py \
111 $(BINDIR
)/resources
/ui_carla_parameter.py \
112 $(BINDIR
)/resources
/ui_carla_plugin_calf.py \
113 $(BINDIR
)/resources
/ui_carla_plugin_classic.py \
114 $(BINDIR
)/resources
/ui_carla_plugin_compact.py \
115 $(BINDIR
)/resources
/ui_carla_plugin_default.py \
116 $(BINDIR
)/resources
/ui_carla_plugin_presets.py \
117 $(BINDIR
)/resources
/ui_carla_settings.py \
118 $(BINDIR
)/resources
/ui_carla_settings_driver.py \
119 $(BINDIR
)/resources
/ui_inputdialog_value.py \
120 $(BINDIR
)/resources
/ui_midipattern.py \
121 $(BINDIR
)/resources
/ui_xycontroller.py
123 ifneq ($(SKIP_ZYN_SYNTH
),true
)
124 ifeq ($(HAVE_ZYN_UI_DEPS
),true
)
126 $(BINDIR
)/resources
/zynaddsubfx \
127 $(BINDIR
)/resources
/zynaddsubfx-ui
131 # ---------------------------------------------------------------------------------------------------------------------
134 DIALOG_UI_FILES
= $(wildcard dialogs
/*.ui
)
135 PLUGINLIST_UI_FILES
= $(wildcard pluginlist
/*.ui
)
137 UIs
= $(DIALOG_UI_FILES
:dialogs
/%.ui
=dialogs
/ui_
%.h
)
138 UIs
+= $(PLUGINLIST_UI_FILES
:pluginlist
/%.ui
=pluginlist
/ui_
%.h
)
140 UIs
+= $(DIALOG_UI_FILES
:%.ui
=%_ui.py
)
142 # old stuff, not yet converted
147 ui_carla_osc_connect.py \
148 ui_carla_parameter.py \
149 ui_carla_plugin_calf.py \
150 ui_carla_plugin_classic.py \
151 ui_carla_plugin_compact.py \
152 ui_carla_plugin_default.py \
153 ui_carla_plugin_presets.py \
154 ui_carla_settings.py \
155 ui_carla_settings_driver.py \
156 ui_inputdialog_value.py \
160 # ---------------------------------------------------------------------------------------------------------------------
162 all: $(BINDIR
)/libcarla_frontend
$(LIB_EXT
) $(QMs
) $(RES
) $(UIs
)
164 # ---------------------------------------------------------------------------------------------------------------------
166 dialogs
/ui_
%.h
: dialogs
/%.ui
169 pluginlist
/ui_
%.h
: pluginlist
/%.ui
175 ui_
%.py
: $(RESDIR
)/ui
/%.ui
178 resources_rc.py
: $(RESDIR
)/resources.qrc
$(RESDIR
)/*/*.png
$(RESDIR
)/*/*.svg
$(RESDIR
)/*/*.svgz
181 test: $(OBJS
) $(LIBS
) test.
cpp
183 $(SILENT
)$(CXX
) $(OBJS
) test.
cpp $(BUILD_CXX_FLAGS
) -Wl
,-rpath
,$(abspath
$(BINDIR
)) $(QT5_LINK_FLAGS
) -o
$@
185 $(BINDIR
)/resources
/%: %
186 -@mkdir
-p
$(BINDIR
)/resources
187 $(LINK
) $(CURDIR
)/$* $(BINDIR
)/resources
/
189 $(BINDIR
)/resources
/zynaddsubfx
: ..
/native-plugins
/resources
/zynaddsubfx
190 -@mkdir
-p
$(BINDIR
)/resources
191 $(LINK
) $(CURDIR
)/$< $(BINDIR
)/resources
/
193 $(BINDIR
)/resources
/zynaddsubfx-ui
: ..
/native-plugins
/resources
/zynaddsubfx-ui
194 -@mkdir
-p
$(BINDIR
)/resources
195 $(LINK
) $(CURDIR
)/$< $(BINDIR
)/resources
/
197 # ---------------------------------------------------------------------------------------------------------------------
199 $(BINDIR
)/libcarla_frontend
$(LIB_EXT
): $(OBJS
) $(LIBS
)
201 @echo
"Linking libcarla_frontend$(LIB_EXT)"
202 $(SILENT
)$(CXX
) $(OBJS
) $(BUILD_CXX_FLAGS
) $(QT5_LINK_FLAGS
) $(SHARED
) -o
$@
204 # FIXME this does not work: -Wl,-rpath,@loader_path
205 $(SILENT
)install_name_tool
-change ..
/..
/..
/bin
/libcarla_utils.dylib @loader_path
/libcarla_utils.dylib
$@
208 $(OBJDIR
)/%.
cpp.o
: %.
cpp $(UIs
)
209 -@mkdir
-p
$(shell dirname
$@
)
211 $(SILENT
)$(CXX
) $< $(BUILD_CXX_FLAGS
) -c
-o
$@
213 -include $(OBJS
:%.o
=%.d
)
215 # ---------------------------------------------------------------------------------------------------------------------
218 rm -rf
$(BINDIR
)/libcarla_frontend
$(LIB_EXT
) $(UIs
) $(RES
) $(QMs
) __pycache__
*.pyc
220 rm -f ui_carla_about_juce.py
221 rm -f ui_carla_add_jack.py
222 rm -f ui_carla_database.py
223 rm -f ui_carla_refresh.py
228 # ---------------------------------------------------------------------------------------------------------------------
232 --extension-pkg-whitelist
=PyQt5 \
233 --max-line-length
=120 \
235 --max-statements
=100 \
236 --disable
=bare-except
,duplicate-code
,invalid-name
,missing-docstring
,too-many-branches
,too-many-instance-attributes
,too-many-statements \
237 $(wildcard widgets
/*.py
)
239 # ---------------------------------------------------------------------------------------------------------------------
245 @
install -d translations
246 pylupdate5
*.py
$(RESDIR
)/ui
/*.ui
-ts
$@
251 # ---------------------------------------------------------------------------------------------------------------------