commit 8aec80e767d59e17639c267f15d610aac59b33da
parent fa383000b130d8303a01ec682ce79a415a725e0a
Author: Drew DeVault <sir@cmpwn.com>
Date: Mon, 22 Feb 2021 15:42:44 -0500
update stdlib
Diffstat:
2 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/gen-stdlib b/gen-stdlib
@@ -261,6 +261,13 @@ gensrcs_strconv() {
$*
}
+slice() {
+ printf '# slice\n'
+ gen_srcs slice \
+ reverse.ha
+ gen_ssa slice
+}
+
gensrcs_sort() {
gen_srcs sort \
search.ha \
@@ -331,6 +338,7 @@ hare_parse
io
os
os_exec
+slice
sort
strconv
strings
diff --git a/mk/stdlib.mk b/mk/stdlib.mk
@@ -99,6 +99,9 @@ hare_stdlib_deps+=$(stdlib_os)
stdlib_os_exec=$(HARECACHE)/os/exec/os.exec.o
hare_stdlib_deps+=$(stdlib_os_exec)
+stdlib_slice=$(HARECACHE)/slice/slice.o
+hare_stdlib_deps+=$(stdlib_slice)
+
stdlib_sort=$(HARECACHE)/sort/sort.o
hare_stdlib_deps+=$(stdlib_sort)
@@ -266,6 +269,16 @@ $(HARECACHE)/os/exec/os.exec.ssa: $(stdlib_os_exec_srcs) $(stdlib_rt) $(stdlib_o
@HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) -o $@ -Nos::exec \
-t$(HARECACHE)/os/exec/os.exec.td $(stdlib_os_exec_srcs)
+# slice
+stdlib_slice_srcs= \
+ $(STDLIB)/slice/reverse.ha
+
+$(HARECACHE)/slice/slice.ssa: $(stdlib_slice_srcs) $(stdlib_rt)
+ @printf 'HAREC \t$@\n'
+ @mkdir -p $(HARECACHE)/slice
+ @HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) -o $@ -Nslice \
+ -t$(HARECACHE)/slice/slice.td $(stdlib_slice_srcs)
+
# sort
stdlib_sort_srcs= \
$(STDLIB)/sort/search.ha
@@ -421,6 +434,9 @@ hare_testlib_deps+=$(testlib_os)
testlib_os_exec=$(TESTCACHE)/os/exec/os.exec.o
hare_testlib_deps+=$(testlib_os_exec)
+testlib_slice=$(TESTCACHE)/slice/slice.o
+hare_testlib_deps+=$(testlib_slice)
+
testlib_sort=$(TESTCACHE)/sort/sort.o
hare_testlib_deps+=$(testlib_sort)
@@ -594,6 +610,16 @@ $(TESTCACHE)/os/exec/os.exec.ssa: $(testlib_os_exec_srcs) $(testlib_rt) $(testli
@HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) -o $@ -Nos::exec \
-t$(TESTCACHE)/os/exec/os.exec.td $(testlib_os_exec_srcs)
+# slice
+testlib_slice_srcs= \
+ $(STDLIB)/slice/reverse.ha
+
+$(TESTCACHE)/slice/slice.ssa: $(testlib_slice_srcs) $(testlib_rt)
+ @printf 'HAREC \t$@\n'
+ @mkdir -p $(TESTCACHE)/slice
+ @HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) -o $@ -Nslice \
+ -t$(TESTCACHE)/slice/slice.td $(testlib_slice_srcs)
+
# sort
testlib_sort_srcs= \
$(STDLIB)/sort/search.ha \