Skip to content

Commit 0b02e30

Browse files
authored
qjsc-build (#35)
1 parent 29834ed commit 0b02e30

File tree

8 files changed

+38
-4
lines changed

8 files changed

+38
-4
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ docker/c2wasm-api
55
docker/wasi-sdk
66
docker/clangd
77
docker/hook-cleaner
8-
wasi-sdk.ts
8+
docker/qjsc
9+
wasi-sdk.ts

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ checkout:
88
git submodule update --init --recursive llvm-project
99
git submodule update --init --recursive wasi-sdk
1010
git submodule update --init --recursive hook-cleaner-c
11+
git submodule update --init --recursive quickjslite
1112
git submodule update --init --recursive c2wasm-api/clang/includes
1213

1314
bin:
@@ -22,6 +23,7 @@ build: bin
2223
$(MAKE) -C clang-build
2324
$(MAKE) -C clangd-build
2425
$(MAKE) -C cleaner-build
26+
$(MAKE) -C qjsc-build
2527
$(MAKE) -C docker
2628

2729
doc-build: doc
@@ -37,5 +39,6 @@ clean:
3739
$(MAKE) -C clang-build clean
3840
$(MAKE) -C clangd-build clean
3941
$(MAKE) -C cleaner-build clean
42+
$(MAKE) -C qjsc-build clean
4043
$(MAKE) -C docker clean
4144
-rm -rf bin doc

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ directory, providing the results of running `make` in clang-build,
3838
clangd-build and cleaner-build directories, so that running the
3939
top-level make `build` target can be replaced by running just the
4040
(default) make `build` target in the docker directory. This also
41-
allows skipping the checkout of the `llvm-project`, `wasi-sdk` and
42-
`hook-cleaner-c` submodules.
41+
allows skipping the checkout of the `llvm-project`, `wasi-sdk`,
42+
`hook-cleaner-c` and `quickjslite` submodules.
4343

4444
## API Wrapper or c2wasm-api
4545

docker/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ MAIN_CONTAINER_TAG?=xrpl-hooks-compiler
55
build: dependencies
66
docker build -t $(MAIN_CONTAINER_TAG) .
77

8-
dependencies: wasi-sdk c2wasm-api clangd hook-cleaner
8+
dependencies: wasi-sdk c2wasm-api clangd hook-cleaner qjsc
99

1010
run:
1111
docker run -p 127.0.0.1:9000:9000/tcp $(MAIN_CONTAINER_TAG):latest

docker/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
version: '3.6'
2+
name: c2wasm-api
23
services:
34
server:
45
container_name: c2wasm-api

qjsc-build/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM --platform=linux/amd64 node:17-alpine
2+
MAINTAINER Vaclav Barta "vaclav@equilibrium.co"
3+
RUN apk --no-cache add --update bash build-base
4+
ADD build.sh .
5+
CMD ./build.sh

qjsc-build/Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# must be run as root
2+
3+
QJSC_BUILD_CONTAINER_TAG?=qjsc-build
4+
5+
all: build1 build2 install
6+
7+
build1:
8+
docker build -t $(QJSC_BUILD_CONTAINER_TAG) .
9+
10+
build2:
11+
docker run -v $(realpath ../quickjslite):/mnt/qjsc $(QJSC_BUILD_CONTAINER_TAG):latest
12+
13+
install:
14+
cp ../quickjslite/qjsc ../bin
15+
16+
clean:
17+
-rm -r ../quickjslite/qjsc ../quickjslite/.obj

qjsc-build/build.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
3+
echo running build.sh...
4+
set -e
5+
6+
cd /mnt/qjsc
7+
make qjsc

0 commit comments

Comments
 (0)