hare

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

commit ef0f8c4467cdd1ca004d209b5ff72f251525e2cd
parent 0c576a63ad59566370001a31ef8a793b1832162d
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sun,  7 Feb 2021 14:59:36 -0500

stdlib: add os::exec

Diffstat:
Mgen-stdlib | 9+++++++++
Mmk/stdlib.mk | 28++++++++++++++++++++++++++++
2 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/gen-stdlib b/gen-stdlib @@ -182,6 +182,14 @@ os() { gen_ssa os strings types } +os_exec() { + printf '# os::exec\n' + gen_srcs os::exec \ + '$(PLATFORM).ha' \ + cmd.ha + gen_ssa os::exec os strings +} + strconv() { printf '# strconv\n' if [ $testing -eq 0 ] @@ -227,6 +235,7 @@ encoding_utf8 fmt io os +os_exec strconv strings types" diff --git a/mk/stdlib.mk b/mk/stdlib.mk @@ -77,6 +77,9 @@ hare_stdlib_deps+=$(stdlib_io) stdlib_os=$(HARECACHE)/os/os.o hare_stdlib_deps+=$(stdlib_os) +stdlib_os_exec=$(HARECACHE)/os/exec/os.exec.o +hare_stdlib_deps+=$(stdlib_os_exec) + stdlib_strconv=$(HARECACHE)/strconv/strconv.o hare_stdlib_deps+=$(stdlib_strconv) @@ -165,6 +168,17 @@ $(HARECACHE)/os/os.ssa: $(stdlib_os_srcs) $(stdlib_rt) $(stdlib_strings) $(stdli @HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) -o $@ -Nos \ -t$(HARECACHE)/os/os.td $(stdlib_os_srcs) +# os::exec +stdlib_os_exec_srcs= \ + $(STDLIB)/os/exec/$(PLATFORM).ha \ + $(STDLIB)/os/exec/cmd.ha + +$(HARECACHE)/os/exec/os.exec.ssa: $(stdlib_os_exec_srcs) $(stdlib_rt) $(stdlib_os) $(stdlib_strings) + @printf 'HAREC \t$@\n' + @mkdir -p $(HARECACHE)/os/exec + @HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) -o $@ -Nos::exec \ + -t$(HARECACHE)/os/exec/os.exec.td $(stdlib_os_exec_srcs) + # strconv stdlib_strconv_srcs= \ $(STDLIB)/strconv/types.ha \ @@ -287,6 +301,9 @@ hare_testlib_deps+=$(testlib_io) testlib_os=$(TESTCACHE)/os/os.o hare_testlib_deps+=$(testlib_os) +testlib_os_exec=$(TESTCACHE)/os/exec/os.exec.o +hare_testlib_deps+=$(testlib_os_exec) + testlib_strconv=$(TESTCACHE)/strconv/strconv.o hare_testlib_deps+=$(testlib_strconv) @@ -378,6 +395,17 @@ $(TESTCACHE)/os/os.ssa: $(testlib_os_srcs) $(testlib_rt) $(testlib_strings) $(te @HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) -o $@ -Nos \ -t$(TESTCACHE)/os/os.td $(testlib_os_srcs) +# os::exec +testlib_os_exec_srcs= \ + $(STDLIB)/os/exec/$(PLATFORM).ha \ + $(STDLIB)/os/exec/cmd.ha + +$(TESTCACHE)/os/exec/os.exec.ssa: $(testlib_os_exec_srcs) $(testlib_rt) $(testlib_os) $(testlib_strings) + @printf 'HAREC \t$@\n' + @mkdir -p $(TESTCACHE)/os/exec + @HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) -o $@ -Nos::exec \ + -t$(TESTCACHE)/os/exec/os.exec.td $(testlib_os_exec_srcs) + # strconv testlib_strconv_srcs= \ $(STDLIB)/strconv/types.ha \