-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (48 loc) · 1.46 KB
/
Makefile
File metadata and controls
60 lines (48 loc) · 1.46 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
##
# Mathias J. Hennig wrote this script. As long as you retain this notice
# you can do whatever you want with this stuff. If we meet some day, and
# you think this stuff is worth it, you can buy me a beer in return.
##
##
# Where to store the install manifest
MANIFEST = ./.install_manifest
##
# A path to prepend before the installation paths
ifeq "$(PREFIX)" ""
PREFIX = /usr/local
endif
##
# Common, official targets
##
test: ./loop.sh
which dd getopt printf sleep stty
chmod +x ./loop.sh
test x3 = "x`./loop.sh -i 3 echo 'Hello World!' | wc -l`"
test "`wc -l < ./loop.sh`" = \
"`./loop.sh -r echo \\\$$LINE < ./loop.sh | wc -l`"
test ! -z "`./loop.sh -r echo \\\$$LINE < ./loop.sh`"
./loop.sh -f exit 1 && exit 1 || :
./loop.sh -d 1 -i 1 :
install:
mkdir -p "$(PREFIX)/bin" "$(PREFIX)/man/man1"
cp ./loop.sh "$(PREFIX)/bin/loop"
echo "$(PREFIX)/bin/loop" > $(MANIFEST)
cp ./loop.1 "$(PREFIX)/man/man1/loop.1"
echo "$(PREFIX)/man/man1/loop.1" >> $(MANIFEST)
chmod +x "$(PREFIX)/bin/loop"
uninstall: $(MANIFEST)
xargs rm < $(MANIFEST)
rm $(MANIFEST)
##
# Unofficial targets
##
loop-%.tar.gz: ./README ./Makefile ./loop.sh ./loop.1
test -e "loop-$*" || ( mkdir "loop-$*" && cp $^ "loop-$*" )
tar -cvzf "loop-$*.tar.gz" "loop-$*"
loop-%.zip: ./README ./Makefile ./loop.sh ./loop.1
test -e "loop-$*" || ( mkdir "loop-$*" && cp $^ "loop-$*" )
zip -r "loop-$*.zip" "loop-$*"
clean:
find . -type d -name 'loop-*' | xargs rm -rf
distclean:
rm -rf loop-* $(MANIFEST)