hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

gen-stdlib (28569B)


      1 #!/bin/sh
      2 # The purpose of this script is to generate make targets for the Hare standard
      3 # library. If you are adding new modules to the standard library, write a
      4 # function for that module (e.g. encoding_utf8), and call the following helper
      5 # commands:
      6 #
      7 # gen_srcs module::name list.ha of.ha sources.ha
      8 # gen_ssa module::name list of module::names yours depends on
      9 #
     10 # Then add your module to the list of modules at the bottom.
     11 #
     12 # Then run ./scripts/gen-stdlib > stdlib.mk to generate new rules.
     13 
     14 srcdir="$(dirname "$0")"
     15 eval ". $srcdir/gen-stdlib.sh"
     16 
     17 all_platforms="linux
     18 freebsd"
     19 
     20 gensrcs_rt() {
     21 	gen_srcs -plinux rt \
     22 		+linux/abort.ha \
     23 		+linux/env.ha \
     24 		+linux/errno.ha \
     25 		+linux/types.ha \
     26 		+linux/segmalloc.ha \
     27 		+linux/platformstart.ha \
     28 		+linux/prctl.ha \
     29 		+linux/'+$(ARCH)'.ha \
     30 		+linux/syscallno+'$(ARCH)'.ha \
     31 		+linux/syscalls.ha \
     32 		+linux/signal.ha \
     33 		+linux/stat.ha \
     34 		+linux/socket.ha \
     35 		'+$(ARCH)'/jmp.ha \
     36 		'+$(ARCH)'/backtrace.ha \
     37 		fenv_defs.ha \
     38 		'+$(ARCH)'/cpuid.ha \
     39 		ensure.ha \
     40 		jmp.ha \
     41 		malloc.ha \
     42 		memcpy.ha \
     43 		memmove.ha \
     44 		memset.ha \
     45 		strcmp.ha \
     46 		$*
     47 	gen_srcs -pfreebsd rt \
     48 		+freebsd/abort.ha \
     49 		+freebsd/env.ha \
     50 		+freebsd/errno.ha \
     51 		+freebsd/platformstart.ha \
     52 		+freebsd/segmalloc.ha \
     53 		+freebsd/signal.ha \
     54 		+freebsd/socket.ha \
     55 		+freebsd/syscallno.ha \
     56 		+freebsd/syscalls.ha \
     57 		+freebsd/types.ha \
     58 		+'$(ARCH)'/jmp.ha \
     59 		+'$(ARCH)'/backtrace.ha \
     60 		fenv_defs.ha \
     61 		+'$(ARCH)'/cpuid.ha \
     62 		ensure.ha \
     63 		jmp.ha \
     64 		malloc.ha \
     65 		memcpy.ha \
     66 		memmove.ha \
     67 		memset.ha \
     68 		strcmp.ha \
     69 		$*
     70 }
     71 
     72 rt() {
     73 	# This one is complicated, don't use it as a reference for other modules
     74 	if [ $testing -eq 0 ]
     75 	then
     76 		printf '%s\n' 'rtscript = $(STDLIB)/rt/hare.sc'
     77 		gensrcs_rt \
     78 			abort.ha \
     79 			start.ha
     80 	else
     81 		gensrcs_rt \
     82 			start+test.ha \
     83 			abort+test.ha \
     84 			'+test/+$(PLATFORM).ha' \
     85 			+test/cstring.ha \
     86 			+test/run.ha \
     87 			+test/ztos.ha
     88 	fi
     89 	gen_ssa -plinux rt
     90 	gen_ssa -pfreebsd rt
     91 	cat <<EOF
     92 \$($cache)/rt/start.o: \$(STDLIB)/rt/+\$(PLATFORM)/start+\$(ARCH)-libc.s
     93 	@printf 'AS \t%s\n' "\$@"
     94 	@mkdir -p \$($cache)/rt
     95 	@\$(AS) -o \$@ \$(STDLIB)/rt/+\$(PLATFORM)/start+\$(ARCH)-libc.s
     96 
     97 ${stdlib}_asm = \$($cache)/rt/syscall.o \\
     98 	\$($cache)/rt/setjmp.o \\
     99 	\$($cache)/rt/longjmp.o \\
    100 	\$($cache)/rt/restore.o \\
    101 	\$($cache)/rt/getfp.o \\
    102 	\$($cache)/rt/fenv.o \\
    103 	\$($cache)/rt/start.o \\
    104 	\$($cache)/rt/cpuid_native.o
    105 
    106 \$($cache)/rt/syscall.o: \$(STDLIB)/rt/+\$(PLATFORM)/syscall+\$(ARCH).s
    107 	@printf 'AS \t%s\n' "\$@"
    108 	@mkdir -p \$($cache)/rt
    109 	@\$(AS) -o \$@ \$(STDLIB)/rt/+\$(PLATFORM)/syscall+\$(ARCH).s
    110 
    111 \$($cache)/rt/setjmp.o: \$(STDLIB)/rt/+\$(ARCH)/setjmp.s
    112 	@printf 'AS \t%s\n' "\$@"
    113 	@mkdir -p \$($cache)/rt
    114 	@\$(AS) -o \$@ \$(STDLIB)/rt/+\$(ARCH)/setjmp.s
    115 
    116 \$($cache)/rt/longjmp.o: \$(STDLIB)/rt/+\$(ARCH)/longjmp.s
    117 	@printf 'AS \t%s\n' "\$@"
    118 	@mkdir -p \$($cache)/rt
    119 	@\$(AS) -o \$@ \$(STDLIB)/rt/+\$(ARCH)/longjmp.s
    120 
    121 \$($cache)/rt/restore.o: \$(STDLIB)/rt/+\$(ARCH)/restore.s
    122 	@printf 'AS \t%s\n' "\$@"
    123 	@mkdir -p \$($cache)/rt
    124 	@\$(AS) -o \$@ \$(STDLIB)/rt/+\$(ARCH)/restore.s
    125 
    126 \$($cache)/rt/fenv.o: \$(STDLIB)/rt/+\$(ARCH)/fenv.s
    127 	@printf 'AS \t%s\n' "\$@"
    128 	@mkdir -p \$($cache)/rt
    129 	@\$(AS) -o \$@ \$(STDLIB)/rt/+\$(ARCH)/fenv.s
    130 
    131 \$($cache)/rt/getfp.o: \$(STDLIB)/rt/+\$(ARCH)/getfp.s
    132 	@printf 'AS \t%s\n' "\$@"
    133 	@mkdir -p \$($cache)/rt
    134 	@\$(AS) -o \$@ \$(STDLIB)/rt/+\$(ARCH)/getfp.s
    135 
    136 \$($cache)/rt/cpuid_native.o: \$(STDLIB)/rt/+\$(ARCH)/cpuid_native.s
    137 	@printf 'AS \t%s\n' "\$@"
    138 	@mkdir -p \$($cache)/rt
    139 	@\$(AS) -o \$@ \$(STDLIB)/rt/+\$(ARCH)/cpuid_native.s
    140 
    141 \$($cache)/rt/rt-linux.a: \$($cache)/rt/rt-linux.o \$(${stdlib}_asm)
    142 	@printf 'AS \t%s\n' "\$@"
    143 	@\$(AR) -csr \$@ \$($cache)/rt/rt-linux.o \$(${stdlib}_asm)
    144 
    145 \$($cache)/rt/rt-freebsd.a: \$($cache)/rt/rt-freebsd.o \$(${stdlib}_asm)
    146 	@printf 'AS \t%s\n' "\$@"
    147 	@\$(AR) -csr \$@ \$($cache)/rt/rt-freebsd.o \$(${stdlib}_asm)
    148 
    149 ${stdlib}_rt = \$($cache)/rt/rt-\$(PLATFORM).a
    150 ${stdlib}_deps_linux += \$(${stdlib}_rt)
    151 ${stdlib}_deps_freebsd += \$(${stdlib}_rt)
    152 ${stdlib}_deps_any += \$(${stdlib}_rt)
    153 
    154 EOF
    155 }
    156 
    157 ascii() {
    158 	gen_srcs ascii \
    159 		ctype.ha \
    160 		strcmp.ha \
    161 		valid.ha
    162 	gen_ssa ascii strings
    163 }
    164 
    165 bufio() {
    166 	gen_srcs bufio \
    167 		buffered.ha \
    168 		memstream.ha \
    169 		scanner.ha
    170 	gen_ssa bufio io bytes strings encoding::utf8 errors types
    171 }
    172 
    173 bytes() {
    174 	gen_srcs bytes \
    175 		contains.ha \
    176 		equal.ha \
    177 		index.ha \
    178 		reverse.ha \
    179 		tokenize.ha \
    180 		trim.ha \
    181 		two_way.ha \
    182 		zero.ha
    183 	gen_ssa bytes types
    184 }
    185 
    186 datetime() {
    187 	gen_srcs -plinux datetime \
    188 		arithmetic.ha \
    189 		chronology.ha \
    190 		date.ha \
    191 		datetime.ha \
    192 		format.ha \
    193 		parse.ha \
    194 		time.ha \
    195 		timezone.ha
    196 	gen_ssa -plinux datetime errors fmt strings strio time time::chrono
    197 	gen_srcs -pfreebsd datetime \
    198 		arithmetic.ha \
    199 		chronology.ha \
    200 		date.ha \
    201 		datetime.ha \
    202 		format.ha \
    203 		parse.ha \
    204 		time.ha \
    205 		timezone.ha
    206 	gen_ssa -pfreebsd datetime errors fmt strings strio time time::chrono
    207 }
    208 
    209 crypto() {
    210 	if [ $testing -eq 0 ]
    211 	then
    212 		gen_srcs crypto \
    213 			authenc.ha \
    214 			keyderiv.ha
    215 		gen_ssa crypto bufio bytes crypto::argon2 crypto::chacha \
    216 			crypto::cihper crypto::poly1305 crypto::mac \
    217 			crypto::math endian errors io
    218 	else
    219 		gen_srcs crypto \
    220 			authenc.ha \
    221 			keyderiv.ha \
    222 			+test/authenc.ha
    223 		gen_ssa crypto bytes bufio crypto::argon2 crypto::chacha \
    224 			crypto::cihper crypto::poly1305 crypto::mac \
    225 			crypto::math endian errors io
    226 	fi
    227 }
    228 
    229 gensrcs_crypto_aes() {
    230 	gen_srcs crypto::aes \
    231 		aes_ct64.ha \
    232 		$*
    233 }
    234 
    235 crypto_aes() {
    236 	if [ $testing -eq 0 ]
    237 	then
    238 		gensrcs_crypto_aes
    239 		gen_ssa crypto::aes bytes crypto::cipher crypto::math endian \
    240 			rt io
    241 	else
    242 		gensrcs_crypto_aes \
    243 			ct64+test.ha \
    244 			cbc+test.ha \
    245 			ctr+test.ha \
    246 			+test/gcm.ha
    247 		gen_ssa crypto::aes bufio bytes crypto::cipher crypto::math \
    248 			endian errors io rt 
    249 	fi
    250 }
    251 
    252 crypto_aes_xts() {
    253 	if [ $testing -eq 0 ]
    254 	then
    255 		gen_srcs crypto::aes::xts xts.ha
    256 	else
    257 		gen_srcs crypto::aes::xts xts.ha +test.ha
    258 	fi
    259 	gen_ssa crypto::aes::xts crypto::aes crypto::cipher bytes
    260 }
    261 
    262 crypto_argon2() {
    263 	if [ $testing -eq 0 ]
    264 	then
    265 		gen_srcs crypto::argon2 argon2.ha
    266 	else
    267 		gen_srcs crypto::argon2 argon2.ha +test.ha
    268 	fi
    269 
    270 	gen_ssa crypto::argon2 bufio bytes crypto::blake2b \
    271 		crypto::math endian errors hash io rt types
    272 }
    273 
    274 crypto_bcrypt() {
    275 	if [ $testing -eq 0 ]
    276 	then
    277 		gen_srcs crypto::bcrypt bcrypt.ha base64.ha
    278 	else
    279 		gen_srcs crypto::bcrypt bcrypt.ha base64.ha +test.ha
    280 	fi
    281 	gen_ssa crypto::bcrypt crypto::blowfish encoding::base64 bufio io \
    282 		crypto crypto::random errors crypto::cipher strings fmt bytes \
    283 		strconv
    284 }
    285 
    286 gensrcs_crypto_blake2b() {
    287 	gen_srcs crypto::blake2b \
    288 		blake2b.ha \
    289 		$*
    290 }
    291 
    292 crypto_blake2b() {
    293 	if [ $testing -eq 0 ]
    294 	then
    295 		gensrcs_crypto_blake2b
    296 		gen_ssa crypto::blake2b encoding::hex fmt hash io strings \
    297 			strio crypto::math endian bytes
    298 	else
    299 		gensrcs_crypto_blake2b +test.ha vectors+test.ha
    300 		gen_ssa crypto::blake2b encoding::hex fmt hash io strings \
    301 			strio crypto::math endian bytes
    302 	fi
    303 }
    304 
    305 gensrcs_crypto_blowfish() {
    306 	gen_srcs crypto::blowfish \
    307 		blowfish.ha \
    308 		const.ha \
    309 		$*
    310 }
    311 
    312 crypto_blowfish() {
    313 	if [ $testing -eq 0 ]
    314 	then
    315 		gensrcs_crypto_blowfish
    316 	else
    317 		gensrcs_crypto_blowfish +test.ha
    318 	fi
    319 	gen_ssa crypto::blowfish bytes crypto::cipher endian
    320 }
    321 
    322 crypto_chacha() {
    323 	if [ $testing -eq 0 ]
    324 	then
    325 		gen_srcs crypto::chacha chacha20.ha
    326 		gen_ssa crypto::chacha bytes crypto::cipher crypto::math \
    327 			endian io
    328 	else
    329 		gen_srcs crypto::chacha chacha20.ha +test.ha
    330 		gen_ssa crypto::chacha bytes crypto::cipher crypto::math \
    331 			endian io
    332 	fi
    333 }
    334 
    335 crypto_cipher() {
    336 	gen_srcs crypto::cipher \
    337 		cipher.ha \
    338 		block.ha \
    339 		cbc.ha \
    340 		ctr.ha \
    341 		stream.ha \
    342 		gcm.ha \
    343 		ghash.ha
    344 	gen_ssa crypto::cipher crypto::math bytes endian errors io types
    345 }
    346 
    347 crypto_hkdf() {
    348 	if [ $testing -eq 0 ]
    349 	then
    350 		gen_srcs crypto::hkdf hkdf.ha
    351 		gen_ssa crypto::hkdf bytes crypto::hmac crypto::mac hash
    352 	else
    353 		gen_srcs crypto::hkdf hkdf.ha +test.ha
    354 		gen_ssa crypto::hkdf bytes crypto::hmac crypto::mac hash \
    355 			crypto::sha1 crypto::sha256
    356 	fi
    357 }
    358 
    359 crypto_hmac() {
    360 	if [ $testing -eq 0 ]
    361 	then
    362 		gen_srcs crypto::hmac \
    363 			hmac.ha \
    364 			sha1.ha \
    365 			sha256.ha
    366 		gen_ssa crypto::hmac crypto::mac crypto::sha1 crypto::sha256 hash io bytes
    367 	else
    368 		gen_srcs crypto::hmac \
    369 			hmac.ha \
    370 			sha1.ha \
    371 			sha256.ha \
    372 			+test.ha
    373 		gen_ssa crypto::hmac bytes crypto::mac hash crypto::sha1 \
    374 			crypto::sha256 encoding::hex io strings
    375 	fi
    376 }
    377 
    378 crypto_mac() {
    379 	gen_srcs crypto::mac \
    380 		mac.ha
    381 	gen_ssa crypto::mac io
    382 }
    383 
    384 crypto_math() {
    385 	gen_srcs crypto::math \
    386 		arithm.ha bits.ha
    387 	gen_ssa crypto::math
    388 }
    389 
    390 crypto_poly1305() {
    391 	if [ $testing -eq 0 ]
    392 	then
    393 		gen_srcs crypto::poly1305 \
    394 			poly1305.ha
    395 	else
    396 		gen_srcs crypto::poly1305 \
    397 			poly1305.ha \
    398 			+test.ha
    399 	fi
    400 	gen_ssa crypto::poly1305 bytes crypto::mac endian encoding::hex io
    401 }
    402 
    403 crypto_random() {
    404 	gen_srcs -plinux crypto::random \
    405 		+linux.ha \
    406 		random.ha
    407 	gen_ssa -plinux crypto::random rt io errors
    408 
    409 	gen_srcs -pfreebsd crypto::random \
    410 		+freebsd.ha \
    411 		random.ha
    412 	gen_ssa -pfreebsd crypto::random rt io errors
    413 }
    414 
    415 crypto_salsa() {
    416 	if [ $testing -eq 0 ]
    417 	then
    418 		gen_srcs crypto::salsa salsa20.ha
    419 		gen_ssa crypto::salsa bytes crypto::cipher crypto::math endian \
    420 			io
    421 	else
    422 		gen_srcs crypto::salsa salsa20.ha +test.ha
    423 		gen_ssa crypto::salsa bytes bufio crypto::cipher crypto::math \
    424 			endian types io
    425 	fi
    426 }
    427 
    428 gensrcs_crypto_sha256() {
    429 	gen_srcs crypto::sha256 \
    430 		sha256.ha \
    431 		$*
    432 }
    433 
    434 genssa_crypto_sha256() {
    435 	gen_ssa crypto::sha256 bytes hash io endian $*
    436 }
    437 
    438 crypto_sha256() {
    439 	if [ $testing -eq 0 ]
    440 	then
    441 		gensrcs_crypto_sha256
    442 		genssa_crypto_sha256
    443 	else
    444 		gensrcs_crypto_sha256 \
    445 			+test.ha
    446 		genssa_crypto_sha256 fmt strings encoding::hex
    447 	fi
    448 }
    449 
    450 crypto_sha1() {
    451 	if [ $testing -eq 0 ]
    452 	then
    453 		gen_srcs crypto::sha1 sha1.ha
    454 		gen_ssa crypto::sha1 bytes hash io endian
    455 	else
    456 		gen_srcs crypto::sha1 sha1.ha +test.ha
    457 		gen_ssa crypto::sha1 bytes hash endian fmt strings encoding::hex
    458 	fi
    459 }
    460 
    461 crypto_sha512() {
    462 	if [ $testing -eq 0 ]
    463 	then
    464 		gen_srcs crypto::sha512 sha512.ha
    465 		gen_ssa crypto::sha512 bytes hash io endian
    466 	else
    467 		gen_srcs crypto::sha512 sha512.ha +test.ha
    468 		gen_ssa crypto::sha512 bytes hash endian fmt strings encoding::hex
    469 	fi
    470 }
    471 
    472 crypto_curve25519() {
    473 	if [ $testing -eq 0 ]
    474 	then
    475 		gen_srcs crypto::curve25519 curve25519.ha
    476 		gen_ssa crypto::curve25519 bytes
    477 	else
    478 		gen_srcs crypto::curve25519 curve25519.ha +test.ha
    479 		gen_ssa crypto::curve25519 bytes fmt io encoding::hex crypto::random
    480 	fi
    481 }
    482 
    483 crypto_ed25519() {
    484 	if [ $testing -eq 0 ]
    485 	then
    486 		gen_srcs crypto::ed25519 ed25519.ha edwards25519.ha
    487 		gen_ssa crypto::ed25519 bytes crypto::sha512 hash
    488 	else
    489 		gen_srcs crypto::ed25519 ed25519.ha edwards25519.ha +test.ha
    490 		gen_ssa crypto::ed25519 bytes crypto::sha512 hash encoding::hex strings
    491 	fi
    492 }
    493 
    494 crypto_x25519() {
    495 	if [ $testing -eq 0 ]
    496 	then
    497 		gen_srcs crypto::x25519 x25519.ha
    498 		gen_ssa crypto::x25519 crypto::curve25519
    499 	else
    500 		gen_srcs crypto::x25519 x25519.ha +test.ha
    501 		gen_ssa crypto::x25519 bytes crypto::curve25519 encoding::hex \
    502 			crypto::random
    503 	fi
    504 }
    505 
    506 dirs() {
    507 	gen_srcs dirs \
    508 		xdg.ha
    509 	gen_ssa dirs fs io os path fmt unix
    510 }
    511 
    512 encoding_base64() {
    513 	gen_srcs encoding::base64 \
    514 		base64.ha
    515 	gen_ssa encoding::base64 ascii bufio bytes errors io os strings
    516 }
    517 
    518 encoding_base32() {
    519 	gen_srcs encoding::base32 \
    520 		base32.ha
    521 	gen_ssa encoding::base32 ascii bufio bytes errors io strings os
    522 }
    523 
    524 encoding_hex() {
    525 	gen_srcs encoding::hex \
    526 		hex.ha
    527 	gen_ssa encoding::hex ascii bytes fmt io strconv strio strings
    528 }
    529 
    530 encoding_json() {
    531 	if [ $testing -eq 0 ]
    532 	then
    533 		gen_srcs encoding::json \
    534 			types.ha \
    535 			lex.ha \
    536 			load.ha \
    537 			dump.ha \
    538 			value.ha
    539 	else
    540 		gen_srcs encoding::json \
    541 			types.ha \
    542 			lex.ha \
    543 			load.ha \
    544 			dump.ha \
    545 			value.ha \
    546 			+test/lexer.ha \
    547 			+test/load.ha \
    548 			+test/value.ha
    549 	fi
    550 	gen_ssa encoding::json ascii bufio io strio os encoding::utf8 strings \
    551 		strconv hash::fnv fmt types
    552 }
    553 
    554 encoding_pem() {
    555 	if [ $testing -eq 0 ]
    556 	then
    557 		gen_srcs encoding::pem \
    558 			pem.ha
    559 	else
    560 		gen_srcs encoding::pem \
    561 			pem.ha \
    562 			+test.ha
    563 	fi
    564 	gen_ssa encoding::pem strings bufio strio io errors bytes \
    565 		encoding::base64 ascii os
    566 }
    567 
    568 encoding_utf8() {
    569 	gen_srcs encoding::utf8 \
    570 		decode.ha \
    571 		encode.ha \
    572 		rune.ha
    573 	gen_ssa encoding::utf8 types
    574 }
    575 
    576 endian() {
    577 	gen_srcs endian \
    578 		big.ha \
    579 		network.ha \
    580 		little.ha \
    581 		endian.ha \
    582 		'host+$(ARCH).ha'
    583 	gen_ssa endian
    584 }
    585 
    586 errors() {
    587 	gen_srcs errors \
    588 		common.ha \
    589 		opaque.ha \
    590 		string.ha \
    591 		rt.ha
    592 	gen_ssa errors
    593 }
    594 
    595 fmt() {
    596 	gen_srcs fmt \
    597 		fmt.ha
    598 	gen_ssa fmt bufio io os strconv strings types
    599 }
    600 
    601 fnmatch() {
    602 	if [ $testing -eq 0 ]
    603 	then
    604 		gen_srcs fnmatch fnmatch.ha
    605 	else
    606 		gen_srcs fnmatch fnmatch.ha +test.ha
    607 	fi
    608 	gen_ssa fnmatch strings bytes sort ascii io fmt
    609 }
    610 
    611 format_elf() {
    612 	gen_srcs format::elf \
    613 		'+$(ARCH).ha' \
    614 		'+$(PLATFORM).ha' \
    615 		types.ha
    616 	gen_ssa format::elf
    617 }
    618 
    619 gensrcs_format_ini() {
    620 	gen_srcs format::ini \
    621 		scan.ha \
    622 		types.ha \
    623 		$*
    624 }
    625 
    626 format_ini() {
    627 	if [ $testing -eq 0 ]
    628 	then
    629 		gensrcs_format_ini
    630 	else
    631 		gensrcs_format_ini +test.ha
    632 	fi
    633 	gen_ssa format::ini bufio encoding::utf8 fmt io strings
    634 }
    635 
    636 format_tar() {
    637 	gen_srcs format::tar \
    638 		types.ha \
    639 		reader.ha
    640 	gen_ssa format::tar bufio bytes endian errors io strconv strings strio
    641 }
    642 
    643 fs() {
    644 	gen_srcs fs \
    645 		types.ha \
    646 		fs.ha \
    647 		util.ha
    648 	gen_ssa fs io strings path time errors
    649 }
    650 
    651 getopt() {
    652 	gen_srcs getopt \
    653 		getopts.ha
    654 	gen_ssa getopt encoding::utf8 fmt io os strings
    655 }
    656 
    657 glob() {
    658 	if [ $testing -eq 0 ]
    659 	then
    660 		gen_srcs glob glob.ha
    661 	else
    662 		gen_srcs glob glob.ha +test.ha
    663 	fi
    664 	gen_ssa glob fnmatch fs io os sort strings strio
    665 }
    666 
    667 hare_ast() {
    668 	gen_srcs hare::ast \
    669 		decl.ha \
    670 		expr.ha \
    671 		ident.ha \
    672 		import.ha \
    673 		type.ha \
    674 		unit.ha
    675 	gen_ssa hare::ast hare::lex strings
    676 }
    677 
    678 gensrcs_hare_types() {
    679 	gen_srcs hare::types \
    680 		arch.ha \
    681 		builtins.ha \
    682 		class.ha \
    683 		hash.ha \
    684 		lookup.ha \
    685 		store.ha \
    686 		types.ha \
    687 		$*
    688 }
    689 
    690 hare_types() {
    691 	if [ $testing -eq 1 ]
    692 	then
    693 		gensrcs_hare_types +test.ha
    694 	else
    695 		gensrcs_hare_types
    696 	fi
    697 	gen_ssa hare::types hare::ast hare::parse hash hash::fnv endian io strings
    698 }
    699 
    700 gensrcs_hare_unit() {
    701 	gen_srcs hare::unit \
    702 		check.ha \
    703 		context.ha \
    704 		errors.ha \
    705 		expr.ha \
    706 		process.ha \
    707 		scan.ha \
    708 		scope.ha \
    709 		unit.ha \
    710 		$*
    711 }
    712 
    713 hare_unit() {
    714 	if [ $testing -eq 1 ]
    715 	then
    716 		gensrcs_hare_unit +test.ha
    717 	else
    718 		gensrcs_hare_unit
    719 	fi
    720 	gen_ssa hare::unit hare::ast hare::types hash hash::fnv strings hare::lex \
    721 		bufio hare::parse
    722 }
    723 
    724 hare_unparse() {
    725 	gen_srcs hare::unparse \
    726 		expr.ha \
    727 		decl.ha \
    728 		ident.ha \
    729 		import.ha \
    730 		type.ha \
    731 		unit.ha \
    732 		util.ha
    733 	gen_ssa hare::unparse fmt io strings strio hare::ast
    734 }
    735 
    736 gensrcs_hare_lex() {
    737 	gen_srcs hare::lex \
    738 		token.ha \
    739 		lex.ha \
    740 		$*
    741 }
    742 
    743 hare_lex() {
    744 	if [ $testing -eq 0 ]
    745 	then
    746 		gensrcs_hare_lex
    747 	else
    748 		gensrcs_hare_lex \
    749 			+test.ha
    750 	fi
    751 	gen_ssa hare::lex io bufio strings fmt sort strio
    752 }
    753 
    754 hare_module() {
    755 	gen_srcs hare::module \
    756 		types.ha \
    757 		context.ha \
    758 		scan.ha \
    759 		manifest.ha \
    760 		walk.ha
    761 	gen_ssa hare::module \
    762 		hare::ast hare::lex hare::parse hare::unparse strio fs io strings hash \
    763 		crypto::sha256 dirs bytes encoding::utf8 ascii fmt time slices bufio \
    764 		strconv os encoding::hex sort errors temp
    765 }
    766 
    767 gensrcs_hare_parse() {
    768 	gen_srcs hare::parse \
    769 		decl.ha \
    770 		expr.ha \
    771 		ident.ha \
    772 		import.ha \
    773 		parse.ha \
    774 		type.ha \
    775 		unit.ha \
    776 		$*
    777 }
    778 
    779 hare_parse() {
    780 	if [ $testing -eq 0 ]
    781 	then
    782 		gensrcs_hare_parse
    783 		gen_ssa hare::parse ascii hare::ast hare::lex fmt types \
    784 			strings math
    785 	else
    786 		gensrcs_hare_parse \
    787 			+test/expr.ha \
    788 			+test/ident.ha \
    789 			+test/loc.ha \
    790 			+test/roundtrip.ha \
    791 			+test/types.ha \
    792 			+test/unit.ha
    793 		gen_ssa hare::parse ascii bufio hare::ast hare::lex \
    794 			hare::unparse io strio fmt strings math
    795 	fi
    796 }
    797 
    798 hash() {
    799 	gen_srcs hash \
    800 		hash.ha
    801 	gen_ssa hash io fmt
    802 }
    803 
    804 hash_adler32() {
    805 	gen_srcs hash::adler32 \
    806 		adler32.ha
    807 	gen_ssa hash::adler32 endian hash io strings
    808 }
    809 
    810 hash_crc16() {
    811 	gen_srcs hash::crc16 \
    812 		crc16.ha
    813 	gen_ssa hash::crc16 endian hash io strings
    814 }
    815 
    816 hash_crc32() {
    817 	gen_srcs hash::crc32 \
    818 		crc32.ha
    819 	gen_ssa hash::crc32 endian hash io strings
    820 }
    821 
    822 hash_crc64() {
    823 	gen_srcs hash::crc64 \
    824 		crc64.ha
    825 	gen_ssa hash::crc64 endian hash io strings
    826 }
    827 
    828 hash_fnv() {
    829 	gen_srcs hash::fnv \
    830 		'+$(ARCH).ha' \
    831 		fnv.ha
    832 	gen_ssa hash::fnv endian hash io strings
    833 }
    834 
    835 hash_siphash() {
    836 	if [ $testing -eq 0 ]
    837 	then
    838 		gen_srcs hash::siphash siphash.ha
    839 		gen_ssa hash::siphash hash io endian
    840 	else
    841 		gen_srcs hash::siphash siphash.ha +test.ha
    842 		gen_ssa hash::siphash hash io endian fmt strio strings
    843 	fi
    844 }
    845 
    846 gensrcs_io() {
    847 	gen_srcs -plinux io \
    848 		'arch+$(ARCH).ha' \
    849 		+linux/file.ha \
    850 		+linux/mmap.ha \
    851 		+linux/vector.ha \
    852 		copy.ha \
    853 		drain.ha \
    854 		empty.ha \
    855 		handle.ha \
    856 		limit.ha \
    857 		stream.ha \
    858 		tee.ha \
    859 		types.ha \
    860 		util.ha \
    861 		zero.ha \
    862 		$*
    863 	gen_srcs -pfreebsd io \
    864 		'arch+$(ARCH).ha' \
    865 		+freebsd/file.ha \
    866 		+freebsd/mmap.ha \
    867 		+freebsd/vector.ha \
    868 		copy.ha \
    869 		drain.ha \
    870 		empty.ha \
    871 		handle.ha \
    872 		limit.ha \
    873 		stream.ha \
    874 		tee.ha \
    875 		types.ha \
    876 		util.ha \
    877 		zero.ha \
    878 		$*
    879 }
    880 
    881 io() {
    882 	if [ $testing -eq 0 ]
    883 	then
    884 		gensrcs_io
    885 	else
    886 		gensrcs_io \
    887 			+test/limit.ha \
    888 			+test/stream.ha
    889 	fi
    890 	gen_ssa -plinux io strings errors bytes
    891 	gen_ssa -pfreebsd io strings errors bytes
    892 }
    893 
    894 linux() {
    895 	gen_srcs -plinux linux \
    896 		start.ha \
    897 		env.ha
    898 	gen_ssa -plinux linux format::elf
    899 }
    900 
    901 linux_keyctl() {
    902 	gen_srcs -plinux linux::keyctl \
    903 		keyctl.ha \
    904 		types.ha
    905 	gen_ssa -plinux linux::keyctl rt errors strings bytes
    906 }
    907 
    908 linux_timerfd() {
    909 	gen_srcs -plinux linux::timerfd \
    910 		timerfd.ha
    911 	gen_ssa -plinux linux::timerfd errors rt time io endian
    912 }
    913 
    914 linux_vdso() {
    915 	gen_srcs -plinux linux::vdso \
    916 		vdso.ha
    917 	gen_ssa -plinux linux::vdso linux strings format::elf
    918 }
    919 
    920 log() {
    921 	gen_srcs -plinux log logger.ha global.ha funcs.ha
    922 	gen_ssa -plinux log datetime fmt io os
    923 	gen_srcs -pfreebsd log logger.ha global.ha funcs.ha
    924 	gen_ssa -pfreebsd log datetime fmt io os
    925 }
    926 
    927 gensrcs_math() {
    928 	gen_srcs math \
    929 		math.ha \
    930 		fenv_func.ha \
    931 		'fenv+$(ARCH).ha' \
    932 		floats.ha  \
    933 		ints.ha \
    934 		uints.ha \
    935 		trig.ha \
    936 		$*
    937 }
    938 
    939 math() {
    940 	if [ $testing -eq 0 ]; then
    941 		gensrcs_math
    942 	else
    943 		gensrcs_math data+test.ha
    944 	fi
    945 	gen_ssa math types
    946 }
    947 
    948 mime() {
    949 	# This module is not built by default because gen-stdlib does not do a good
    950 	# job of resolving @init dependency ordering issues
    951 	gen_srcs mime \
    952 		database.ha \
    953 		lookup.ha \
    954 		parse.ha \
    955 		system.ha
    956 	gen_ssa mime ascii errors string hash::fnv encoding::utf8 bufio \
    957 		errors fs io os fmt
    958 }
    959 
    960 net() {
    961 	gen_srcs -plinux net \
    962 		+linux.ha \
    963 		errors.ha \
    964 		msg.ha
    965 	gen_ssa -plinux net io errors rt fmt
    966 
    967 	gen_srcs -pfreebsd net \
    968 		+freebsd.ha \
    969 		errors.ha \
    970 		msg.ha
    971 	gen_ssa -pfreebsd net io errors rt fmt
    972 }
    973 
    974 net_dial() {
    975 	gen_srcs net::dial \
    976 		registry.ha \
    977 		dial.ha \
    978 		ip.ha \
    979 		resolve.ha
    980 	gen_ssa net::dial net net::ip net::tcp net::udp net::dns \
    981 		crypto::random strconv strings unix::hosts
    982 }
    983 
    984 net_dns() {
    985 	gen_srcs net::dns \
    986 		decode.ha \
    987 		error.ha \
    988 		encode.ha \
    989 		query.ha \
    990 		types.ha
    991 	gen_ssa net::dns ascii endian net net::udp net::ip fmt strings \
    992 		unix::resolvconf unix::poll rt time errors
    993 }
    994 
    995 gensrcs_net_ip() {
    996 	gen_srcs -plinux net::ip \
    997 		+linux.ha \
    998 		ip.ha \
    999 		$*
   1000 	gen_srcs -pfreebsd net::ip \
   1001 		+freebsd.ha \
   1002 		ip.ha \
   1003 		$*
   1004 }
   1005 
   1006 net_ip() {
   1007 	if [ $testing -eq 0 ]
   1008 	then
   1009 		gensrcs_net_ip
   1010 	else
   1011 		gensrcs_net_ip \
   1012 			+test.ha
   1013 	fi
   1014 	gen_ssa -plinux net::ip bytes io strconv strings strio fmt
   1015 	gen_ssa -pfreebsd net::ip bytes io strconv strings strio fmt
   1016 }
   1017 
   1018 net_tcp() {
   1019 	gen_srcs -plinux net::tcp \
   1020 		+linux.ha \
   1021 		listener.ha \
   1022 		options.ha
   1023 	gen_ssa -plinux net::tcp io net net::ip os rt
   1024 
   1025 	gen_srcs -pfreebsd net::tcp \
   1026 		+freebsd.ha \
   1027 		listener.ha \
   1028 		options.ha
   1029 	gen_ssa -pfreebsd net::tcp io net net::ip os rt
   1030 }
   1031 
   1032 net_udp() {
   1033 	gen_srcs -plinux net::udp \
   1034 		+linux.ha \
   1035 		options.ha
   1036 	gen_ssa -plinux net::udp net net::ip errors rt os io
   1037 
   1038 	gen_srcs -pfreebsd net::udp \
   1039 		+freebsd.ha \
   1040 		options.ha
   1041 	gen_ssa -pfreebsd net::udp net net::ip errors rt os io
   1042 }
   1043 
   1044 net_unix() {
   1045 	gen_srcs -plinux net::unix \
   1046 		+linux.ha \
   1047 		addr.ha \
   1048 		cmsg.ha \
   1049 		dial.ha \
   1050 		listener.ha \
   1051 		options.ha \
   1052 		socketpair.ha
   1053 	gen_ssa -plinux net::unix net errors os io strings types fmt net::dial
   1054 
   1055 	gen_srcs -pfreebsd net::unix \
   1056 		+freebsd.ha \
   1057 		addr.ha \
   1058 		cmsg.ha \
   1059 		dial.ha \
   1060 		listener.ha \
   1061 		options.ha \
   1062 		socketpair.ha
   1063 	gen_ssa -pfreebsd net::unix net errors os io strings types fmt net::dial
   1064 }
   1065 
   1066 gensrcs_net_uri() {
   1067 	gen_srcs net::uri \
   1068 		fmt.ha \
   1069 		parse.ha \
   1070 		query.ha \
   1071 		uri.ha \
   1072 		$*
   1073 }
   1074 
   1075 net_uri() {
   1076 	if [ $testing -eq 0 ]
   1077 	then
   1078 		gensrcs_net_uri
   1079 	else
   1080 		gensrcs_net_uri \
   1081 			+test.ha
   1082 	fi
   1083 	gen_ssa net::uri \
   1084 		ascii ip net::ip strconv strings strio
   1085 }
   1086 
   1087 gensrcs_math_complex() {
   1088 	gen_srcs math::complex \
   1089 		complex.ha \
   1090 		$*
   1091 }
   1092 
   1093 math_complex() {
   1094 	if [ $testing -eq 0 ]
   1095 	then
   1096 		gensrcs_math_complex
   1097 	else
   1098 		gensrcs_math_complex \
   1099 			+test.ha
   1100 	fi
   1101 	gen_ssa math::complex math
   1102 }
   1103 
   1104 math_random() {
   1105 	gen_srcs math::random \
   1106 		random.ha
   1107 	gen_ssa math::random
   1108 }
   1109 
   1110 os() {
   1111 	gen_srcs -plinux os \
   1112 		+linux/dirfdfs.ha \
   1113 		+linux/environ.ha \
   1114 		+linux/exit.ha \
   1115 		+linux/fs.ha \
   1116 		+linux/memory.ha \
   1117 		+linux/stdfd.ha \
   1118 		fs.ha
   1119 	gen_ssa -plinux os io strings types fs encoding::utf8 bytes bufio errors
   1120 
   1121 	gen_srcs -pfreebsd os \
   1122 		+freebsd/environ.ha \
   1123 		+freebsd/exit.ha \
   1124 		+freebsd/dirfdfs.ha \
   1125 		+freebsd/stdfd.ha \
   1126 		+freebsd/fs.ha \
   1127 		fs.ha
   1128 	gen_ssa -pfreebsd os io strings types fs encoding::utf8 bytes bufio errors
   1129 }
   1130 
   1131 os_exec() {
   1132 	gen_srcs -plinux os::exec \
   1133 		exec+linux.ha \
   1134 		process+linux.ha \
   1135 		types.ha \
   1136 		cmd.ha
   1137 	gen_ssa -plinux os::exec os strings fmt bytes path errors unix
   1138 
   1139 	gen_srcs -pfreebsd os::exec \
   1140 		exec+freebsd.ha \
   1141 		process+freebsd.ha \
   1142 		types.ha \
   1143 		cmd.ha
   1144 	gen_ssa -pfreebsd os::exec os strings fmt bytes path errors unix
   1145 }
   1146 
   1147 path() {
   1148 	gen_srcs path \
   1149 		'+$(PLATFORM).ha' \
   1150 		buffer.ha \
   1151 		util.ha \
   1152 		join.ha \
   1153 		names.ha \
   1154 		iter.ha
   1155 	gen_ssa path strings bufio bytes io
   1156 }
   1157 
   1158 regex() {
   1159 	if [ $testing -eq 0 ]; then
   1160 		gen_srcs regex regex.ha
   1161 		gen_ssa regex encoding::utf8 errors strconv strings
   1162 	else
   1163 		gen_srcs regex regex.ha +test.ha
   1164 		gen_ssa regex encoding::utf8 errors strconv strings fmt io os
   1165 	fi
   1166 }
   1167 
   1168 gensrcs_strconv() {
   1169 	gen_srcs strconv \
   1170 		types.ha \
   1171 		itos.ha \
   1172 		utos.ha \
   1173 		stou.ha \
   1174 		stoi.ha \
   1175 		numeric.ha \
   1176 		ftos.ha \
   1177 		stof.ha \
   1178 		stof_data.ha \
   1179 		$*
   1180 }
   1181 
   1182 gensrcs_shlex() {
   1183 	gen_srcs shlex \
   1184 		escape.ha \
   1185 		split.ha \
   1186 		$*
   1187 }
   1188 
   1189 shlex() {
   1190 	if [ $testing -eq 0 ]
   1191 	then
   1192 		gensrcs_shlex
   1193 	else
   1194 		gensrcs_shlex \
   1195 			+test.ha
   1196 	fi
   1197 	gen_ssa shlex ascii bufio encoding::utf8 io strings strio
   1198 }
   1199 
   1200 slices() {
   1201 	gen_srcs slices \
   1202 		cap.ha \
   1203 		reverse.ha \
   1204 		trunc.ha \
   1205 		void.ha
   1206 	gen_ssa slices types
   1207 }
   1208 
   1209 gensrcs_sort() {
   1210 	gen_srcs sort \
   1211 		bisect.ha \
   1212 		search.ha \
   1213 		sort.ha \
   1214 		types.ha \
   1215 		$*
   1216 }
   1217 
   1218 sort() {
   1219 	if [ $testing -eq 0 ]
   1220 	then
   1221 		gensrcs_sort
   1222 	else
   1223 		gensrcs_sort \
   1224 			+test.ha
   1225 	fi
   1226 	gen_ssa sort strings
   1227 }
   1228 
   1229 strconv() {
   1230 	if [ $testing -eq 0 ]
   1231 	then
   1232 		gensrcs_strconv
   1233 	else
   1234 		gensrcs_strconv \
   1235 			+test/stou.ha \
   1236 			+test/stoi.ha
   1237 	fi
   1238 	gen_ssa strconv types strings ascii math
   1239 }
   1240 
   1241 strings() {
   1242 	gen_srcs strings \
   1243 		cap.ha \
   1244 		concat.ha \
   1245 		contains.ha \
   1246 		cstrings.ha \
   1247 		dup.ha \
   1248 		iter.ha \
   1249 		runes.ha \
   1250 		sub.ha \
   1251 		suffix.ha \
   1252 		tokenize.ha \
   1253 		utf8.ha \
   1254 		index.ha \
   1255 		trim.ha \
   1256 		compare.ha \
   1257 		pad.ha \
   1258 		replace.ha
   1259 	gen_ssa strings bytes encoding::utf8 types
   1260 }
   1261 
   1262 strings_template() {
   1263 	gen_srcs strings::template \
   1264 		template.ha
   1265 	gen_ssa strings::template ascii errors fmt io strings strio
   1266 }
   1267 
   1268 strio() {
   1269 	gen_srcs strio \
   1270 		stream.ha \
   1271 		ops.ha
   1272 	gen_ssa strio io strings slices encoding::utf8 errors
   1273 }
   1274 
   1275 temp() {
   1276 	gen_srcs -plinux temp +linux.ha
   1277 	gen_ssa -plinux temp \
   1278 		crypto::random encoding::hex errors fs io os path strio fmt
   1279 
   1280 	gen_srcs -pfreebsd temp +freebsd.ha
   1281 	gen_ssa -pfreebsd temp \
   1282 		crypto::random encoding::hex errors fs io os path strio fmt
   1283 }
   1284 
   1285 time() {
   1286 	gen_srcs -plinux time \
   1287 		+linux/functions.ha \
   1288 		+linux/+'$(ARCH)'.ha \
   1289 		arithm.ha \
   1290 		conv.ha \
   1291 		types.ha
   1292 	gen_ssa -plinux time \
   1293 		linux::vdso math
   1294 	gen_srcs -pfreebsd time \
   1295 		+freebsd/functions.ha \
   1296 		arithm.ha \
   1297 		conv.ha \
   1298 		types.ha
   1299 	gen_ssa -pfreebsd time \
   1300 		math
   1301 }
   1302 
   1303 time_chrono() {
   1304 	gen_srcs -plinux time::chrono \
   1305 		+linux.ha \
   1306 		chronology.ha \
   1307 		leapsec.ha \
   1308 		timescale.ha \
   1309 		timezone.ha \
   1310 		tzdb.ha
   1311 	gen_ssa -plinux time::chrono \
   1312 		bufio bytes encoding::utf8 endian errors fs io os strconv strings time path
   1313 	gen_srcs -pfreebsd time::chrono \
   1314 		+freebsd.ha \
   1315 		chronology.ha \
   1316 		leapsec.ha \
   1317 		timescale.ha \
   1318 		timezone.ha \
   1319 		tzdb.ha
   1320 	gen_ssa -pfreebsd time::chrono \
   1321 		bufio bytes encoding::utf8 endian errors fs io os strconv strings time path
   1322 }
   1323 
   1324 types() {
   1325 	gen_srcs types \
   1326 		limits.ha \
   1327 		classes.ha \
   1328 		'arch+$(ARCH).ha'
   1329 	gen_ssa types
   1330 }
   1331 
   1332 unix() {
   1333 	# XXX: getuid and setuid are probably platform-specific too
   1334 	gen_srcs -plinux unix \
   1335 		+linux/nice.ha \
   1336 		+linux/pipe.ha \
   1337 		+linux/umask.ha \
   1338 		getuid.ha \
   1339 		setuid.ha
   1340 	gen_ssa -plinux unix errors fs io
   1341 
   1342 	gen_srcs -pfreebsd unix \
   1343 		+freebsd/nice.ha \
   1344 		+freebsd/pipe.ha \
   1345 		+freebsd/umask.ha \
   1346 		getuid.ha \
   1347 		setuid.ha
   1348 	gen_ssa -pfreebsd unix errors fs io
   1349 }
   1350 
   1351 unix_hosts() {
   1352 	gen_srcs -plinux unix::hosts \
   1353 		+linux.ha \
   1354 		lookup.ha
   1355 	gen_ssa -plinux unix::hosts os io bufio net::ip strings
   1356 
   1357 	gen_srcs -pfreebsd unix::hosts \
   1358 		+freebsd.ha \
   1359 		lookup.ha
   1360 	gen_ssa -pfreebsd unix::hosts os io bufio net::ip strings
   1361 }
   1362 
   1363 unix_passwd() {
   1364 	gen_srcs unix::passwd \
   1365 		group.ha \
   1366 		passwd.ha \
   1367 		types.ha
   1368 	gen_ssa unix::passwd bufio io os strconv strings
   1369 }
   1370 
   1371 unix_poll() {
   1372 	gen_srcs -plinux unix::poll +linux.ha
   1373 	gen_ssa -plinux unix::poll rt errors time io
   1374 
   1375 	gen_srcs -pfreebsd unix::poll +freebsd.ha
   1376 	gen_ssa -pfreebsd unix::poll rt errors time io
   1377 }
   1378 
   1379 unix_resolvconf() {
   1380 	gen_srcs -plinux unix::resolvconf \
   1381 		+linux.ha \
   1382 		load.ha
   1383 	gen_ssa -plinux unix::resolvconf os io bufio net::ip strings
   1384 
   1385 	gen_srcs -pfreebsd unix::resolvconf \
   1386 		+freebsd.ha \
   1387 		load.ha
   1388 	gen_ssa -pfreebsd unix::resolvconf os io bufio net::ip strings
   1389 }
   1390 
   1391 unix_signal() {
   1392 	gen_srcs -plinux unix::signal \
   1393 		types.ha \
   1394 		+linux.ha
   1395 	gen_ssa -plinux unix::signal io errors
   1396 }
   1397 
   1398 unix_tty() {
   1399 	gen_srcs -plinux unix::tty \
   1400 		types.ha \
   1401 		+linux/isatty.ha \
   1402 		+linux/open.ha \
   1403 		+linux/termios.ha \
   1404 		+linux/winsize.ha
   1405 	gen_ssa -plinux unix::tty rt fs io os
   1406 
   1407 	gen_srcs -pfreebsd unix::tty \
   1408 		types.ha \
   1409 		+freebsd/isatty.ha \
   1410 		+freebsd/open.ha \
   1411 		+freebsd/winsize.ha
   1412 	gen_ssa -pfreebsd unix::tty rt fs io os
   1413 }
   1414 
   1415 uuid() {
   1416 	gen_srcs uuid \
   1417 		uuid.ha
   1418 	gen_ssa uuid crypto::random strio fmt endian io bytes bufio strings strconv
   1419 }
   1420 
   1421 # List of modules and their supported platforms. Place a tab between the module
   1422 # and its platform list, and spaces between each supported platform. Omitting
   1423 # the platform list implies all platforms are supported.
   1424 modules="ascii
   1425 bufio
   1426 bytes
   1427 crypto
   1428 crypto::aes
   1429 crypto::aes::xts
   1430 crypto::argon2
   1431 crypto::bcrypt
   1432 crypto::blake2b
   1433 crypto::blowfish
   1434 crypto::chacha
   1435 crypto::cipher
   1436 crypto::hkdf
   1437 crypto::hmac
   1438 crypto::mac
   1439 crypto::math
   1440 crypto::random	linux freebsd
   1441 crypto::poly1305
   1442 crypto::salsa
   1443 crypto::sha1
   1444 crypto::sha256
   1445 crypto::sha512
   1446 crypto::curve25519
   1447 crypto::ed25519
   1448 crypto::x25519
   1449 datetime	linux freebsd
   1450 dirs
   1451 encoding::base64
   1452 encoding::base32
   1453 encoding::hex
   1454 encoding::json
   1455 encoding::pem
   1456 encoding::utf8
   1457 endian
   1458 errors
   1459 fmt
   1460 fnmatch
   1461 format::elf
   1462 format::ini
   1463 format::tar
   1464 fs
   1465 getopt
   1466 glob
   1467 hare::ast
   1468 hare::lex
   1469 hare::module
   1470 hare::parse
   1471 hare::types
   1472 hare::unit
   1473 hare::unparse
   1474 hash
   1475 hash::adler32
   1476 hash::crc16
   1477 hash::crc32
   1478 hash::crc64
   1479 hash::fnv
   1480 hash::siphash
   1481 io			linux freebsd
   1482 linux			linux
   1483 linux::keyctl		linux
   1484 linux::timerfd	linux
   1485 linux::vdso		linux
   1486 log	linux freebsd
   1487 math
   1488 math::complex
   1489 math::random
   1490 net			linux freebsd
   1491 net::dial
   1492 net::dns
   1493 net::ip			linux freebsd
   1494 net::tcp		linux freebsd
   1495 net::udp		linux freebsd
   1496 net::unix		linux freebsd
   1497 net::uri
   1498 os			linux freebsd
   1499 os::exec		linux freebsd
   1500 path
   1501 regex
   1502 shlex
   1503 slices
   1504 sort
   1505 strconv
   1506 strings
   1507 strings::template
   1508 strio
   1509 temp			linux freebsd
   1510 time			linux freebsd
   1511 time::chrono	linux freebsd
   1512 types
   1513 unix			linux freebsd
   1514 unix::hosts	linux freebsd
   1515 unix::passwd
   1516 unix::poll		linux freebsd
   1517 unix::resolvconf	linux freebsd
   1518 unix::signal		linux
   1519 unix::tty		linux freebsd
   1520 uuid"
   1521 stdlib() {
   1522 	rt
   1523 	IFS="
   1524 "
   1525 	for module in $modules; do
   1526 		unset IFS
   1527 		if [ -z "$(echo "$module" | cut -sf1)" ]
   1528 		then
   1529 			gen_lib "$module"
   1530 		else
   1531 			platforms="$(echo "$module" | cut -sf2-)"
   1532 			module="$(echo "$module" | cut -sf1)"
   1533 			for platform in $platforms
   1534 			do
   1535 				gen_lib -p "$platform" "$module"
   1536 			done
   1537 		fi
   1538 		IFS="
   1539 "
   1540 	done
   1541 	IFS="
   1542 "
   1543 	for module in $modules; do
   1544 		unset IFS
   1545 		if [ -n "$(echo "$module" | cut -sf1)" ]
   1546 		then
   1547 			module="$(echo "$module" | cut -sf1)"
   1548 		fi
   1549 		"$(mod_file "$module")"
   1550 		IFS="
   1551 "
   1552 	done
   1553 	unset IFS
   1554 }
   1555 
   1556 if [ ${DOCS:-0} -ne 1 ]
   1557 then
   1558 	printf '# This file is generated by the gen-stdlib script, do not edit it by hand\n\n'
   1559 	genrules
   1560 	genrules test
   1561 fi