Debian Codegraph @

live_clone/Makefile

raw
1 DESTDIR =
2
3 UISOURCES = $(shell ls ui_*.ui)
4 RCSOURCES = $(shell ls *.qrc)
5 UIFILES = $(patsubst ui_%.ui, ui_%.py, $(UISOURCES))
6 RCFILES =$(patsubst %.qrc, %_rc.py, $(RCSOURCES))
7
8 LANGSOURCES = $(shell ls lang/*.ts)
9 LANGFILES = $(patsubst %.ts, %.qm, $(LANGSOURCES))
10
11 all: $(RCFILES) $(UIFILES) $(LANGFILES)
12
13 $(UIFILES): $(UISOURCES)
14 $(RCFILES): $(RCSOURCES)
15 $(LANGFILES): $(LANGSOURCES)
16
17 ui_%.py: ui_%.ui
18 pyuic5 $< -o $@
19
20 %_rc.py: %.qrc
21 # lauch pyrcc5 to make reproducible builds
22 export QT_HASH_SEED=0; pyrcc5 $< -o $@
23
24 %.qm: %.ts live_clone.pro
25 lrelease -qt=5 live_clone.pro
26
27 clean:
28 rm -rf *~ $(RCFILES) $(UIFILES) $(LANGFILES)
29
30 install:
31 install -d $(DESTDIR)/usr/lib/python3/dist-packages/live_clone
32 install -d $(DESTDIR)/usr/lib/python3/dist-packages/live_clone/lang
33 install -d $(DESTDIR)/usr/lib/python3/dist-packages/live_clone/img
34
35 install -m 644 *.py *.md $(DESTDIR)/usr/lib/python3/dist-packages/live_clone
36 install -m 644 lang/*.md $(DESTDIR)/usr/lib/python3/dist-packages/live_clone/lang
37 install -m 644 lang/*.qm $(DESTDIR)/usr/lib/python3/dist-packages/live_clone/lang
38 install -m 644 img/* $(DESTDIR)/usr/lib/python3/dist-packages/live_clone/img
39 # replace the relative paths ./ by absolute paths
40 for f in $$(find $(DESTDIR) -name "*.md"); do \
41 sed -i 's%\./%/usr/lib/python3/dist-packages/live_clone/%' $$f; \
42 done
43
44 $(LANGSOURCES): *.py $(UIFILES) live_clone.pro
45 LC_ALL=en_US.UTF-8 pylupdate5 live_clone.pro
46
47
48 .PHONY: all clean install lang