-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
71 lines (52 loc) · 1.41 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
include config.mk
# Idris 2 executable we're building
NAME = idris2-lua
TARGETDIR = build/exec
TARGET = ${TARGETDIR}/${NAME}
IDRIS2 = idris2
IPKG = idris2-lua.ipkg
MAJOR=0
MINOR=5
PATCH=1
export IDRIS2_VERSION := ${MAJOR}.${MINOR}.${PATCH}
ifeq ($(OS), windows)
# This produces D:/../.. style paths
IDRIS2_PREFIX := $(shell cygpath -m ${PREFIX})
IDRIS2_CURDIR := $(shell cygpath -m ${CURDIR})
SEP := ;
else
IDRIS2_PREFIX := ${PREFIX}
IDRIS2_CURDIR := ${CURDIR}
SEP := :
endif
.PHONY: all idris2-lua-exec ${TARGET} clean-tests clean check-env test
all: ${TARGET} test
idris2-lua-exec: ${TARGET}
${TARGET}:
${IDRIS2} --build ${IPKG}
clean-tests:
$(RM) -r tests/build
clean: clean-tests
$(RM) -r build
$(RM) support/lua/*.so
$(RM) support/lua/*.o
install: install-idris2-lua install-support
install-idris2-lua:
mkdir -p ${PREFIX}/bin/
install ${TARGET} ${PREFIX}/bin
ifeq ($(OS), windows)
-install ${TARGET}.cmd ${PREFIX}/bin
endif
mkdir -p ${PREFIX}/bin/${NAME}_app
install ${TARGETDIR}/${NAME}_app/* ${PREFIX}/bin/${NAME}_app
install-support: check-env
mkdir -p ${PREFIX}/idris2-${IDRIS2_VERSION}/support/lua
cd support/lua; \
luarocks make --lua-version=$(LuaVersion) --local
install support/lua/idris2-lua.lua ${PREFIX}/idris2-${IDRIS2_VERSION}/support/lua
test: clean-tests install-support
make -C tests IDRIS2_LUA=../${TARGET}
check-env:
ifndef LuaVersion
$(error LuaVersion is undefined)
endif