-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (43 loc) · 1.34 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
SHELL = /bin/bash
SBT = sbt
PREFIX = $(HOME)/.local
SCALA_VERSION = 2.13
HYPERMAKE_VERSION = 0.1.0
JAR = target/scala-$(SCALA_VERSION)/hypermake-assembly-${HYPERMAKE_VERSION}.jar
NATIVE_IMAGE = target/graalvm-native-image/hypermake
STDLIB_AS_RESOURCE = false
$(JAR):
$(SBT) -Dhypermake.stdlibasresource=$(STDLIB_AS_RESOURCE) assembly
$(NATIVE_IMAGE):
$(SBT) GraalVMNativeImage/packageBin
jar: $(JAR)
native-image: $(NATIVE_IMAGE)
clean:
$(SBT) clean
install: $(JAR)
@echo "Installing hypermake to $(PREFIX)"
@mkdir -p $(PREFIX)/lib/hypermake
cp $(JAR) $(PREFIX)/lib/hypermake/hypermake.jar
@mkdir -p $(PREFIX)/share/hypermake
cp -r src/main/hypermake/* $(PREFIX)/share/hypermake
@mkdir -p $(PREFIX)/bin
cp bin/hypermake $(PREFIX)/bin/hypermake
chmod +x $(PREFIX)/bin/hypermake
docs:
mdbook build
# Credit to https://github.com/kg4zow/mdbook-template/blob/main/Makefile
gh-deploy-docs: docs
set -ex ; \
WORK="$$( mktemp -d )" ; \
VER="$$( git describe --always --tags --dirty )" ; \
git worktree add --force "$$WORK" gh-pages ; \
rm -rf "$$WORK"/* ; \
rsync -av book/ "$$WORK"/ ; \
if [ -f CNAME ] ; then cp CNAME "$$WORK"/ ; fi ; \
pushd "$$WORK" ; \
git add -A ; \
git commit -m "Updated gh-pages $$VER" ; \
popd ; \
git worktree remove "$$WORK" ; \
git push origin gh-pages
.PHONY: jar native-image clean install docs gh-deploy-docs