shithub: mc

ref: ddb327c92ebe3f96c5c816ec61996440551de401
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 */
		tags	: std.htab(byte[:], (int, int, int))#

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

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

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

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

	type cmdtarg = struct
		dir	: byte[:]
		out	: byte[:][:]
		cmd	: byte[:][:] 
		deps	: byte[:][:] 
		tags	: 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[:]
		tags	: byte[:][:]
		pages	: byte[:][:]
	;;

	type datatarg = struct
		dir	: byte[:]
		name	: byte[:]
		tags	: byte[:][:]
		path	: byte[:]
		blobs	: byte[:][:]
	;;

	type depgraph = struct
		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)#

		/* used for linking C */
		extlibs	: byte[:][:]
		cflags	: std.htab(byte[:], byte[:][:])#
		dynamic	: bool
	;;
;;