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

feat: Added Makefile for simpler build process #38

Merged
merged 5 commits into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

QUIET := @

all: setup build yarn

setup:
$(QUIET)$(cd jsvm && ./setup.sh && cd ..)

build: jsvm qjsc

jsvm:
echo "Building jsvm.wasm..."
$(QUIET)$(cd jsvm && ./build.sh && cd ..)
cp jsvm/jsvm.wasm res/jsvm.wasm

qjsc:
echo "Building qjsc bytecode compiler"
$(QUIET)$(cd quickjs && ./build.sh && cd ..)
cp quickjs/qjsc res/qjsc

yarn:
$(QUIET)yarn

clean: clean-vendor clean-node

clean-vendor:
$(QUIET)rm -rf jsvm/vendor

clean-node:
$(QUIET)rm -rf node_modules


.PHONY: all setup build yarn
.PHONY: jsvm qjsc
.PHONY: clean clean-vendor clean-node
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This README is a work in porgress. The best way to start using `near-sdk-js` is
It is tested on Ubuntu 20.04 and Intel Mac. Other linux and M1 Macs should also work but they're not tested.

1. Make sure you have `wget`, `make`, `cmake` and `nodejs`. On Linux, also make sure you have `gcc`.
2. Run `./rebuild_recources.sh` to get platform specific `qjsc` and `jsvm` contract in `res` folder.
2. Run `make` to get platform specific `qjsc` and `jsvm` contract in `res` folder.

## Usage
1. `cd examples/<example>`
Expand Down Expand Up @@ -35,7 +35,7 @@ near call <jsvm-account> remove_js_contract --accountId <your-account>

1. Build the jsvm contract
```
./rebuild_recources.sh
make
```

2. Go to nearcore, Build and start a local node
Expand Down
10 changes: 0 additions & 10 deletions rebuild_resources.sh

This file was deleted.

Binary file modified res/jsvm.wasm
Binary file not shown.
Loading