forked from Materials-Consortia/API
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakelocal-tools
71 lines (53 loc) · 2.23 KB
/
Makelocal-tools
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
71
#---*- Makefile -*-------------------------------------------------------
# Download and build tools and external depedencies necessary for this
# directory.
.PHONY: tools
tools: grammatica grammatiker
# Local installation of Grammatica:
GRAMMATICA_VERSION ?= 1.6
GRAMMATICA_SRV = https://github.com/cederberg/grammatica/releases
GRAMMATICA_LOC = ${GRAMMATICA_SRV}/download/v${GRAMMATICA_VERSION}
GRAMMATICA_URL = ${GRAMMATICA_LOC}/grammatica-${GRAMMATICA_VERSION}.zip
GRAMMATICA_LOG = tools/grammatica-${GRAMMATICA_VERSION}.log
GRAMMATICA_TOP = $(shell cd $(dir ${GRAMMATICA_LOG}); pwd)
GRAMMATICA_DIR = ${GRAMMATICA_TOP}/grammatica-${GRAMMATICA_VERSION}
GRAMMATICA_ZIP = ${GRAMMATICA_TOP}/grammatica-${GRAMMATICA_VERSION}.zip
.PHONY: grammatica distclean-grammatica
grammatica: ${GRAMMATICA_LOG}
${GRAMMATICA_LOG}:
test -f ${GRAMMATICA_ZIP} || wget -O ${GRAMMATICA_ZIP} ${GRAMMATICA_URL}
cd $(dir $@) && rm -rf $(notdir $(basename $@))
cd $(dir $@) && unzip ${GRAMMATICA_ZIP}
cd $(dir $@); ( set -uex; cd $(notdir $(basename $@)); ant -k ) 2>&1 \
| tee $(notdir $@)
# The ${GRAMMATICA_ZIP} file will *not* be deleted by 'make
# distclean-grammatica', to prevent unnecessary downloads from the
# ${GRAMMATICA_SRV} server. Remove it manually using
#
# 'rm tools/grammatica-1.6.zip'
#
# or analogous command if you want to refetch the archive:
distclean-grammatica:
rm -rf ${GRAMMATICA_DIR}
rm -f ${GRAMMATICA_LOG}
DISTCLEAN_TARGETS += distclean-grammatica
# Local installation of 'grammatiker':
GRAMMATIKER_REV ?= 129
GRAMMATIKER_URL = svn://saulius-grazulis.lt/grammatiker/trunk
GRAMMATIKER_LOG = tools/grammatiker-r${GRAMMATIKER_REV}.log
GRAMMATIKER_DIR = tools/grammatiker
.PHONY: grammatiker distclean-grammatiker
grammatiker: ${GRAMMATIKER_LOG}
${GRAMMATIKER_LOG}: ${GRAMMATICA_LOG}
svn co -r ${GRAMMATIKER_REV} ${GRAMMATIKER_URL} ${GRAMMATIKER_DIR} \
2>&1 | tee $@
rm -rf ${GRAMMATIKER_DIR}/EBNF/lib
ln -s ${GRAMMATICA_DIR} ${GRAMMATIKER_DIR}/EBNF/lib
rm -rf ${GRAMMATIKER_DIR}/BNF/lib
ln -s ${GRAMMATICA_DIR} ${GRAMMATIKER_DIR}/BNF/lib
test -d ${GRAMMATIKER_DIR} && ${MAKE} -C ${GRAMMATIKER_DIR} all tests \
2>&1 | tee -a $@
distclean-grammatiker:
rm -rf ${GRAMMATIKER_DIR}
rm -f ${GRAMMATIKER_LOG}
DISTCLEAN_TARGETS += distclean-grammatiker