-
Notifications
You must be signed in to change notification settings - Fork 6
/
common.phylum.mk
54 lines (40 loc) · 1.23 KB
/
common.phylum.mk
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
53
54
# Copyright © 2021 Luther Systems, Ltd. All right reserved.
# common.phylum.mk
#
# A base makefile for working with phyla (collections of lisp code making up a
# smart contract).
PROJECT_REL_DIR:=..
include ${PROJECT_REL_DIR}/common.mk
SOURCE_FILES=$(shell find . -name "*.lisp" | grep -v '/build')
PHYLUM_NAME ?= ${PROJECT}.zip
PHYLUM_PATH=build/${PROJECT}-${BUILD_VERSION}/${PHYLUM_NAME}
SHIRO_TEST=${DOCKER_RUN} -it -v ${PHYLUMDIR}:/tmp -w /tmp ${SHIROTESTER_IMAGE}:${SHIROTESTER_VERSION}
# This is an unfortunate hack to get around DnD mounts which must
# be relative to the host machine.
PHYLUMDIR?=${CURDIR}
PHYLUM_PACKAGE=${PROJECT}
.PHONY: default
default: build
.PHONY: build
build: ${PHYLUM_PATH}
.PHONY: clean
clean:
rm -rf build
.PHONY: test
test: shiro-test
@
.PHONY: shiro-test
shiro-test: build
${SHIRO_TEST} unit-tests --verbose .
.PHONY: repl
repl:
${SHIRO_TEST} repl --in-package ${PHYLUM_PACKAGE} .
${PHYLUM_PATH}: ${SOURCE_FILES}
mkdir -p $(dir $@)
cp $^ $(dir $@)
sed -i='.orig' "s/LUTHER_PROJECT_VERSION/${VERSION}/" $(dir $@)/main.lisp
sed -i='.orig' "s/LUTHER_PROJECT_BUILD_ID/${BUILD_ID}/" $(dir $@)/main.lisp
cd $(dir $@) && ls && zip $(notdir $@) $^
.PHONY: phylum-path
phylum-path:
@echo ${PHYLUM_PATH}