shithub: mc

ref: 0dd5d1f71505ce3d8a51e8244cf3128c54eb8293
dir: /mbld/types.myr/

View raw version
use std

pkg bld =
	type build = struct
		/* build state */
		basedir	: byte[:]
		bldfile	: byte[:]
		curdir	: byte[:]
		built	: std.htab(byte[:], bool)#	/* set of targets built in this run */
		sysattrs	: std.htab(byte[:], bool)#	/* set of tags that identify a system */

		/* build params */
		all	: byte[:][:]			/* all targets, in reverse topological order */
		targs	: std.htab(byte[:], targ)#	/* dir => target mapping */
		tdeps	: std.htab(byte[:], byte[:][:])	/* targname => depname[:] mapping */
		gensrc	: std.htab(byte[:], cmdtarg#)#	/* generated src => generating target mapping */
		prefix	: byte[:]
		system	: byte[:]
		arch	: byte[:]
	;;

	type targ = union
		`Bin	myrtarg#
		`Lib	myrtarg#
		`Gen	cmdtarg#
		`Cmd	cmdtarg#
		`Man	mantarg#
	;;

	type myrtarg = struct
		file	: byte[:]
		line	: int

		islib	: bool
		istest	: bool
		dir	: byte[:]
		name	: byte[:]
		inputs	: byte[:][:]
		libdeps	: (byte[:], byte[:], byte[:])[:]	/* dir, lib, targname */
		install	: bool
		runtime	: byte[:]
		incpath	: byte[:][:]
		systags	: byte[:][:]
		ldscript	: byte[:]
	;;

	type cmdtarg = struct
		dir	: byte[:]
		out	: byte[:][:]
		cmd	: byte[:][:] 
		deps	: byte[:][:] 
		systags	: byte[:][:]
		durable	: bool
		/* we can have multiple outputs, but we only want to run once for each */
		done	: bool
		istest	: 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)#
	;;
;;