-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
executable file
·52 lines (39 loc) · 1.13 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 airrohrFlasher/*.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 $< -o $@
%.qm: %.ts
lrelease $<
all: $(UI_COMPILED) $(TS_COMPILED)
clean:
rm $(UI_COMPILED)
rm $(TS_COMPILED)
run: all
$(PY) airrohr-flasher.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 --user -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 airrohr-flasher.spec
dmg: dist
dmgbuild -s deploy/dmgbuild_settings.py -D app=dist/Sensor.Community\ Airrohr\ Flasher.app "Sensor.Community Airrohr Flasher" dist/airrohr-flasher.dmg