-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (31 loc) · 1.01 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
# fimbul make file for installation
#
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
WORK_DIR := $(shell dirname ${MKFILE_PATH})
LUA = $(shell which "lua5.3" 2>/dev/null)
ifeq "${LUA}" ""
LUA = $(shell which "lua53")
endif
TESTFOLDER := tests
TESTS := $(wildcard ${TESTFOLDER}/*.lua)
TESTTARGET := $(subst .lua,.test,${TESTS})
PREFIX := /usr
%.test: %.lua
busted --lua=${LUA} $<
all: install
install:
@echo "This script is mainly for developers. Please use the proper way"
@echo "of your distribution to install fimbul. Developers please go"
@echo "ahead with: sudo make install-dev."
install-dev:
ln -sf ${WORK_DIR}/bin/fimbul ${PREFIX}/bin/fimbul
ln -sf ${WORK_DIR}/fimbul ${PREFIX}/share/lua/5.3/fimbul
ln -sf ${WORK_DIR}/bin ${PREFIX}/lib/fimbul
uninstall-dev:
rm ${PREFIX}/bin/fimbul || true
rm ${PREFIX}/share/lua/5.3/fimbul || true
rm ${PREFIX}/lib/fimbul || true
test: ${TESTTARGET}
help:
@echo "make [install, install-dev, uninstall-dev, test]"
.PHONY: install install-dev uninstall-dev test