Add support for Capyscheme
This commit is contained in:
parent
5fa00c1413
commit
a7e50b7007
|
|
@ -1,5 +1,6 @@
|
|||
ARG SCHEME=chibi
|
||||
FROM docker.io/schemers/${SCHEME}
|
||||
ARG IMAGE=chibi:latest
|
||||
FROM docker.io/schemers/${IMAGE}
|
||||
ARG SCHEME=chibi
|
||||
ENV COMPILE_R7RS=${SCHEME}
|
||||
RUN apt-get update && apt-get install -y make
|
||||
|
|
|
|||
11
Makefile
11
Makefile
|
|
@ -1,5 +1,6 @@
|
|||
PREFIX=/usr/local
|
||||
SCHEME=chibi
|
||||
IMAGE=${SCHEME}:latest
|
||||
RNRS=r7rs
|
||||
|
||||
all: build
|
||||
|
|
@ -20,16 +21,12 @@ test:
|
|||
@echo "(import (scheme base) (scheme write))" > .tmp/main.scm
|
||||
@echo "(display \"Hello\") (newline)" >> .tmp/main.scm
|
||||
@rm -rf .tmp/main
|
||||
@if [ "${RNRS}" = "r6rs" ]; then cd .tmp && COMPILE_R7RS=${SCHEME} sh ../compile-r7rs -o main -I libs -A other_libs main.sps; fi
|
||||
@if [ "${RNRS}" = "r7rs" ]; then cd .tmp && COMPILE_R7RS=${SCHEME} sh ../compile-r7rs -o main -I libs -A other_libs main.scm; fi
|
||||
@cd .tmp && ./main
|
||||
@rm -rf .tmp/main
|
||||
@if [ "${RNRS}" = "r6rs" ]; then cd .tmp && COMPILE_R7RS=${SCHEME} sh ../compile-r7rs -I libs -A other_libs main.sps; fi
|
||||
@if [ "${RNRS}" = "r7rs" ]; then cd .tmp && COMPILE_R7RS=${SCHEME} sh ../compile-r7rs -I libs -A other_libs main.scm; fi
|
||||
@if [ "${RNRS}" = "r6rs" ]; then cd .tmp && COMPILE_R7RS=${SCHEME} sh ../compile-r7rs -o main main.sps; fi
|
||||
@if [ "${RNRS}" = "r7rs" ]; then cd .tmp && COMPILE_R7RS=${SCHEME} sh ../compile-r7rs -o main main.scm; fi
|
||||
@cd .tmp && ./main
|
||||
|
||||
test-docker:
|
||||
docker build --build-arg SCHEME=${SCHEME} -f Dockerfile.test --tag=${SCHEME}-testing .
|
||||
docker build --build-arg IMAGE=${IMAGE} --build-arg SCHEME=${SCHEME} -f Dockerfile.test --tag=${SCHEME}-testing .
|
||||
docker run ${SCHEME}-testing sh -c "make SCHEME=${SCHEME} RNRS=${RNRS} test"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ prefix="#!/usr/bin/env -S"
|
|||
case $rnrs in
|
||||
R6RS)
|
||||
case $COMPILE_R7RS in
|
||||
capyscheme) printf "\n#|\nexec capy --r6rs $prepend_dirs $append_dirs --script \$0\n|#\n" >> "$output_file";;
|
||||
chezscheme) echo "$prefix scheme --libdirs $prepend_dirs:$append_dirs --program" >> "$output_file";;
|
||||
guile) printf "$prefix guile --r6rs $prepend_dirs $append_dirs\n!#\n" >> "$output_file";;
|
||||
ikarus) echo "$prefix IKARUS_LIBRARY_PATH=$prepend_dirs:$append_dirs ikarus --r6rs-script" >> "$output_file";;
|
||||
|
|
@ -71,6 +72,7 @@ case $rnrs in
|
|||
esac;;
|
||||
R7RS)
|
||||
case $COMPILE_R7RS in
|
||||
capyscheme) printf "\n#|\nexec capy --r7rs $prepend_dirs $append_dirs --script \$0\n|#\n" >> "$output_file";;
|
||||
chicken) csc -o "$output_file" "$input_file";;
|
||||
chibi) echo "$prefix chibi-scheme $prepend_dirs $append_dirs" >> "$output_file";;
|
||||
cyclone) cyclone -o "$output_file" $prepend_dirs $append_dirs "$input_file";;
|
||||
|
|
|
|||
Loading…
Reference in New Issue