Skip to content

Commit

Permalink
Make it easier to download pre-built PureCake
Browse files Browse the repository at this point in the history
  • Loading branch information
hrutvik committed Mar 6, 2023
1 parent 3eb7eb5 commit 189d215
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ This [Docker](https://www.docker.com/) image contains a pre-built version of the
### Quick start without Docker

```bash
git clone https://github.com/cakeml/pure && cd pure/examples
wget https://github.com/cakeml/pure/releases/latest/download/pure.S -P lib
git clone https://github.com/cakeml/pure
cd pure/examples && make download
```
This downloads the latest pre-built version of the PureCake compiler from GitHub.
You can now compile PureLang programs without building the compiler yourself, as described in [`examples/README.md`](examples/README.md).


Expand Down
11 changes: 8 additions & 3 deletions examples/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
all: factorials.exe
.PHONY: all check clean
.PHONY: all check clean download

# Apple Silicon can emulate the x86
ifeq ($(shell uname), Darwin)
Expand Down Expand Up @@ -28,8 +28,11 @@ lib/basis_ffi.o: lib/basis_ffi.c
cc $(CCOPT) -c -o $@ $^

lib/pure.S:
@if [ ! -f "../compiler/binary/$(@F)" ] ; then echo "Could not find \`pure.S\`. Try downloading it from the PureCake GitHub releases." ; false ; fi
cp ../compiler/binary/$(@F) $@
@if [ ! -f "../compiler/binary/$(@F)" ] ; then $(MAKE) download ; else cp ../compiler/binary/$(@F) $@ ; fi

download:
@echo "$(red)Could not find \`pure.S\`. Downloading the latest version from PureCake's GitHub releases.$(reset)"
wget -q https://github.com/cakeml/pure/releases/latest/download/pure.S -P lib

lib/cake.S:
wget -q https://github.com/cakeml/cakeml/releases/latest/download/cake-x64-64.tar.gz
Expand All @@ -39,3 +42,5 @@ lib/cake.S:
clean:
rm -rf out lib/basis_ffi.o lib/cake lib/pure lib/cake.S lib/pure.S

red = \033[0;31m
reset = \033[0m

0 comments on commit 189d215

Please sign in to comment.