This repository has been archived by the owner on Aug 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
92 lines (72 loc) · 2.29 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
## 常量
PJNAME := loudplayer
NEEDDIR := needs
NUITKA := nuitka
MAINNAME := main
ICONBASH := ""
COMPILE := --clang
DIRNAME := $(PJNAME).dist
MAINFILE := $(MAINNAME).py
ifeq ($(OS),Windows_NT)
#ICONBASH := --windows-icon-from-ico=$(ICON)
RMDIR := rmdir /s /q
FILENAME := $(PJNAME).exe
RM := del /q
RNM := ren
else
RMDIR := rmdir -rf
#ICONBASH := --linux-icon=$(ICON)
FILENAME := $(PJNAME)
RM := rm -f
RNM := mv
endif
## 其他编译选项区
build:
make onefile
make dir
#make clear
init:
python -m pip install -U "nuitka>=1.0.6"
dir:
make zip_dir
make clear_dir
onefile:
make zip_onefile
make clear_onefile
clear_onefile:
$(RMDIR) $(MAINNAME).build
$(RMDIR) $(MAINNAME).dist
$(RMDIR) $(MAINNAME).onefile-build
clear_dir:
$(RMDIR) $(MAINNAME).build
$(RNM) $(MAINNAME).dist $(PJNAME)
clear:
make clear_dir
make clear_onefile
clean:
$(RMDIR) $(DIRNAME)
$(RM) $(FILENAME)
rm:
make clear
make clean
## 编译选项区
# 静态打包编译
static_onefile:$(MAINFILE) $(NEEDDIR)
$(NUITKA) --standalone $(COMPILE) --follow-imports --onefile --output-filename="$(FILENAME)" $(ICONBASH) $(MAINFILE) --disable-console
static_dir:$(MAINFILE) $(NEEDDIR)
$(NUITKA) --standalone $(COMPILE) --follow-imports --output-filename="$(FILENAME)" $(ICONBASH) $(MAINFILE) --disable-console
# 自动打包编译
auto_onefile:$(MAINFILE) $(NEEDDIR)
$(NUITKA) --standalone $(COMPILE) --onefile --output-filename="$(FILENAME)" $(ICONBASH) $(MAINFILE) --disable-console
auto_dir:$(MAINFILE) $(NEEDDIR)
$(NUITKA) --standalone $(COMPILE) --output-filename="$(FILENAME)" $(ICONBASH) $(MAINFILE) --disable-console
# 动态打包编译
zip_onefile:$(MAINFILE) $(NEEDDIR)
$(NUITKA) --standalone $(COMPILE) --onefile --nofollow-imports --follow-import-to=$(NEEDDIR) --output-filename="$(FILENAME)" $(ICONBASH) $(MAINFILE) --disable-console
zip_dir:$(MAINFILE) $(NEEDDIR)
$(NUITKA) --standalone $(COMPILE) --nofollow-imports --follow-import-to=$(NEEDDIR) --output-filename="$(FILENAME)" $(ICONBASH) $(MAINFILE) --disable-console
# 依赖Python运行时的编译
vm_onefile:$(MAINFILE) $(NEEDDIR)
$(NUITKA) --onefile $(COMPILE) --output-filename="$(FILENAME)" $(ICONBASH) $(MAINFILE) --disable-console
vm_dir:$(MAINFILE) $(NEEDDIR)
$(NUITKA) $(COMPILE) --output-filename="$(FILENAME)" $(ICONBASH) $(MAINFILE) --disable-console