Skip to content

Commit

Permalink
Add Makefile target for building machine (#172)
Browse files Browse the repository at this point in the history
* Remove `test-image` as dependency of target `all`
* Add `machine` target to Makefile
* Shift from `pnpm build` to `make build`
  • Loading branch information
guidanoli authored Oct 16, 2024
1 parent 7bc7894 commit a5e1046
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.cartesi
.cartesi.env
.imageid
node_modules
frontend/node_modules/**
frontend/.next/**
Expand Down
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
MACHINE_IMAGE=.cartesi/image.ext2
IIDFILE=.imageid

.PHONY: all
all: bounties test-image
all: bounties $(MACHINE_IMAGE)

.PHONY: bounties
bounties:
$(MAKE) -C tests/bounties

.PHONY: machine
machine: $(MACHINE_IMAGE)

$(MACHINE_IMAGE): $(IIDFILE)
pnpm exec cartesi build --from-image "$(shell cat $<)"

$(IIDFILE): Dockerfile .dockerignore go.mod go.sum $(shell find shared contract bwrapbox skel)
docker build --iidfile $@ --platform linux/riscv64 .

.PHONY: clean
clean:
$(MAKE) -C tests/bounties clean
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pnpm i
#### From source

```sh
pnpm build
make build
```

#### From a tagged image
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.0.0",
"private": true,
"scripts": {
"build": "cartesi build",
"start": "cartesi run --disable-bundler --disable-paymaster"
},
"devDependencies": {
Expand Down

0 comments on commit a5e1046

Please sign in to comment.