-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.bat
53 lines (40 loc) · 1.15 KB
/
build.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
@echo off
setlocal
set SOURCE_FILE=main.cpp
set OUTPUT_FILE=main
set DEPENDENT=TRUE
set DEPENDENCY1=BufferScreen.cpp
set DEPENDENCY2=FileExplorer.cpp
echo.
echo [101mCompiling :[0m %SOURCE_FILE%
echo.
if /i %DEPENDENT%==TRUE (
g++ -O3 %~dp0%DEPENDENCY1% %~dp0%DEPENDENCY2% -o %~dp0%OUTPUT_FILE% %~dp0%SOURCE_FILE% -I\"C:\\msys64\\mingw64\\include\" -L\"C:\\msys64\\mingw64\\lib\"
) else (
g++ -O3 -o %~dp0%OUTPUT_FILE% %~dp0%SOURCE_FILE% -I\"C:\\msys64\\mingw64\\include\" -L\"C:\\msys64\\mingw64\\lib\"
)
echo.
REM Calculating Time in 12 Hour HH : MM : SS Format
for /f "delims=." %%a in ('echo %TIME%') do (
set fulltime=%%a
)
set hour=%fulltime:~0,2%
if %hour% leq 9 (
set hour=0%hour:~0,1%
set minute=%fulltime:~2, 2%
set second=%fulltime:~5, 2%
) else (
set minute=%fulltime:~3,2%
set second=%fulltime:~6,2%
)
set ampm=AM
if %hour% geq 12 (
set ampm=PM
if %hour% gtr 12 set /a hour-=12
)
echo [102mFinished Compiling,[0m
echo On [91m^<Date^>[0m : [36m%DATE:/=-%[0m
echo At [91m^<Time^>[0m : [36m%hour%:%minute%:%second% %ampm%[0m
echo.
pause
endlocal