-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.cmd
43 lines (42 loc) · 955 Bytes
/
make.cmd
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
@echo off
cls
set obj_folder=%~dp0obj
set bin_folder=%~dp0bin
pushd %CD%
cd %~dp0
where cl >NUL 2>&1 1>NUL
if not %errorlevel% equ 0 (
color 04
cls
title environment error
echo please run %~nx0 in develop prompt environment
pause & color & title=%comspec%
goto :EOF
)
:compile
echo compiling the downloader
if not exist %obj_folder% mkdir %obj_folder%
if not exist %bin_folder% mkdir %bin_folder%
if not exist src/getpage.c (
cls
color 03
title file location error
echo please put %~nx0 at the project root folder
pause & color & title=%comspec%
popd
goto :EOF
)
taskkill /f /im getpage.exe 2>NUL >NUL
cl /nologo /W2 /Fo%obj_folder%\getpage.obj /Fe%bin_folder%\\getpage.exe src\getpage.c
if %errorlevel% equ 0 (
rem cls
color 02
pause & color & title=%comspec%
popd
) else (
color 04
title compile error
echo bad news & echo.
pause & color & title=%comspec%
popd
)