Skip to content

Commit 50726f2

Browse files
committed
Implement basic make command for build and test
1 parent 16e809f commit 50726f2

File tree

4 files changed

+67
-0
lines changed

4 files changed

+67
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
rvgo/bin
2+
rvgo/scripts/go-ffi/go-ffi
3+
14
rvsol/cache
25
rvsol/out
6+
37
tests/go-tests/bin
48

59
# jetbrains

Makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
build-rvgo:
2+
make -C ./rvgo build
3+
.PHONY: build-rvgo
4+
5+
build-rvsol:
6+
make -C ./rvsol build
7+
.PHONY: build-rvsol
8+
9+
build-test:
10+
make -C ./tests/go-tests all
11+
make -C ./rvgo build-ffi
12+
.PHONY: build-test
13+
14+
build: build-test build-rvsol build-rvgo
15+
.PHONY: build
16+
17+
clean:
18+
make -C ./rvgo clean
19+
make -C ./rvsol clean
20+
.PHONY: clean
21+
22+
mkdir -p artifacts
23+
./rvgo/bin/asterisc load-elf --path ./op-program-client-riscv.elf --out ./artifacts/prestate.json --meta ./artifacts/meta.json
24+
./rvgo/bin/asterisc run --proof-at '=0' --stop-at '=1' --input ./artifacts/prestate.json --meta ./artifacts/meta.json --proof-fmt './artifacts/%d.json' --output ""
25+
mv ./artifacts/0.json ./artifacts/prestate-proof.json
26+
.PHONY: prestate

rvgo/Makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
GITCOMMIT ?= $(shell git rev-parse HEAD)
2+
GITDATE ?= $(shell git show -s --format='%ct')
3+
VERSION := v0.0.0
4+
5+
LDFLAGSSTRING +=-X main.GitCommit=$(GITCOMMIT)
6+
LDFLAGSSTRING +=-X main.GitDate=$(GITDATE)
7+
LDFLAGSSTRING +=-X github.com/ethereum-optimism/asterisc/rvgo/version.Version=$(VERSION)
8+
LDFLAGSSTRING +=-X github.com/ethereum-optimism/asterisc/rvgo/version.Meta=$(VERSION_META)
9+
LDFLAGS := -ldflags "$(LDFLAGSSTRING)"
10+
11+
build:
12+
env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) go build -v $(LDFLAGS) -o ./bin/asterisc .
13+
.PHONY: build
14+
15+
build-ffi:
16+
env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) go build -v $(LDFLAGS) -o ./scripts/go-ffi/go-ffi ./scripts/go-ffi
17+
.PHONY: build-ffi
18+
19+
clean:
20+
rm -rf ./bin
21+
rm ./scripts/go-ffi/go-ffi
22+
.PHONY: clean
23+
24+
test:
25+
go test ./...
26+
.PHONY: test

rvsol/Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
build:
2+
forge build
3+
.PHONY: build
4+
5+
clean:
6+
forge clean
7+
.PHONY: clean
8+
9+
test:
10+
forge test -vvv --ffi
11+
.PHONY: test

0 commit comments

Comments
 (0)