-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfpc-make-package.bat
71 lines (58 loc) · 1.6 KB
/
fpc-make-package.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
@echo off
rem === CONSTANTS ===
set cPLATFORM_32=i386
set cPLATFORM_64=x86
set cDEBUG=debug
rem === YOUR OPTIONS ===
cd ..
set myROOT=%cd%
set myOPTVERSION=%1
set myOPTPLATFORM=%2
set myPKGPATH=%3
set myDEBUG=%4
rem === OPTIONS ====
set myBINUTILS=%myROOT%\binutils
set myTARGET=none
set myOPTS=-gl
rem set myCOMMONOPTS=UPXPROG=echo COPYTREE=echo OPT="%myOPTS%"
set myCOMMONOPTS=
if [%myDEBUG%.] equ [%cDEBUG%.] (
set myCOMMONOPTS=UPXPROG=echo COPYTREE=echo OPT="%myOPTS%"
)
rem === VERIFYING THE ARGS
if [%myOPTVERSION%.] equ [.] (
echo ERROR: 1 arg is the FPC version
goto END
)
set myFPC=%myROOT%\compilers\%myOPTVERSION%
if not exist %myFPC% (
echo ERROR: Version "%myOPTVERSION%" does not exists
goto END
)
rem === DEFAULT VALUES ===
if [%myOPTPLATFORM%.] equ [.] (
set myOPTPLATFORM=%cPLATFORM_32%
)
rem === SET PATH AND OPTIONS ===
if %myOPTPLATFORM% equ %cPLATFORM_32% (
set myTARGET=i386-win32
set myCOMMONOPTS=%myCOMMONOPTS% OS_TARGET=win32 CPU_TARGET=i386 DATA2INC=%myFPC%\utils\data2inc.exe
)
if %myOPTPLATFORM% equ %cPLATFORM_64% (
set myTARGET=x86_64-win64
set myCOMMONOPTS=%myCOMMONOPTS% OS_TARGET=win64 CPU_TARGET=x86_64
)
set myBINUTILS_PATH=%myBINUTILS%\%myOPTVERSION%\%myTARGET%
if %myTARGET% equ none (
echo ERROR: Plataform "%myOPTPLATFORM%" does not exists
echo OPTIONS: %cPLATFORM_32% %cPLATFORM_64%
goto END
)
rem === INVARIANT PART ===
set PATH=%myBINUTILS_PATH%;%myFPC%\bin\%myTARGET%
rem goto package
cd %myPKGPATH%
make clean all install %myCOMMONOPTS% INSTALL_PREFIX=%myFPC% PP=%myFPC%\bin\%myTARGET%\fpc.exe
echo ....................................
echo DONE
:END