summaryrefslogtreecommitdiff
path: root/mbld/types.myr
blob: c819ad033b0fd128fb3ce1e50d5c1b783cd48559 (plain)
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
use std

pkg bld =
	type build = struct
		cmd	: byte[:][:]	/* command that we ran */
		/* build state */
		basedir	: byte[:]
		bldfile	: byte[:]
		curdir	: byte[:]
		/* build params */
		all	: byte[:][:]
		targs	: std.htab(byte[:], targ)#	/* dir => target mapping */
		tdeps	: std.htab(byte[:], byte[:][:])	/* targname => depname[:] mapping */
		gensrc	: std.htab(byte[:], gentarg#)#	/* generated src => generating target mapping */
		prefix	: byte[:]
		system	: byte[:]
		arch	: byte[:]
	;;

	type targ = union
		`Bin	myrtarg#
		`Lib	myrtarg#
		`Test	myrtarg#
		`Gen	gentarg#
		`Man	mantarg#
	;;

	type myrtarg = struct
		dir	: byte[:]
		name	: byte[:]
		inputs	: byte[:][:]
		libdeps	: (byte[:], byte[:], byte[:])[:]	/* dir, lib pairs */
		built	: bool
		install	: bool
		runtime	: byte[:]
		incpath	: byte[:][:]
		ldscript	: byte[:]
	;;

	type gentarg = struct
		dir	: byte[:]
		out	: byte[:][:]
		cmd	: byte[:][:] 
		durable	: bool
		/* we can have multiple outputs, but we only want to run once for each */
		done	: bool
	;;

	type mantarg = struct
		dir	: byte[:]
		pages	: byte[:][:]
	;;

	type depgraph = struct
		roots	: byte[:][:]
		deps	: std.htab(byte[:], byte[:][:])#
		libs	: std.htab(byte[:], byte[:][:])#
		input	: std.htab(byte[:], byte[:])#
		sources	: std.htab(byte[:], bool)#
		updated	: std.htab(byte[:], bool)#
		seen	: std.htab(byte[:], bool)#
		done	: std.htab(byte[:], bool)#
	;;
;;