-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
54 lines (47 loc) · 1.6 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
.POSIX:
DEPS = norayr/strutils
GITHUB = https://github.com/
ROOTDIR = $$PWD
all: ${DEPS}
@if [ ! -d build ]; then \
mkdir build; \
fi
@for i in $?; do \
cp -r ${ROOTDIR}/build \
${ROOTDIR}/deps/$${i#*/}/build; \
make -C ${ROOTDIR}/deps/$${i#*/}; \
cp -r ${ROOTDIR}/deps/$${i#*/}/build/* \
${ROOTDIR}/build/; \
done
@cd build; voc -s ${ROOTDIR}/../src/List.Mod ${ROOTDIR}/../src/StringList.Mod
${DEPS}:
@for i in $@; do \
if [ -d deps/$${i#*/} ]; then \
printf "Updating %s: " $${i#*/}; \
git -C deps/$${i#*/} pull --ff-only \
${GITHUB}$$i > /dev/null 2>&1 \
&& echo done \
|| (echo failed && exit 1); \
else \
printf "Fetching %s: " $${i#*/}; \
git clone ${GITHUB}$$i deps/$${i#*/} \
> /dev/null 2>&1 \
&& echo done \
|| (echo failed && exit 1); \
fi \
done
tests:
@if [ ! -d build ]; then \
echo Run make, first; \
exit 1; \
fi
@cd build && voc ${ROOTDIR}/../test/testList.Mod -m \
> /dev/null 2>&1 \
|| (echo Failed to compile, have you run make? \
&& exit 1)
@./build/testList \
> /dev/null 2>&1 \
&& echo ${ROOTDIR}/build/testList: passed \
|| echo ${ROOTDIR}/build/testList: failed
clean:
rm -rf build deps