-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmakefile
78 lines (61 loc) · 1.77 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
.PHONY : main all os_check clean preclean postclean
compiler = pyinstaller
target = src/interface.py
ver_major = 2
ver_minor = 1
ver_patch = 2
hiddenimports = --hidden-import urllib3
hiddenimports += --hidden-import pyspeedtest
cflags = -F -y --specpath build --clean $(hiddenimports)
ifeq ($(OS),Windows_NT)
name = PySpeedTest_v$(ver_major).$(ver_minor).$(ver_patch).exe
cflags += --windowed --icon=icon.ico
delete_cmd = del /S
delete_dir = rmdir /S /q
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
name = PySpeedTest_v$(ver_major).$(ver_minor).$(ver_patch)_mac
cflags += --windowed --icon=icon.icns
delete_cmd = rm
delete_dir = rm -rf
else
name = PySpeedTest_v$(ver_major).$(ver_minor).$(ver_patch)_unix
cflags += -c
delete_cmd = rm
delete_dir = rm -rf
endif
endif
cflags += -n $(name)
all: dependencies preclean main postclean
# useful for those of us using the 'py' launcher:
# doing `python bla.py` results in python 2, but
# doing `py bla.py` results in python 3.
# having a no dependencies target lets you compile
# with the default python library and not have to
# worry about downloading already-installed
# dependencies
no_depends: preclean main postclean
dependencies:
python src/dependencies.py --silent
clean: preclean postclean
preclean:
-$(delete_dir) dist
-$(delete_cmd) src/*.pyc;
-$(delete_dir) __pycache__
postclean:
-$(delete_dir) build
-$(delete_cmd) src/*.pyc
-$(delete_dir) src/urllib3
deepclean:
$(info This will make a lot of errors! That's okay, just ignore them.)
-$(delete_dir) dist
-$(delete_dir) build
-$(delete_dir) src/__pycache__
-$(delete_cmd) src/*.pyc
-$(delete_dir) src/urllib3
main:
$(compiler) $(cflags) $(target)
debug:
$(compiler) $(cflags) --debug $(target)
print-% : ; @echo $* = $($*)