-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate-exe.bat
74 lines (46 loc) · 1.66 KB
/
create-exe.bat
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
@echo off
REM get pack
set CurrentPath=%~dp0
set P1Path=
:begin
for /f "tokens=1,* delims=\" %%i in ("%CurrentPath%") do (set content=%%i&&set CurrentPath=%%j)
if "%P1Path%%content%\" == "%~dp0" goto end
set P1Path=%P1Path%%content%\
goto begin
:end
set pack=%P1Path%
cd %pack%nvim_config
REM try kill exe
taskkill /f /im start-nvim-qt.exe
REM build nvim-qt.exe
windres -i "qt\neovim.ico.rc" -o "qt\neovim.ico.o"
gcc qt\start-nvim-qt.c qt\neovim.ico.o -Wall -s -ffunction-sections -fdata-sections -Wl,--gc-sections -O3 -o start-nvim-qt
REM compress exe
strip -s %pack%nvim_config\start-nvim-qt.exe
upx --best %pack%nvim_config\start-nvim-qt.exe
gcc qt\nvim_qt_here.c -Wall -s -ffunction-sections -fdata-sections -Wl,--gc-sections -O3 -o nvim_qt_here
strip -s %pack%nvim_config\nvim_qt_here.exe
upx --best %pack%nvim_config\nvim_qt_here.exe
%pack%nvim_config\nvim_qt_here.exe
REM del obj
del /f /s /q %pack%nvim_config\qt\neovim.ico.o
set repo=%~dp0
REM cd repo
cd %repo%
REM try kill exe
taskkill /f /im open-with-cmd.exe
taskkill /f /im open-with-ps1.exe
REM build nvim.exe
windres -i "cli/neovim.ico.rc" -o "cli/neovim.ico.o"
gcc cli/open-with-cmd.c cli/neovim.ico.o -Wall -s -ffunction-sections -fdata-sections -Wl,--gc-sections -O3 -o open-with-cmd
gcc cli/open-with-ps1.c cli/neovim.ico.o -Wall -s -ffunction-sections -fdata-sections -Wl,--gc-sections -O3 -o open-with-ps1
REM del ico.o
del /f /s /q %repo%cli/neovim.ico.o
REM compress exe
strip -s %repo%open-with-cmd.exe
upx -qq --best %repo%open-with-cmd.exe
strip -s %repo%open-with-ps1.exe
upx -qq --best %repo%open-with-ps1.exe
REM run exe
REM %repo%open-with-cmd.exe
REM %repo%open-with-ps1.exe