-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (47 loc) · 1.63 KB
/
Makefile
File metadata and controls
59 lines (47 loc) · 1.63 KB
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
# This should give the most recent version
VERSION?=$(shell git tag | grep version- | grep -Eo '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$$' | tail -n 1)
RELEASETAG?=version-${VERSION}
ZIP=release/vikaasa-${VERSION}.zip
TAR=release/vikaasa-${VERSION}.tar
BZ2=${TAR}.bz2
PREFIX=vikaasa-${VERSION}/
# This is just the current ISS checkout, so this won't work for making old archives
ISS_VERSION=$(shell git submodule status Libs/InfSOCSol | grep -Eo "[a-f0-9]{40}")
# Make achives for the given version, and then clean up.
all: archives clean
# Make zip and bz2 files of the given version
archives: ${ZIP} ${BZ2} versioncheck
${ZIP}: ${TAR} cleantmp
tar -x -C tmp -f ${TAR}
cd tmp && zip -q -r -y ../${ZIP} vikaasa-${VERSION}
${BZ2}: ${TAR}
bzip2 -9 ${TAR} -c > ${BZ2}
${TAR}:
git archive --format=tar --prefix=${PREFIX} --output=${TAR} ${RELEASETAG}
git --git-dir=Libs/InfSOCSol/.git archive --format=tar --prefix=${PREFIX}Libs/InfSOCSol/ --output=${TAR}.1 ${ISS_VERSION}
tar -A -f ${TAR} ${TAR}.1
tar -tf ${TAR} | grep '^${PREFIX}Libs/InfSOCSol/tests\?' | tac | xargs tar --delete --file ${TAR}
rm ${TAR}.1
# Checking the version markers of the ZIP archive just created
versioncheck: ${ZIP}
rm -rf tmp
mkdir tmp
unzip -q -x ${ZIP} -d tmp
cd tmp/${PREFIX} && ../../bin/versioncheck
cleantmp:
rm -rf tmp
mkdir tmp
clean: cleantmp
# This is the old method.
zip:
bin/versioncheck
zip -r ../vikaasa-${VERSION}.zip \
vikaasa vikaasa_cli.m vikaasa.m vikaasa.fig \
README LICENSE NOTICE \
Docs/html/*.html \
Projects/*.mat \
ControlAlgs/*.m \
VControlAlgs/*.m \
Libs/*.m \
Libs/*/*.m \
Libs/*/*.fig