commit 3bee9a4d41eb1fb11c80ae84041d669c71dcbc0a
parent c6fb576d6457ff6f30d41df911c25b828a3a1fa0
Author: Eyal Sawady <ecs@d2evs.net>
Date: Thu, 4 Feb 2021 21:50:34 -0500
gen-stdlib: gen_lib all modules upfront
Fixes some weirdness requiring modules to be generated after their
dependencies.
Also alpha-sort modules now that that's possible.
Diffstat:
M | gen-stdlib | | | 126 | ++++++++++++++++++++++++++++++++++++++----------------------------------------- |
M | mk/stdlib.mk | | | 316 | ++++++++++++++++++++++++++++++++++++++++---------------------------------------- |
2 files changed, 218 insertions(+), 224 deletions(-)
diff --git a/gen-stdlib b/gen-stdlib
@@ -6,10 +6,8 @@
#
# gen_srcs module::name list.ha of.ha sources.ha
# gen_ssa module::name list of module::names yours depends on
-# gen_lib module::name
#
-# Then add your module to the list of modules at the bottom, making sure it
-# comes after any of its dependencies.
+# Then add your module to the list of modules at the bottom.
#
# Then run ./gen-stdlib > mk/stdlib.mk to generate new rules.
@@ -91,7 +89,6 @@ ascii() {
gen_srcs ascii \
ctype.ha
gen_ssa ascii
- gen_lib ascii
}
bytes() {
@@ -102,17 +99,23 @@ bytes() {
index.ha \
reverse.ha
gen_ssa bytes
- gen_lib bytes
}
-types() {
- printf '# types\n'
- gen_srcs types \
- limits.ha \
- classes.ha \
- 'arch$(ARCH).ha'
- gen_ssa types
- gen_lib types
+encoding_utf8() {
+ # XXX: Also has ordering issues
+ printf '# encoding::utf8\n'
+ gen_srcs encoding::utf8 \
+ rune.ha \
+ decode.ha \
+ encode.ha
+ gen_ssa encoding::utf8 types
+}
+
+fmt() {
+ printf '# fmt\n'
+ gen_srcs fmt \
+ fmt.ha
+ gen_ssa fmt io os strconv strings types
}
gensrcs_strconv() {
@@ -124,19 +127,6 @@ gensrcs_strconv() {
$*
}
-strconv() {
- printf '# strconv\n'
- if [ $testing -eq 0 ]
- then
- gensrcs_strconv
- else
- gensrcs_strconv \
- stou+test.ha
- fi
- gen_ssa strconv types strings ascii
- gen_lib strconv
-}
-
gensrcs_io() {
gen_srcs io \
'arch$(ARCH).ha' \
@@ -159,29 +149,6 @@ io() {
copy+test.ha
fi
gen_ssa io
- gen_lib io
-}
-
-encoding_utf8() {
- # XXX: Also has ordering issues
- printf '# encoding::utf8\n'
- gen_srcs encoding::utf8 \
- rune.ha \
- decode.ha \
- encode.ha
- gen_ssa encoding::utf8 types
- gen_lib encoding::utf8
-}
-
-strings() {
- printf '# strings\n'
- gen_srcs strings \
- cstrings.ha \
- dup.ha \
- iter.ha \
- utf8.ha
- gen_ssa strings encoding::utf8 types
- gen_lib strings
}
os() {
@@ -196,31 +163,58 @@ os() {
environ.ha \
stdfd.ha
gen_ssa os strings types
- gen_lib os
}
-fmt() {
- printf '# fmt\n'
- gen_srcs fmt \
- fmt.ha
- gen_ssa fmt io os strconv strings types
- gen_lib fmt
+strconv() {
+ printf '# strconv\n'
+ if [ $testing -eq 0 ]
+ then
+ gensrcs_strconv
+ else
+ gensrcs_strconv \
+ stou+test.ha
+ fi
+ gen_ssa strconv types strings ascii
+}
+
+strings() {
+ printf '# strings\n'
+ gen_srcs strings \
+ cstrings.ha \
+ dup.ha \
+ iter.ha \
+ utf8.ha
+ gen_ssa strings encoding::utf8 types
+}
+
+types() {
+ printf '# types\n'
+ gen_srcs types \
+ limits.ha \
+ classes.ha \
+ 'arch$(ARCH).ha'
+ gen_ssa types
}
printf '# This file is generated by the gen-stdlib script, do not edit it by hand\n\n'
+modules="ascii
+bytes
+encoding_utf8
+fmt
+io
+os
+strconv
+strings
+types"
stdlib() {
- # Keep me ordered with respect to dependencies
rt
- ascii
- bytes
- types
- io
- encoding_utf8
- strings
- strconv
- os
- fmt
+ for module in $modules; do
+ gen_lib "$(printf "%s" "$module" | tr -s '_' '::')"
+ done
+ for module in $modules; do
+ "$module"
+ done
}
genrules
diff --git a/mk/stdlib.mk b/mk/stdlib.mk
@@ -57,6 +57,33 @@ stdlib_rt=$(HARECACHE)/rt/rt.a
stdlib_start=$(HARECACHE)/rt/start.o
hare_stdlib_deps+=$(stdlib_rt)
+stdlib_ascii=$(HARECACHE)/ascii/ascii.o
+hare_stdlib_deps+=$(stdlib_ascii)
+
+stdlib_bytes=$(HARECACHE)/bytes/bytes.o
+hare_stdlib_deps+=$(stdlib_bytes)
+
+stdlib_encoding_utf8=$(HARECACHE)/encoding/utf8/encoding.utf8.o
+hare_stdlib_deps+=$(stdlib_encoding_utf8)
+
+stdlib_fmt=$(HARECACHE)/fmt/fmt.o
+hare_stdlib_deps+=$(stdlib_fmt)
+
+stdlib_io=$(HARECACHE)/io/io.o
+hare_stdlib_deps+=$(stdlib_io)
+
+stdlib_os=$(HARECACHE)/os/os.o
+hare_stdlib_deps+=$(stdlib_os)
+
+stdlib_strconv=$(HARECACHE)/strconv/strconv.o
+hare_stdlib_deps+=$(stdlib_strconv)
+
+stdlib_strings=$(HARECACHE)/strings/strings.o
+hare_stdlib_deps+=$(stdlib_strings)
+
+stdlib_types=$(HARECACHE)/types/types.o
+hare_stdlib_deps+=$(stdlib_types)
+
# ascii
stdlib_ascii_srcs= \
$(STDLIB)/ascii/ctype.ha
@@ -67,9 +94,6 @@ $(HARECACHE)/ascii/ascii.ssa: $(stdlib_ascii_srcs) $(stdlib_rt)
@HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) -o $@ -Nascii \
-t$(HARECACHE)/ascii/ascii.td $(stdlib_ascii_srcs)
-stdlib_stdlib_ascii=$(HARECACHE)/ascii/ascii.o
-hare_stdlib_deps+=$(stdlib_stdlib_ascii)
-
# bytes
stdlib_bytes_srcs= \
$(STDLIB)/bytes/copy.ha \
@@ -83,23 +107,27 @@ $(HARECACHE)/bytes/bytes.ssa: $(stdlib_bytes_srcs) $(stdlib_rt)
@HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) -o $@ -Nbytes \
-t$(HARECACHE)/bytes/bytes.td $(stdlib_bytes_srcs)
-stdlib_stdlib_bytes=$(HARECACHE)/bytes/bytes.o
-hare_stdlib_deps+=$(stdlib_stdlib_bytes)
-
-# types
-stdlib_types_srcs= \
- $(STDLIB)/types/limits.ha \
- $(STDLIB)/types/classes.ha \
- $(STDLIB)/types/arch$(ARCH).ha
+# encoding::utf8
+stdlib_encoding_utf8_srcs= \
+ $(STDLIB)/encoding/utf8/rune.ha \
+ $(STDLIB)/encoding/utf8/decode.ha \
+ $(STDLIB)/encoding/utf8/encode.ha
-$(HARECACHE)/types/types.ssa: $(stdlib_types_srcs) $(stdlib_rt)
+$(HARECACHE)/encoding/utf8/encoding.utf8.ssa: $(stdlib_encoding_utf8_srcs) $(stdlib_rt) $(stdlib_types)
@printf 'HAREC \t$@\n'
- @mkdir -p $(HARECACHE)/types
- @HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) -o $@ -Ntypes \
- -t$(HARECACHE)/types/types.td $(stdlib_types_srcs)
+ @mkdir -p $(HARECACHE)/encoding/utf8
+ @HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) -o $@ -Nencoding::utf8 \
+ -t$(HARECACHE)/encoding/utf8/encoding.utf8.td $(stdlib_encoding_utf8_srcs)
-stdlib_stdlib_types=$(HARECACHE)/types/types.o
-hare_stdlib_deps+=$(stdlib_stdlib_types)
+# fmt
+stdlib_fmt_srcs= \
+ $(STDLIB)/fmt/fmt.ha
+
+$(HARECACHE)/fmt/fmt.ssa: $(stdlib_fmt_srcs) $(stdlib_rt) $(stdlib_io) $(stdlib_os) $(stdlib_strconv) $(stdlib_strings) $(stdlib_types)
+ @printf 'HAREC \t$@\n'
+ @mkdir -p $(HARECACHE)/fmt
+ @HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) -o $@ -Nfmt \
+ -t$(HARECACHE)/fmt/fmt.td $(stdlib_fmt_srcs)
# io
stdlib_io_srcs= \
@@ -115,56 +143,6 @@ $(HARECACHE)/io/io.ssa: $(stdlib_io_srcs) $(stdlib_rt)
@HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) -o $@ -Nio \
-t$(HARECACHE)/io/io.td $(stdlib_io_srcs)
-stdlib_stdlib_io=$(HARECACHE)/io/io.o
-hare_stdlib_deps+=$(stdlib_stdlib_io)
-
-# encoding::utf8
-stdlib_encoding_utf8_srcs= \
- $(STDLIB)/encoding/utf8/rune.ha \
- $(STDLIB)/encoding/utf8/decode.ha \
- $(STDLIB)/encoding/utf8/encode.ha
-
-$(HARECACHE)/encoding/utf8/encoding.utf8.ssa: $(stdlib_encoding_utf8_srcs) $(stdlib_rt) $(stdlib_stdlib_types)
- @printf 'HAREC \t$@\n'
- @mkdir -p $(HARECACHE)/encoding/utf8
- @HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) -o $@ -Nencoding::utf8 \
- -t$(HARECACHE)/encoding/utf8/encoding.utf8.td $(stdlib_encoding_utf8_srcs)
-
-stdlib_stdlib_encoding_utf8=$(HARECACHE)/encoding/utf8/encoding.utf8.o
-hare_stdlib_deps+=$(stdlib_stdlib_encoding_utf8)
-
-# strings
-stdlib_strings_srcs= \
- $(STDLIB)/strings/cstrings.ha \
- $(STDLIB)/strings/dup.ha \
- $(STDLIB)/strings/iter.ha \
- $(STDLIB)/strings/utf8.ha
-
-$(HARECACHE)/strings/strings.ssa: $(stdlib_strings_srcs) $(stdlib_rt) $(stdlib_stdlib_encoding_utf8) $(stdlib_stdlib_types)
- @printf 'HAREC \t$@\n'
- @mkdir -p $(HARECACHE)/strings
- @HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) -o $@ -Nstrings \
- -t$(HARECACHE)/strings/strings.td $(stdlib_strings_srcs)
-
-stdlib_stdlib_strings=$(HARECACHE)/strings/strings.o
-hare_stdlib_deps+=$(stdlib_stdlib_strings)
-
-# strconv
-stdlib_strconv_srcs= \
- $(STDLIB)/strconv/itos.ha \
- $(STDLIB)/strconv/utos.ha \
- $(STDLIB)/strconv/stou.ha \
- $(STDLIB)/strconv/numeric.ha
-
-$(HARECACHE)/strconv/strconv.ssa: $(stdlib_strconv_srcs) $(stdlib_rt) $(stdlib_stdlib_types) $(stdlib_stdlib_strings) $(stdlib_stdlib_ascii)
- @printf 'HAREC \t$@\n'
- @mkdir -p $(HARECACHE)/strconv
- @HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) -o $@ -Nstrconv \
- -t$(HARECACHE)/strconv/strconv.td $(stdlib_strconv_srcs)
-
-stdlib_stdlib_strconv=$(HARECACHE)/strconv/strconv.o
-hare_stdlib_deps+=$(stdlib_stdlib_strconv)
-
# os
stdlib_os_srcs= \
$(STDLIB)/os/$(PLATFORM)/environ.ha \
@@ -176,27 +154,49 @@ stdlib_os_srcs= \
$(STDLIB)/os/environ.ha \
$(STDLIB)/os/stdfd.ha
-$(HARECACHE)/os/os.ssa: $(stdlib_os_srcs) $(stdlib_rt) $(stdlib_stdlib_strings) $(stdlib_stdlib_types)
+$(HARECACHE)/os/os.ssa: $(stdlib_os_srcs) $(stdlib_rt) $(stdlib_strings) $(stdlib_types)
@printf 'HAREC \t$@\n'
@mkdir -p $(HARECACHE)/os
@HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) -o $@ -Nos \
-t$(HARECACHE)/os/os.td $(stdlib_os_srcs)
-stdlib_stdlib_os=$(HARECACHE)/os/os.o
-hare_stdlib_deps+=$(stdlib_stdlib_os)
+# strconv
+stdlib_strconv_srcs= \
+ $(STDLIB)/strconv/itos.ha \
+ $(STDLIB)/strconv/utos.ha \
+ $(STDLIB)/strconv/stou.ha \
+ $(STDLIB)/strconv/numeric.ha
-# fmt
-stdlib_fmt_srcs= \
- $(STDLIB)/fmt/fmt.ha
+$(HARECACHE)/strconv/strconv.ssa: $(stdlib_strconv_srcs) $(stdlib_rt) $(stdlib_types) $(stdlib_strings) $(stdlib_ascii)
+ @printf 'HAREC \t$@\n'
+ @mkdir -p $(HARECACHE)/strconv
+ @HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) -o $@ -Nstrconv \
+ -t$(HARECACHE)/strconv/strconv.td $(stdlib_strconv_srcs)
+
+# strings
+stdlib_strings_srcs= \
+ $(STDLIB)/strings/cstrings.ha \
+ $(STDLIB)/strings/dup.ha \
+ $(STDLIB)/strings/iter.ha \
+ $(STDLIB)/strings/utf8.ha
-$(HARECACHE)/fmt/fmt.ssa: $(stdlib_fmt_srcs) $(stdlib_rt) $(stdlib_stdlib_io) $(stdlib_stdlib_os) $(stdlib_stdlib_strconv) $(stdlib_stdlib_strings) $(stdlib_stdlib_types)
+$(HARECACHE)/strings/strings.ssa: $(stdlib_strings_srcs) $(stdlib_rt) $(stdlib_encoding_utf8) $(stdlib_types)
@printf 'HAREC \t$@\n'
- @mkdir -p $(HARECACHE)/fmt
- @HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) -o $@ -Nfmt \
- -t$(HARECACHE)/fmt/fmt.td $(stdlib_fmt_srcs)
+ @mkdir -p $(HARECACHE)/strings
+ @HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) -o $@ -Nstrings \
+ -t$(HARECACHE)/strings/strings.td $(stdlib_strings_srcs)
+
+# types
+stdlib_types_srcs= \
+ $(STDLIB)/types/limits.ha \
+ $(STDLIB)/types/classes.ha \
+ $(STDLIB)/types/arch$(ARCH).ha
-stdlib_stdlib_fmt=$(HARECACHE)/fmt/fmt.o
-hare_stdlib_deps+=$(stdlib_stdlib_fmt)
+$(HARECACHE)/types/types.ssa: $(stdlib_types_srcs) $(stdlib_rt)
+ @printf 'HAREC \t$@\n'
+ @mkdir -p $(HARECACHE)/types
+ @HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) -o $@ -Ntypes \
+ -t$(HARECACHE)/types/types.td $(stdlib_types_srcs)
# rt
testlib_rt_srcs= \
@@ -255,6 +255,33 @@ testlib_rt=$(TESTCACHE)/rt/rt.a
testlib_start=$(TESTCACHE)/rt/start.o
hare_testlib_deps+=$(testlib_rt)
+testlib_ascii=$(TESTCACHE)/ascii/ascii.o
+hare_testlib_deps+=$(testlib_ascii)
+
+testlib_bytes=$(TESTCACHE)/bytes/bytes.o
+hare_testlib_deps+=$(testlib_bytes)
+
+testlib_encoding_utf8=$(TESTCACHE)/encoding/utf8/encoding.utf8.o
+hare_testlib_deps+=$(testlib_encoding_utf8)
+
+testlib_fmt=$(TESTCACHE)/fmt/fmt.o
+hare_testlib_deps+=$(testlib_fmt)
+
+testlib_io=$(TESTCACHE)/io/io.o
+hare_testlib_deps+=$(testlib_io)
+
+testlib_os=$(TESTCACHE)/os/os.o
+hare_testlib_deps+=$(testlib_os)
+
+testlib_strconv=$(TESTCACHE)/strconv/strconv.o
+hare_testlib_deps+=$(testlib_strconv)
+
+testlib_strings=$(TESTCACHE)/strings/strings.o
+hare_testlib_deps+=$(testlib_strings)
+
+testlib_types=$(TESTCACHE)/types/types.o
+hare_testlib_deps+=$(testlib_types)
+
# ascii
testlib_ascii_srcs= \
$(STDLIB)/ascii/ctype.ha
@@ -265,9 +292,6 @@ $(TESTCACHE)/ascii/ascii.ssa: $(testlib_ascii_srcs) $(testlib_rt)
@HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) -o $@ -Nascii \
-t$(TESTCACHE)/ascii/ascii.td $(testlib_ascii_srcs)
-testlib_testlib_ascii=$(TESTCACHE)/ascii/ascii.o
-hare_testlib_deps+=$(testlib_testlib_ascii)
-
# bytes
testlib_bytes_srcs= \
$(STDLIB)/bytes/copy.ha \
@@ -281,23 +305,27 @@ $(TESTCACHE)/bytes/bytes.ssa: $(testlib_bytes_srcs) $(testlib_rt)
@HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) -o $@ -Nbytes \
-t$(TESTCACHE)/bytes/bytes.td $(testlib_bytes_srcs)
-testlib_testlib_bytes=$(TESTCACHE)/bytes/bytes.o
-hare_testlib_deps+=$(testlib_testlib_bytes)
-
-# types
-testlib_types_srcs= \
- $(STDLIB)/types/limits.ha \
- $(STDLIB)/types/classes.ha \
- $(STDLIB)/types/arch$(ARCH).ha
+# encoding::utf8
+testlib_encoding_utf8_srcs= \
+ $(STDLIB)/encoding/utf8/rune.ha \
+ $(STDLIB)/encoding/utf8/decode.ha \
+ $(STDLIB)/encoding/utf8/encode.ha
-$(TESTCACHE)/types/types.ssa: $(testlib_types_srcs) $(testlib_rt)
+$(TESTCACHE)/encoding/utf8/encoding.utf8.ssa: $(testlib_encoding_utf8_srcs) $(testlib_rt) $(testlib_types)
@printf 'HAREC \t$@\n'
- @mkdir -p $(TESTCACHE)/types
- @HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) -o $@ -Ntypes \
- -t$(TESTCACHE)/types/types.td $(testlib_types_srcs)
+ @mkdir -p $(TESTCACHE)/encoding/utf8
+ @HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) -o $@ -Nencoding::utf8 \
+ -t$(TESTCACHE)/encoding/utf8/encoding.utf8.td $(testlib_encoding_utf8_srcs)
-testlib_testlib_types=$(TESTCACHE)/types/types.o
-hare_testlib_deps+=$(testlib_testlib_types)
+# fmt
+testlib_fmt_srcs= \
+ $(STDLIB)/fmt/fmt.ha
+
+$(TESTCACHE)/fmt/fmt.ssa: $(testlib_fmt_srcs) $(testlib_rt) $(testlib_io) $(testlib_os) $(testlib_strconv) $(testlib_strings) $(testlib_types)
+ @printf 'HAREC \t$@\n'
+ @mkdir -p $(TESTCACHE)/fmt
+ @HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) -o $@ -Nfmt \
+ -t$(TESTCACHE)/fmt/fmt.td $(testlib_fmt_srcs)
# io
testlib_io_srcs= \
@@ -314,39 +342,22 @@ $(TESTCACHE)/io/io.ssa: $(testlib_io_srcs) $(testlib_rt)
@HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) -o $@ -Nio \
-t$(TESTCACHE)/io/io.td $(testlib_io_srcs)
-testlib_testlib_io=$(TESTCACHE)/io/io.o
-hare_testlib_deps+=$(testlib_testlib_io)
-
-# encoding::utf8
-testlib_encoding_utf8_srcs= \
- $(STDLIB)/encoding/utf8/rune.ha \
- $(STDLIB)/encoding/utf8/decode.ha \
- $(STDLIB)/encoding/utf8/encode.ha
-
-$(TESTCACHE)/encoding/utf8/encoding.utf8.ssa: $(testlib_encoding_utf8_srcs) $(testlib_rt) $(testlib_testlib_types)
- @printf 'HAREC \t$@\n'
- @mkdir -p $(TESTCACHE)/encoding/utf8
- @HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) -o $@ -Nencoding::utf8 \
- -t$(TESTCACHE)/encoding/utf8/encoding.utf8.td $(testlib_encoding_utf8_srcs)
-
-testlib_testlib_encoding_utf8=$(TESTCACHE)/encoding/utf8/encoding.utf8.o
-hare_testlib_deps+=$(testlib_testlib_encoding_utf8)
-
-# strings
-testlib_strings_srcs= \
- $(STDLIB)/strings/cstrings.ha \
- $(STDLIB)/strings/dup.ha \
- $(STDLIB)/strings/iter.ha \
- $(STDLIB)/strings/utf8.ha
+# os
+testlib_os_srcs= \
+ $(STDLIB)/os/$(PLATFORM)/environ.ha \
+ $(STDLIB)/os/$(PLATFORM)/errors.ha \
+ $(STDLIB)/os/$(PLATFORM)/exit.ha \
+ $(STDLIB)/os/$(PLATFORM)/fdstream.ha \
+ $(STDLIB)/os/$(PLATFORM)/open.ha \
+ $(STDLIB)/os/$(PLATFORM)/stdfd.ha \
+ $(STDLIB)/os/environ.ha \
+ $(STDLIB)/os/stdfd.ha
-$(TESTCACHE)/strings/strings.ssa: $(testlib_strings_srcs) $(testlib_rt) $(testlib_testlib_encoding_utf8) $(testlib_testlib_types)
+$(TESTCACHE)/os/os.ssa: $(testlib_os_srcs) $(testlib_rt) $(testlib_strings) $(testlib_types)
@printf 'HAREC \t$@\n'
- @mkdir -p $(TESTCACHE)/strings
- @HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) -o $@ -Nstrings \
- -t$(TESTCACHE)/strings/strings.td $(testlib_strings_srcs)
-
-testlib_testlib_strings=$(TESTCACHE)/strings/strings.o
-hare_testlib_deps+=$(testlib_testlib_strings)
+ @mkdir -p $(TESTCACHE)/os
+ @HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) -o $@ -Nos \
+ -t$(TESTCACHE)/os/os.td $(testlib_os_srcs)
# strconv
testlib_strconv_srcs= \
@@ -356,45 +367,34 @@ testlib_strconv_srcs= \
$(STDLIB)/strconv/numeric.ha \
$(STDLIB)/strconv/stou+test.ha
-$(TESTCACHE)/strconv/strconv.ssa: $(testlib_strconv_srcs) $(testlib_rt) $(testlib_testlib_types) $(testlib_testlib_strings) $(testlib_testlib_ascii)
+$(TESTCACHE)/strconv/strconv.ssa: $(testlib_strconv_srcs) $(testlib_rt) $(testlib_types) $(testlib_strings) $(testlib_ascii)
@printf 'HAREC \t$@\n'
@mkdir -p $(TESTCACHE)/strconv
@HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) -o $@ -Nstrconv \
-t$(TESTCACHE)/strconv/strconv.td $(testlib_strconv_srcs)
-testlib_testlib_strconv=$(TESTCACHE)/strconv/strconv.o
-hare_testlib_deps+=$(testlib_testlib_strconv)
-
-# os
-testlib_os_srcs= \
- $(STDLIB)/os/$(PLATFORM)/environ.ha \
- $(STDLIB)/os/$(PLATFORM)/errors.ha \
- $(STDLIB)/os/$(PLATFORM)/exit.ha \
- $(STDLIB)/os/$(PLATFORM)/fdstream.ha \
- $(STDLIB)/os/$(PLATFORM)/open.ha \
- $(STDLIB)/os/$(PLATFORM)/stdfd.ha \
- $(STDLIB)/os/environ.ha \
- $(STDLIB)/os/stdfd.ha
+# strings
+testlib_strings_srcs= \
+ $(STDLIB)/strings/cstrings.ha \
+ $(STDLIB)/strings/dup.ha \
+ $(STDLIB)/strings/iter.ha \
+ $(STDLIB)/strings/utf8.ha
-$(TESTCACHE)/os/os.ssa: $(testlib_os_srcs) $(testlib_rt) $(testlib_testlib_strings) $(testlib_testlib_types)
+$(TESTCACHE)/strings/strings.ssa: $(testlib_strings_srcs) $(testlib_rt) $(testlib_encoding_utf8) $(testlib_types)
@printf 'HAREC \t$@\n'
- @mkdir -p $(TESTCACHE)/os
- @HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) -o $@ -Nos \
- -t$(TESTCACHE)/os/os.td $(testlib_os_srcs)
-
-testlib_testlib_os=$(TESTCACHE)/os/os.o
-hare_testlib_deps+=$(testlib_testlib_os)
+ @mkdir -p $(TESTCACHE)/strings
+ @HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) -o $@ -Nstrings \
+ -t$(TESTCACHE)/strings/strings.td $(testlib_strings_srcs)
-# fmt
-testlib_fmt_srcs= \
- $(STDLIB)/fmt/fmt.ha
+# types
+testlib_types_srcs= \
+ $(STDLIB)/types/limits.ha \
+ $(STDLIB)/types/classes.ha \
+ $(STDLIB)/types/arch$(ARCH).ha
-$(TESTCACHE)/fmt/fmt.ssa: $(testlib_fmt_srcs) $(testlib_rt) $(testlib_testlib_io) $(testlib_testlib_os) $(testlib_testlib_strconv) $(testlib_testlib_strings) $(testlib_testlib_types)
+$(TESTCACHE)/types/types.ssa: $(testlib_types_srcs) $(testlib_rt)
@printf 'HAREC \t$@\n'
- @mkdir -p $(TESTCACHE)/fmt
- @HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) -o $@ -Nfmt \
- -t$(TESTCACHE)/fmt/fmt.td $(testlib_fmt_srcs)
-
-testlib_testlib_fmt=$(TESTCACHE)/fmt/fmt.o
-hare_testlib_deps+=$(testlib_testlib_fmt)
+ @mkdir -p $(TESTCACHE)/types
+ @HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) -o $@ -Ntypes \
+ -t$(TESTCACHE)/types/types.td $(testlib_types_srcs)