commit bff1f3c8c5188aa248277811e00193227a70d5d2
parent 2c113197eaf7b1cd026176e907a8bebe7a13a0b5
Author: Drew DeVault <sir@cmpwn.com>
Date: Tue, 16 Feb 2021 17:29:34 -0500
stdlib: add format::elf
Diffstat:
2 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/gen-stdlib b/gen-stdlib
@@ -139,6 +139,13 @@ fmt() {
gen_ssa fmt io os strconv strings types
}
+format_elf() {
+ printf '# format::elf\n'
+ gen_srcs format::elf \
+ types.ha
+ gen_ssa format::elf
+}
+
gensrcs_hare_lex() {
gen_srcs hare::lex \
token.ha \
@@ -271,6 +278,7 @@ bytes
crypto_random
encoding_utf8
fmt
+format_elf
hare_lex
io
os
diff --git a/mk/stdlib.mk b/mk/stdlib.mk
@@ -78,6 +78,9 @@ hare_stdlib_deps+=$(stdlib_encoding_utf8)
stdlib_fmt=$(HARECACHE)/fmt/fmt.o
hare_stdlib_deps+=$(stdlib_fmt)
+stdlib_format_elf=$(HARECACHE)/format/elf/format.elf.o
+hare_stdlib_deps+=$(stdlib_format_elf)
+
stdlib_hare_lex=$(HARECACHE)/hare/lex/hare.lex.o
hare_stdlib_deps+=$(stdlib_hare_lex)
@@ -167,6 +170,16 @@ $(HARECACHE)/fmt/fmt.ssa: $(stdlib_fmt_srcs) $(stdlib_rt) $(stdlib_io) $(stdlib_
@HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) -o $@ -Nfmt \
-t$(HARECACHE)/fmt/fmt.td $(stdlib_fmt_srcs)
+# format::elf
+stdlib_format_elf_srcs= \
+ $(STDLIB)/format/elf/types.ha
+
+$(HARECACHE)/format/elf/format.elf.ssa: $(stdlib_format_elf_srcs) $(stdlib_rt)
+ @printf 'HAREC \t$@\n'
+ @mkdir -p $(HARECACHE)/format/elf
+ @HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) -o $@ -Nformat::elf \
+ -t$(HARECACHE)/format/elf/format.elf.td $(stdlib_format_elf_srcs)
+
# hare::lex
stdlib_hare_lex_srcs= \
$(STDLIB)/hare/lex/token.ha \
@@ -345,6 +358,9 @@ hare_testlib_deps+=$(testlib_encoding_utf8)
testlib_fmt=$(TESTCACHE)/fmt/fmt.o
hare_testlib_deps+=$(testlib_fmt)
+testlib_format_elf=$(TESTCACHE)/format/elf/format.elf.o
+hare_testlib_deps+=$(testlib_format_elf)
+
testlib_hare_lex=$(TESTCACHE)/hare/lex/hare.lex.o
hare_testlib_deps+=$(testlib_hare_lex)
@@ -434,6 +450,16 @@ $(TESTCACHE)/fmt/fmt.ssa: $(testlib_fmt_srcs) $(testlib_rt) $(testlib_io) $(test
@HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) -o $@ -Nfmt \
-t$(TESTCACHE)/fmt/fmt.td $(testlib_fmt_srcs)
+# format::elf
+testlib_format_elf_srcs= \
+ $(STDLIB)/format/elf/types.ha
+
+$(TESTCACHE)/format/elf/format.elf.ssa: $(testlib_format_elf_srcs) $(testlib_rt)
+ @printf 'HAREC \t$@\n'
+ @mkdir -p $(TESTCACHE)/format/elf
+ @HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) -o $@ -Nformat::elf \
+ -t$(TESTCACHE)/format/elf/format.elf.td $(testlib_format_elf_srcs)
+
# hare::lex
testlib_hare_lex_srcs= \
$(STDLIB)/hare/lex/token.ha \