@@ -11,6 +11,7 @@ |
| 11 |
In a development build, it hardlinks |
11 |
In a development build, it hardlinks |
| 12 |
- Halt.gb |
12 |
- Halt.gb |
| 13 |
- hUGEDriver |
13 |
- hUGEDriver |
|
|
14 |
- PixeliteTTF |
| 14 |
|
15 |
|
| 15 |
into the build output folder so that the driver and tracker can be developed |
16 |
into the build output folder so that the driver and tracker can be developed |
| 16 |
simultaneously. |
17 |
simultaneously. |
@@ -18,35 +19,16 @@ |
| 18 |
|
19 |
|
| 19 |
{$mode objfpc}{$H+} |
20 |
{$mode objfpc}{$H+} |
| 20 |
|
21 |
|
| 21 |
uses SysUtils, |
22 |
uses SysUtils, StrUtils; |
| 22 |
|
|
|
| 23 |
{$ifdef UNIX}BaseUnix;{$endif} |
|
|
| 24 |
{$ifdef WINDOWS}Windows;{$endif} |
|
|
| 25 |
|
|
|
| 26 |
// Cringe |
|
|
| 27 |
{$ifdef WINDOWS} |
|
|
| 28 |
const |
|
|
| 29 |
SYMBOLIC_LINK_FLAG_DIRECTORY = $00000001; |
|
|
| 30 |
|
23 |
|
| 31 |
function CreateSymbolicLinkA( |
24 |
procedure HTCopyFile(Source: String); |
| 32 |
lpSymlinkFileName: PAnsiChar; |
|
|
| 33 |
lpTargetFileName: PAnsiChar; |
|
|
| 34 |
dwFlags: DWORD |
|
|
| 35 |
): Boolean; stdcall; external 'kernel32'; |
|
|
| 36 |
{$endif} |
|
|
| 37 |
|
|
|
| 38 |
procedure Mklink(Src, Dst: AnsiString; Dir: Boolean = False); |
|
|
| 39 |
begin |
25 |
begin |
| 40 |
writeln(src, ', ', dst, ', ', dir); |
26 |
{$ifdef WINDOWS} |
| 41 |
{$ifdef UNIX} |
27 |
ExecuteProcess('cmd.exe', '/c "xcopy /e /Y ' + ExpandFileName(Source) + ' ' + ParamStr(2) + ExtractFileName(Source) + '" > NUL'); |
| 42 |
// TODO.... |
|
|
| 43 |
{$endif} |
28 |
{$endif} |
| 44 |
|
29 |
|
| 45 |
{$ifdef WINDOWS} |
30 |
{$ifdef UNIX} |
| 46 |
if Dir then |
31 |
ExecuteProcess('/bin/bash', '-c "cp ' + Source + ' ' + ParamStr(2) + ExtractFileName(Source) + '" > /dev/null'); |
| 47 |
writeln('link dir ', CreateSymbolicLinkA(PAnsiChar(Dst), PAnsiChar(Src), SYMBOLIC_LINK_FLAG_DIRECTORY)) |
|
|
| 48 |
else |
|
|
| 49 |
writeln('link file ', CreateSymbolicLinkA(PAnsiChar(Dst), PAnsiChar(Src), 0)) |
|
|
| 50 |
{$endif} |
32 |
{$endif} |
| 51 |
end; |
33 |
end; |
| 52 |
|
34 |
|
@@ -55,14 +37,17 @@ var |
| 55 |
Dev: Boolean; |
37 |
Dev: Boolean; |
| 56 |
DestDir: String; |
38 |
DestDir: String; |
| 57 |
begin |
39 |
begin |
| 58 |
for I := 0 to ParamCount-1 do writeln(Paramstr(I)); |
|
|
| 59 |
DestDir := ParamStr(2); |
40 |
DestDir := ParamStr(2); |
| 60 |
Dev := True; ///(ParamCount > 2) and (ParamStr(2) = '-d'); |
41 |
Dev := ContainsText(ParamStr(2), 'Development'); |
|
|
42 |
|
|
|
43 |
HTCopyFile('Resources/ROMs/halt.gb'); |
|
|
44 |
HTCopyFile('Resources/Fonts/PixeliteTTF.ttf'); |
| 61 |
|
45 |
|
| 62 |
if Dev then begin |
46 |
if not Dev then begin |
| 63 |
Mklink('hUGETracker', DestDir+'hUGETracker', True); |
47 |
HTCopyFile('hUGEDriver'); |
| 64 |
Mklink('Resources/ROMs/halt.gb', DestDir+'halt.gb'); |
48 |
HTCopyFile('Resources/SampleSongs'); |
| 65 |
end else begin |
49 |
end else begin |
| 66 |
writeln('not implemented.'); |
50 |
if not DirectoryExists(DestDir+'hUGEDriver') then |
|
|
51 |
Writeln('hUGEDriver not copied in development mode. Manually link it there yourself!'); |
| 67 |
end; |
52 |
end; |
| 68 |
end. |
53 |
end. |
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.
File metadata changed without textual changes.