-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
38 lines (32 loc) · 970 Bytes
/
Copy pathbuild.bat
File metadata and controls
38 lines (32 loc) · 970 Bytes
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
@echo off
REM Clears the console screen
cls
REM Define compiler and flags
SET CC=gcc
SET CFLAGS=-Wall -Wextra -g
SET INCLUDES=-Iinclude
REM Define the target executable name
SET TARGET=bin\regex_engine.exe
REM Find all source files in the project
SET SOURCES=main.c src\parser.c src\nfa.c src\simulator.c src\dfa.c
REM --- Compilation Step ---
echo Compiling project...
%CC% %CFLAGS% %SOURCES% -o %TARGET% %INCLUDES%
REM --- Check if compilation was successful and run ---
if %errorlevel% neq 0 (
echo.
echo =====================
echo COMPILATION FAILED!
echo =====================
goto :eof
)
echo.
echo =======================
echo COMPILATION SUCCESSFUL
echo =======================
echo.
echo -------------------------------------------------------------
echo Running the engine with pattern "(a|b)*c" and string "abbc"...
echo -------------------------------------------------------------
echo Example Run:
echo %TARGET% "(a|b)*c" "abbc"