-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
100 lines (76 loc) · 2.06 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/usr/bin/make -f
# Makefile for HoustonPatchbay #
# ---------------------- #
# Created by houston4444
#
LRELEASE ?= lrelease
QT_VERSION ?= 5
PYRCC := pyrcc5
# if you set QT_VERSION environment variable to 6 at the make command
# it will choose the other commands QT_API, pyuic6, pylupdate6.
ifeq ($(QT_VERSION), 6)
QT_API ?= PyQt6
PYUIC ?= pyuic6
PYLUPDATE ?= pylupdate6
ifeq (, $(shell which $(LRELEASE)))
LRELEASE := lrelease-qt6
endif
else
QT_API ?= PyQt5
PYUIC ?= pyuic5
PYLUPDATE ?= pylupdate5
ifeq (, $(shell which $(LRELEASE)))
LRELEASE := lrelease-qt5
endif
endif
# neeeded for make install
BUILD_CFG_FILE := build_config
QT_API_INST := $(shell grep ^QT_API= $(BUILD_CFG_FILE) 2>/dev/null| cut -d'=' -f2)
QT_API_INST ?= PyQt5
# ---------------------
all: QT_PREPARE RES UI LOCALE
QT_PREPARE:
$(info compiling for Qt$(QT_VERSION) using $(QT_API))
$(file > $(BUILD_CFG_FILE),QT_API=$(QT_API))
ifeq ($(QT_API), $(QT_API_INST))
else
rm -f *~ source/patchbay/resources_rc.py \
locale/*.qm patchbay/ui/*.py
endif
install -d source/patchbay/ui/
# ---------------------
# Resources
RES: source/patchbay/resources_rc.py
source/patchbay/resources_rc.py: resources/resources.qrc
rcc -g python $< |sed 's/ PySide. / qtpy /' > $@
# ---------------------
# UI code
UI: $(shell \
ls resources/ui/*.ui| sed 's|\.ui$$|.py|'| sed 's|^resources/|source/patchbay/|')
source/patchbay/ui/%.py: resources/ui/%.ui
ifeq ($(PYUIC), pyuic6)
$(PYUIC) $< > $@
echo 'from .. import resources_rc' >> $@
else
$(PYUIC) --import-from=.. $< > $@
endif
# ------------------------
# # Translations Files
LOCALE: locale/patchbay_en.qm \
locale/patchbay_fr.qm
locale/%.qm: locale/%.ts
$(LRELEASE) $< -qm $@
locale/%.qm: locale/%.ts
$(LRELEASE) $< -qm $@
# -------------------------
clean:
rm -f *~ source/patchbay/resources_rc.py \
locale/*.qm
rm -f -R source/patchbay/ui \
source/patchbay/__pycache__ \
source/patchbay/*/__pycache__ \
source/patchbay/*/*/__pycache__
# -------------------------
debug:
$(MAKE) DEBUG=true
# -------------------------