-
Notifications
You must be signed in to change notification settings - Fork 3
/
make_za.hac
67 lines (57 loc) · 2.11 KB
/
make_za.hac
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
-- This is a HAC script *and* an Ada program (your choice).
--
-- The HAC command-line tool can be built from the project HAC @
-- https://hacadacompiler.sourceforge.io/ ,
-- https://github.com/zertovitch/hac
--
-- Usage: hac make_za.hac [build mode] [full]
--
-- Build mode can be Debug, Fast, Small, ...
with HAT;
-- NB: in case you want to build this program into an executable with a
-- "full Ada" compiler, the files for HAT (hat.ads, hat*.adb)
-- is located in the /src directory, in the HAC project.
procedure Make_ZA is
use HAT;
gprbuild_options : VString;
procedure Build_with_nice_title (gpr_name, topic : VString) is
begin
Put_Line (" ________ ___ ______ ______ ___");
Put_Line ("/___..._/ I.I I.___.\ /. __ .\ __I.I ____");
Put_Line (" /../ I.I I.____/ I.I__I.I /....I __\..\ ");
Put_Line (" _/../___ I.I I.I === I..__..I I. = .I I = ..I");
Put_Line ("/_______/ I_I /__I /__I I_I \__\_I \__\_I");
New_Line;
Put_Line ("/=====================================================\");
Put_Line (" Build in progress: " & topic & "...");
Put_Line ("\=====================================================/");
New_Line;
Shell_Execute ("gprbuild -P " & gpr_name & gprbuild_options);
end Build_with_nice_title;
type OS_Kind is (Any, Windoze);
k : OS_Kind;
begin
if Index (Get_Env ("OS"), "Windows") > 0 then
k := Windoze;
else
k := Any;
end if;
if Argument_Count > 0 then
gprbuild_options := " -XZip_Build_Mode=" & Argument (1);
end if;
case k is
when Windoze =>
-- Currently Win32 and Win64 options are common.
gprbuild_options := gprbuild_options & " -XZip_OS=Win64";
when others =>
null;
end case;
-- For Windows binary distribution with icons and Set_Modification_Time in UnZipAda:
--
-- -largs extras/zip_icons.rbj
-- copy /b extras\lib*.a obj_[mode]
Build_with_nice_title (+"zipada", +"Command-line Tools and Demos");
if Argument_Count >1 then
Build_with_nice_title (+"zipada_test", +"Tests and other Tools");
end if;
end Make_ZA;