Skip to content

Commit

Permalink
qjsc-build (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
tequdev authored Jan 22, 2025
1 parent 29834ed commit 0b02e30
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ docker/c2wasm-api
docker/wasi-sdk
docker/clangd
docker/hook-cleaner
wasi-sdk.ts
docker/qjsc
wasi-sdk.ts
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ checkout:
git submodule update --init --recursive llvm-project
git submodule update --init --recursive wasi-sdk
git submodule update --init --recursive hook-cleaner-c
git submodule update --init --recursive quickjslite
git submodule update --init --recursive c2wasm-api/clang/includes

bin:
Expand All @@ -22,6 +23,7 @@ build: bin
$(MAKE) -C clang-build
$(MAKE) -C clangd-build
$(MAKE) -C cleaner-build
$(MAKE) -C qjsc-build
$(MAKE) -C docker

doc-build: doc
Expand All @@ -37,5 +39,6 @@ clean:
$(MAKE) -C clang-build clean
$(MAKE) -C clangd-build clean
$(MAKE) -C cleaner-build clean
$(MAKE) -C qjsc-build clean
$(MAKE) -C docker clean
-rm -rf bin doc
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ directory, providing the results of running `make` in clang-build,
clangd-build and cleaner-build directories, so that running the
top-level make `build` target can be replaced by running just the
(default) make `build` target in the docker directory. This also
allows skipping the checkout of the `llvm-project`, `wasi-sdk` and
`hook-cleaner-c` submodules.
allows skipping the checkout of the `llvm-project`, `wasi-sdk`,
`hook-cleaner-c` and `quickjslite` submodules.

## API Wrapper or c2wasm-api

Expand Down
2 changes: 1 addition & 1 deletion docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ MAIN_CONTAINER_TAG?=xrpl-hooks-compiler
build: dependencies
docker build -t $(MAIN_CONTAINER_TAG) .

dependencies: wasi-sdk c2wasm-api clangd hook-cleaner
dependencies: wasi-sdk c2wasm-api clangd hook-cleaner qjsc

run:
docker run -p 127.0.0.1:9000:9000/tcp $(MAIN_CONTAINER_TAG):latest
Expand Down
1 change: 1 addition & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
version: '3.6'
name: c2wasm-api
services:
server:
container_name: c2wasm-api
Expand Down
5 changes: 5 additions & 0 deletions qjsc-build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM --platform=linux/amd64 node:17-alpine
MAINTAINER Vaclav Barta "[email protected]"
RUN apk --no-cache add --update bash build-base
ADD build.sh .
CMD ./build.sh
17 changes: 17 additions & 0 deletions qjsc-build/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# must be run as root

QJSC_BUILD_CONTAINER_TAG?=qjsc-build

all: build1 build2 install

build1:
docker build -t $(QJSC_BUILD_CONTAINER_TAG) .

build2:
docker run -v $(realpath ../quickjslite):/mnt/qjsc $(QJSC_BUILD_CONTAINER_TAG):latest

install:
cp ../quickjslite/qjsc ../bin

clean:
-rm -r ../quickjslite/qjsc ../quickjslite/.obj
7 changes: 7 additions & 0 deletions qjsc-build/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

echo running build.sh...
set -e

cd /mnt/qjsc
make qjsc

0 comments on commit 0b02e30

Please sign in to comment.