Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile #8

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: build
on: [push, pull_request]

jobs:
gno:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: '^1.15'
- name: build
run: make
- uses: actions/upload-artifact@v2
with:
name: gno
path: github.com/gnolang
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
all: xgo gnoland goscan logos

targets = windows/amd64,windows/arm64,darwin-10.14/arm64,darwin-10.14/amd64,linux/*

# gnoland is the main executable of gnolang
# bring this back when ready
gnoland:
echo "Building gnoland"
xgo -v -x --targets=$(targets) ./cmd/gnoland

# goscan scans go code to determine its AST
goscan:
echo "Building goscan"
xgo -v -x --targets=$(targets) ./cmd/goscan


# Logos is the interface to Gnoland
logos:
echo "building logos"
xgo -v -x --targets=4(targets) ./logos/cmd


test:
echo "Running tests"
go test tests/*.go -v -run="Test/realm.go"

xgo:
echo "installing xgo"
go get src.techknowlogick.com/xgo

# NB: Binaries will output in the folder github.com/gnoland

# TODO stringer -type=Op
# Unsure what the above refers to. Created a basic Makefile.

9 changes: 8 additions & 1 deletion cmd/goscan/goscan.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ import (
"github.com/davecgh/go-spew/spew"
)

/*
Goscan:


*/

func main() {
fset := token.NewFileSet() // positions are relative to fset

filename := os.Args[1]
filename := os.Args[1] // Take a filename as an argument.
bz, err := ioutil.ReadFile(filename)
if err != nil {
panic(err)
Expand All @@ -27,6 +33,7 @@ func main() {
}

// Print the imports from the file's AST.
// AST: https://en.wikipedia.org/wiki/Abstract_syntax_tree
spew.Dump(f)

}
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require (
github.com/jaekwon/testify v1.6.1
github.com/mattn/go-runewidth v0.0.10
github.com/stretchr/testify v1.6.1
src.techknowlogick.com/xgo v1.2.1-0.20210207204503-1ea8454a58df // indirect
)

replace github.com/gdamore/tcell => github.com/gnolang/tcell v1.4.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
src.techknowlogick.com/xgo v1.2.1-0.20210207204503-1ea8454a58df h1:emObvP33uBegaUw3n4wBs5Jj/pahioIqMZnTdET9lFA=
src.techknowlogick.com/xgo v1.2.1-0.20210207204503-1ea8454a58df/go.mod h1:31CE1YKtDOrKTk9PSnjTpe6YbO6W/0LTYZ1VskL09oU=