forked from opendata-stuttgart/airrohr-firmware-flasher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (39 loc) · 1.12 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
UI_FILES = $(wildcard gui/*.ui)
TS_FILES = $(wildcard i18n/*.ts)
PY_FILES = $(wildcard *.py) $(wildcard gui/*.py) $(wildcard smogomierztool/*.py)
UI_COMPILED = $(UI_FILES:.ui=.py)
TS_COMPILED = $(TS_FILES:.ts=.qm)
# python3.6 on Windows is only available as python.exe
ifeq (, $(shell which python3))
PY ?= python
else
PY ?= python3
endif
%.py: %.ui
pyuic5 $< > $@
%.qm: %.ts
lrelease $<
all: $(UI_COMPILED) $(TS_COMPILED)
clean:
rm $(UI_COMPILED)
rm $(TS_COMPILED)
run: all
$(PY) smogomierz-tool.py
# Updates all translation files in i18n/ directory
i18n-update: $(UI_COMPILED)
@for f in $(TS_FILES) ; do \
pylupdate5 $(PY_FILES) -ts $$f -verbose; \
done
deps:
$(PY) -m pip install -U -r requirements.txt
# Here go platform-specific buildsteps
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
PLATFORM_DEPS := assets/logo.icns
assets/logo.icns: assets/logo.png
deploy/mkicns $<
endif
dist: all $(PLATFORM_DEPS)
$(PY) -m PyInstaller -y smogomierz-tool.spec
dmg: dist
dmgbuild -s deploy/dmgbuild_settings.py -D app=dist/Smogomierz\ Flashing\ Tool.app "Smogomierz Flashing Tool" dist/smogomierz-flashing-tool.dmg