Repository navigation
Expand file tree
/
Copy pathmake.cmd
More file actions
73 lines (63 loc) · 1.75 KB
/
Copy pathmake.cmd
File metadata and controls
73 lines (63 loc) · 1.75 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
64
65
66
67
68
69
70
71
72
73
@echo off
setlocal enabledelayedexpansion
set "TARGET=%~1"
if "%TARGET%"=="" set "TARGET=jar"
if /I "%TARGET%"=="all" set "TARGET=jar"
if /I "%TARGET%"=="help" goto :help
if /I "%TARGET%"=="jar" goto :jar
if /I "%TARGET%"=="clean" goto :clean
if /I "%TARGET%"=="test" goto :test
if /I "%TARGET%"=="test-verilog" goto :test
if /I "%TARGET%"=="test-fuzz" goto :test_fuzz
echo Unknown target: %TARGET%
echo.
goto :help
:tools
if "%JAVA_RELEASE%"=="" set "JAVA_RELEASE=11"
if not "%JAVA_HOME%"=="" (
set "JAVAC=%JAVA_HOME%\bin\javac.exe"
set "JAR=%JAVA_HOME%\bin\jar.exe"
) else (
set "JAVAC=javac"
set "JAR=jar"
)
exit /b 0
:jar
call :tools
echo Compiling Java sources for Java %JAVA_RELEASE%
if not exist build\classes mkdir build\classes
"%JAVAC%" --release %JAVA_RELEASE% -cp lib -d build\classes src\*.java
if errorlevel 1 exit /b %errorlevel%
echo Creating fizzim.jar
"%JAR%" cfm fizzim.jar manifest.txt -C build\classes . -C resources . -C lib org
exit /b %errorlevel%
:clean
del /q *.jar 2>nul
del /q jar.log 2>nul
if exist build rmdir /s /q build
exit /b 0
:test
bash testcases/run_backend_flow.sh
exit /b %errorlevel%
:test_fuzz
call :jar
if errorlevel 1 exit /b %errorlevel%
node testcases\tools\fuzz_backend_compare.js
exit /b %errorlevel%
:help
echo Fizzim build and test helper
echo.
echo make jar Build fizzim.jar with GNU Make
echo make clean Remove Java build artifacts with GNU Make
echo make test Run public backend regression with GNU Make
echo.
echo Windows fallback when GNU Make is not installed:
echo.
echo make.cmd jar
echo make.cmd clean
echo make.cmd test
echo make.cmd test-fuzz
echo.
echo JAVA_HOME may point at a JDK directory.
echo JAVA_RELEASE defaults to 11 and may be overridden.
exit /b 0