This repository has been archived by the owner on Oct 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
184 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
LAKE ?= ./build/bin/lake | ||
|
||
#------------------------------------------------------------------------------- | ||
# Suite Targets | ||
#------------------------------------------------------------------------------- | ||
|
||
default: build | ||
|
||
all: build test-all | ||
|
||
test: check-lake test-ci test-bootstrap test-bootstrapped | ||
|
||
test-ci: test-tests test-examples | ||
|
||
test-tests: test-49 test-50 test-62 | ||
|
||
test-examples: test-init test-hello test-io test-deps\ | ||
test-git test-ffi test-targets test-scripts | ||
|
||
test-bootstrapped: test-boostrapped-hello | ||
|
||
clean: clean-build clean-tests clean-examples | ||
|
||
clean-tests: clean-62 | ||
|
||
clean-examples: clean-init clean-hello clean-io clean-deps\ | ||
clean-git clean-ffi clean-targets clean-bootstrap | ||
|
||
.PHONY: all test test-all test-tests test-examples\ | ||
clean clean-build clean-tests clean-examples build time-build check-lake\ | ||
test-bootstrap time-bootstrap check-bootstrap test-bootstrapped | ||
|
||
#------------------------------------------------------------------------------- | ||
# Build Targets | ||
#------------------------------------------------------------------------------- | ||
|
||
build: | ||
./build.sh | ||
|
||
time-build: | ||
./time.sh | ||
|
||
clean-build: | ||
./clean.sh | ||
|
||
check-lake: | ||
$(LAKE) self-check | ||
|
||
#------------------------------------------------------------------------------- | ||
# Example Targets | ||
#------------------------------------------------------------------------------- | ||
|
||
test-init: | ||
cd examples/init && ./test.sh | ||
|
||
clean-init: | ||
cd examples/init && ./clean.sh | ||
|
||
test-hello: | ||
cd examples/hello && ./test.sh | ||
|
||
clean-hello: | ||
cd examples/hello && ./clean.sh | ||
|
||
test-io: | ||
cd examples/io && ./test.sh | ||
|
||
clean-io: | ||
cd examples/io && ./clean.sh | ||
|
||
test-deps: | ||
cd examples/deps && ./test.sh | ||
|
||
clean-deps: | ||
cd examples/deps && ./clean.sh | ||
|
||
test-git: | ||
cd examples/git && ./test.sh | ||
|
||
clean-git: | ||
cd examples/git && ./clean.sh | ||
|
||
test-ffi: | ||
cd examples/ffi && ./test.sh | ||
|
||
clean-ffi: | ||
cd examples/ffi && ./clean.sh | ||
|
||
test-targets: | ||
cd examples/targets && ./test.sh | ||
|
||
clean-targets: | ||
cd examples/targets && ./clean.sh | ||
|
||
test-scripts: | ||
cd examples/scripts && ./test.sh | ||
|
||
test-bootstrap: | ||
cd examples/bootstrap && ./test.sh | ||
|
||
package-bootstrap: | ||
cd examples/bootstrap && ./package.sh | ||
|
||
clean-bootstrap: | ||
cd examples/bootstrap && ./clean.sh | ||
|
||
time-bootstrap: | ||
cd examples/bootstrap && ./time.sh | ||
|
||
check-bootstrap: | ||
cd examples/bootstrap && ./check.sh | ||
|
||
test-boostrapped-hello: | ||
cd examples/hello && ./bootstrapped-test.sh | ||
|
||
#------------------------------------------------------------------------------- | ||
# Test Targets | ||
#------------------------------------------------------------------------------- | ||
|
||
test-49: | ||
cd test/49 && ./test.sh | ||
|
||
test-50: | ||
cd test/50 && ./test.sh | ||
|
||
test-62: | ||
cd test/62 && ./test.sh | ||
|
||
clean-62: | ||
cd test/62 && ./clean.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
#!/usr/bin/env sh | ||
|
||
if [ "$OS" = "Windows_NT" ]; then | ||
LINK_OPTS= | ||
else | ||
LINK_OPTS=-rdynamic | ||
fi | ||
leanmake PKG=Lake OLEAN_OUT=build/lib TEMP_OUT=build/ir BIN_NAME=lake LEAN_PATH=./build/lib bin LINK_OPTS=${LINK_OPTS} "$@" | ||
|
||
LEAN_SYSROOT=${LEAN_SYSROOT:-`lean --print-prefix`} | ||
LEAN_MAKEFILE="$LEAN_SYSROOT/share/lean/lean.mk" | ||
EXTRA_ARGS="PKG=Lake OLEAN_OUT=build/lib TEMP_OUT=build/ir BIN_NAME=lake LEAN_PATH=./build/lib LINK_OPTS=$LINK_OPTS" | ||
PATH="$LEAN_SYSROOT/bin:$PATH" ${MAKE:-make} -f "$LEAN_MAKEFILE" $EXTRA_ARGS bin "$@" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
set -euo pipefail | ||
|
||
INIT_REQ=$'Content-Length: 46\r\n\r\n{"jsonrpc":"2.0","method":"initialize","id":1}' | ||
INITD_NOT=$'Content-Length: 40\r\n\r\n{"jsonrpc":"2.0","method":"initialized"}' | ||
SD_REQ=$'Content-Length: 44\r\n\r\n{"jsonrpc":"2.0","method":"shutdown","id":2}' | ||
EXIT_NOT=$'Content-Length: 33\r\n\r\n{"jsonrpc":"2.0","method":"exit"}' | ||
MSGS="$INIT_REQ$INITD_NOT$SD_REQ$EXIT_NOT" | ||
|
||
echo "does not compile" > lakefile.lean | ||
echo -n "$MSGS" | ${LAKE:-../../build/bin/lake} serve >/dev/null | ||
rm lakefile.lean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def main : IO Unit := | ||
IO.println s!"Hello, world!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import Lake | ||
open Lake DSL | ||
|
||
package foo where | ||
moreLeanArgs := #[(__args__).get! 0] | ||
moreLeancArgs := #[(__args__).get! 1] | ||
|
||
@[defaultTarget] | ||
lean_exe foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
leanprover/lean4:nightly-2022-06-14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
set -exo pipefail | ||
LAKE=${LAKE:-../../../build/bin/lake} | ||
cd foo | ||
rm -rf build | ||
${LAKE} build -- -Dhygiene=true -DBAR | grep -m2 foo.c | ||
${LAKE} build -- -Dhygiene=false -DBAZ | grep -m2 foo.c | ||
${LAKE} build -- -Dhygiene=false -DBAR | grep -m1 foo.o | ||
${LAKE} build -- -Dhygiene=true -DBAR | grep -m1 foo.olean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rm -rf foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
set -euxo pipefail | ||
./clean.sh | ||
lake +leanprover/lean4:4.0.0-m3 new foo | ||
cd foo | ||
lake +leanprover/lean4:4.0.0-m3 build | grep -m1 foo | ||
cp ../../../lean-toolchain lean-toolchain | ||
${LAKE:-../../../build/bin/lake} build | grep -m1 foo |