DESTDIR = UISOURCES = $(shell ls ui_*.ui) RCSOURCES = $(shell ls *.qrc) UIFILES = $(patsubst ui_%.ui, ui_%.py, $(UISOURCES)) RCFILES =$(patsubst %.qrc, %_rc.py, $(RCSOURCES)) LANGSOURCES = $(shell ls lang/*.ts) LANGFILES = $(patsubst %.ts, %.qm, $(LANGSOURCES)) all: $(RCFILES) $(UIFILES) $(LANGFILES) $(UIFILES): $(UISOURCES) $(RCFILES): $(RCSOURCES) $(LANGFILES): $(LANGSOURCES) ui_%.py: ui_%.ui pyuic5 $< -o $@ %_rc.py: %.qrc # lauch pyrcc5 to make reproducible builds export QT_HASH_SEED=0; pyrcc5 $< -o $@ %.qm: %.ts live_clone.pro lrelease -qt=5 live_clone.pro clean: rm -rf *~ $(RCFILES) $(UIFILES) $(LANGFILES) install: install -d $(DESTDIR)/usr/lib/python3/dist-packages/live_clone install -d $(DESTDIR)/usr/lib/python3/dist-packages/live_clone/lang install -d $(DESTDIR)/usr/lib/python3/dist-packages/live_clone/img install -m 644 *.py *.md $(DESTDIR)/usr/lib/python3/dist-packages/live_clone install -m 644 lang/*.md $(DESTDIR)/usr/lib/python3/dist-packages/live_clone/lang install -m 644 lang/*.qm $(DESTDIR)/usr/lib/python3/dist-packages/live_clone/lang install -m 644 img/* $(DESTDIR)/usr/lib/python3/dist-packages/live_clone/img # replace the relative paths ./ by absolute paths for f in $$(find $(DESTDIR) -name "*.md"); do \ sed -i 's%\./%/usr/lib/python3/dist-packages/live_clone/%' $$f; \ done $(LANGSOURCES): *.py $(UIFILES) live_clone.pro LC_ALL=en_US.UTF-8 pylupdate5 live_clone.pro .PHONY: all clean install lang