-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
68 lines (57 loc) · 1.74 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
BUILDCACHE=$(shell /bin/pwd)/buildcache
tests: test1 test2 test3 test4
test1:
rm -fr cache data output.bak
mkdir -p output data
cp -f /etc/motd data
BUILDCACHE_CACHEDIR=./cache/test1 \
BUILDCACHE_OUTPUTDIR=./output \
$(BUILDCACHE) sort data/motd -o output/dmot
mv output output.bak
BUILDCACHE_CACHEDIR=./cache/test1 \
BUILDCACHE_OUTPUTDIR=./output \
$(BUILDCACHE) sort data/motd -o output/dmot
diff -urN output.bak output
find cache
## verify that BUILDCACHE_OUTPUTDIR is not needed
test2:
rm -fr test2dir data
mkdir -p test2dir/output data
cp -f /etc/motd data
cd test2dir; \
BUILDCACHE_CACHEDIR=./cache/test2 \
$(BUILDCACHE) sort ../data/motd -o output/dmot; \
mv output output.bak; \
BUILDCACHE_CACHEDIR=./cache/test2 \
$(BUILDCACHE) sort ../data/motd -o output/dmot; \
diff -urN output.bak output
## make sure it works even if a file is written and removed
test3:
rm -fr test3dir data
mkdir -p test3dir/output data
cp -f /etc/motd data
cd test3dir; \
BUILDCACHE_CACHEDIR=./cache/test3 \
$(BUILDCACHE) ../test3.sh ../data/motd output/dmot; \
mv output output.bak; \
BUILDCACHE_CACHEDIR=./cache/test3 \
$(BUILDCACHE) ../test3.sh ../data/motd output/dmot; \
diff -urN output.bak output
## make sure it works even if BUILDCACHE_CACHEDIR is unset
test4:
rm -fr test4dir data
mkdir -p test4dir/output data
cp -f /etc/motd data
cd test4dir; \
unset BUILDCACHE_CACHEDIR; \
$(BUILDCACHE) sort ../data/motd -o output/dmot
diff -urN output.bak output
all:
true
INSTALL_DIRS = buildcache
install:
install -d -m755 $(DESTDIR)/usr/share/buildcache
install -m755 buildcache $(DESTDIR)/usr/share/buildcache/buildcache
VERSION=22.05.24
dpkg:
git buildpackage --git-ignore-new --git-upstream-branch=master --git-debian-branch=ubuntu/trusty -tc