-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.bat
More file actions
63 lines (51 loc) · 1.34 KB
/
install.bat
File metadata and controls
63 lines (51 loc) · 1.34 KB
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
@echo off
setlocal EnableDelayedExpansion
set die=0
where >nul 2>nul gcc
if %ERRORLEVEL% NEQ 0 (
echo Please ensure gcc is installed and added to path before attempting to install ERPLAG compiler
set die=1
)
where nasm /f > nul 2>&1
if %ERRORLEVEL% NEQ 0 (
echo Please ensure nasm is installed and added to path before attempting to install ERPLAG compiler
set die=1
)
IF !die!==1 (
echo ERPLAG compiler installation failed^!
EXIT /B 1
)
if exist .compiler (
echo ERPLAG compiler is already installed in this system
echo If you wish to uninstall it, execute "uninstall" in the command prompt
EXIT /B 1
)
echo Installing ERPLAG compiler^.^.^.
echo.
set grmPath=%CD%
set grmPath=%grmPath%\parser.c
gcc -w -g -c erplag.c
gcc -w -g -c error.c
gcc -w -g -c codegen.c
gcc -w -g -c symbolTable.c
gcc -w -g -c ast.c
gcc -w -g -c typeChecker.c
gcc -w -g -c lexer.c
gcc -w -g -c "%grmPath%"
gcc -w -g -o .compiler erplag.o codegen.o ast.o lexer.o parser.o symbolTable.o typeChecker.o error.o
del erplag.o
del error.o
del codegen.o
del symbolTable.o
del ast.o
del typeChecker.o
del lexer.o
del parser.o
if exist erplag.bat (
del erplag.bat
)
rename .erplag erplag.bat
echo ERPLAG compiler has been successfully installed^^!
echo Please add this repository to the environment PATH variable
echo.
echo Use erplag -h to read the guidelines for using the compiler