diff options
author | Suleyman Farajli <suleyman@farajli.net> | 2025-01-07 02:24:19 +0400 |
---|---|---|
committer | Suleyman Farajli <suleyman@farajli.net> | 2025-01-07 02:24:19 +0400 |
commit | 180b6ab7c204ddf3a8aa2b9b022085e6a96ff99a (patch) | |
tree | afb0144af0ba75d516e100d1fc6fa0c309620c0e | |
parent | c9090da5bd98c418f71f9110c6c3d82f2f7d37ee (diff) |
program name changed to 'ash'
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | Makefile | 13 | ||||
-rw-r--r-- | examples/const.ash (renamed from examples/const.gorth) | 0 | ||||
-rw-r--r-- | examples/fib.ash (renamed from examples/fib.gorth) | 0 | ||||
-rw-r--r-- | examples/hello_world.ash (renamed from examples/hello_world.gorth) | 2 | ||||
-rw-r--r-- | examples/seq10.ash (renamed from examples/seq10.gorth) | 0 | ||||
-rw-r--r-- | examples/words.ash (renamed from examples/words.gorth) | 0 | ||||
-rw-r--r-- | go.mod | 2 | ||||
-rw-r--r-- | lib/std.ash (renamed from lib/stdlib.gorth) | 0 | ||||
-rw-r--r-- | src/main.go | 10 |
10 files changed, 14 insertions, 18 deletions
@@ -1,5 +1,2 @@ -test-asm -test.gorth -test -gorth +ash GNUmakefile @@ -1,17 +1,16 @@ PREFIX ?= /usr/local +ash: src/main.go + go build -o ash ./src -gorth: src/main.go - go build -o gorth ./src - -install: gorth +install: ash mkdir -p ${DESTDIR}${PREFIX}/bin - cp -f gorth ${DESTDIR}${PREFIX}/bin + cp -f ash ${DESTDIR}${PREFIX}/bin uninstall: - rm -f ${DESTDIR}${PREFIX}/bin/gorth + rm -f ${DESTDIR}${PREFIX}/bin/ash clean: - rm -f gorth + rm -f ash .PHONY: test clean diff --git a/examples/const.gorth b/examples/const.ash index 421f7f5..421f7f5 100644 --- a/examples/const.gorth +++ b/examples/const.ash diff --git a/examples/fib.gorth b/examples/fib.ash index bf2b90d..bf2b90d 100644 --- a/examples/fib.gorth +++ b/examples/fib.ash diff --git a/examples/hello_world.gorth b/examples/hello_world.ash index 1df3bf4..a1c1d48 100644 --- a/examples/hello_world.gorth +++ b/examples/hello_world.ash @@ -1,5 +1,5 @@ # Prints out "Hello, World!" -include "../lib/stdlib.gorth" +include "../lib/std.ash" "Hello, World!" write diff --git a/examples/seq10.gorth b/examples/seq10.ash index e73743e..e73743e 100644 --- a/examples/seq10.gorth +++ b/examples/seq10.ash diff --git a/examples/words.gorth b/examples/words.ash index c0e1461..c0e1461 100644 --- a/examples/words.gorth +++ b/examples/words.ash @@ -1,3 +1,3 @@ -module gorth +module ash go 1.23.3 diff --git a/lib/stdlib.gorth b/lib/std.ash index d44cccb..d44cccb 100644 --- a/lib/stdlib.gorth +++ b/lib/std.ash diff --git a/src/main.go b/src/main.go index cfcb27c..143b165 100644 --- a/src/main.go +++ b/src/main.go @@ -592,7 +592,7 @@ func main() { argv := os.Args; argc := len(argv); progname = argv[0] - suffix := ".gorth" + suffix := ".ash" if argc != 2 { fmt.Fprintf(os.Stderr, "%s: error: expected one input file.\n", progname) @@ -600,14 +600,14 @@ func main() { } srcFile := argv[argc - 1] - if !strings.HasSuffix(srcFile, suffix) || len(srcFile) < 7 { + if !strings.HasSuffix(srcFile, suffix) || len(srcFile) < 5 { fmt.Fprintf(os.Stderr, "%s: error: invalid file format '%s'.\n", progname, srcFile) os.Exit(1) } - assemFile := srcFile[:len(srcFile) - 6] + ".s" - objFile := srcFile[:len(srcFile) - 6] + ".o" - binFile := srcFile[:len(srcFile) - 6] + binFile := srcFile[:len(srcFile) - 4] + assemFile := binFile + ".s" + objFile := binFile + ".o" _, err := os.Stat(srcFile) if err != nil { fmt.Fprintf(os.Stderr, "%s: error: %s.\n", progname, err) |