-
Notifications
You must be signed in to change notification settings - Fork 1
/
compile_libs.cmd
68 lines (61 loc) · 1.74 KB
/
compile_libs.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
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
@echo off
rem ---------------------------------------------------------------------------------
rem
rem Distributed under MIT Licence
rem See https://github.com/house-of-abbey/scratch_vhdl/blob/main/LICENCE.
rem
rem J D Abbey & P A Abbey, 11 November 2022
rem
rem ---------------------------------------------------------------------------------
title Compiling Modelsim Libraries
rem Batch file's directory where the source code is
set SRC=%~dp0
rem drop last character '\'
set SRC=%SRC:~0,-1%
rem Setup paths to local installations
if exist %SRC%\config.cmd (
call %SRC%\config.cmd
) else (
echo Configuration file 'config.cmd' not found. Copy and edit 'config.cmd.editme'.
goto error
)
if not defined SCRATCH_SRC (
echo Variable 'SCRATCH_SRC' not set.
goto error
)
if not defined MODELSIMDIR (
echo Variable 'MODELSIMDIR' not set.
goto error
)
if not defined COMPILEDIR (
echo Variable 'COMPILEDIR' not set.
goto error
)
if not exist "%SCRATCH_SRC%\" (
echo Directory '%SCRATCH_SRC%' not found.
goto error
)
if not exist "%MODELSIMDIR%\" (
echo Directory '%MODELSIMDIR%' not found.
goto error
)
if not exist "%COMPILEDIR%\" (
echo Directory '%COMPILEDIR%' not found.
goto error
)
rem Fix the PATH variable for when compiling Scratch VHDL from an external drive
rem Put ModelSim's vcom etc. on the PATH _first_, otherwise a different installation
rem of a different version might be found first.
set PATH=%MODELSIMDIR%\modelsim_ase\win32aloem;%PATH%
rem Fake the location of this directory for when we're not compiling to the assumed location
set USERPROFILE=%COMPILEDIR%
pushd
echo y | call "%SCRATCH_SRC%\..\fpga\VHDL\Local\modelsim_compile.cmd"
popd
pause
exit /b %errorcode%
:error
echo.
echo Compilation FAILED
pause
exit /b 1