-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (29 loc) · 953 Bytes
/
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
#pass - unix password manager
NAME = pass
VERSION = 0.1
PREFIX ?= /usr/local
all:
@echo "Only a shell script, try 'make install' instead."
test:
sh test.sh
dist:
@echo creating dist tarball
@mkdir -p ${NAME}-${VERSION}
@cp -R pass.sh Makefile ${NAME}-${VERSION}
@tar -cf ${NAME}-${VERSION}.tar ${NAME}-${VERSION}
@gzip ${NAME}-${VERSION}.tar
@rm -rf ${NAME}-${VERSION}
install: pass.sh getopts/getopts.sh
@VERSION="`git describe --first-parent --always`" awk '\
/^\. / { f=$$2; while (getline < f) print; next; } \
/^pass_version.*}/ { \
print "pass_version() { echo " ENVIRON["VERSION"] "; }"; next; \
} \
{ print; } \
' <pass.sh >"${DESTDIR}${PREFIX}/bin/pass"
@cp git-credential-pass.sh "${DESTDIR}${PREFIX}/bin/git-credential-pass"
@chmod 755 "${DESTDIR}${PREFIX}/bin/pass"
@chmod 755 "${DESTDIR}${PREFIX}/bin/git-credential-pass"
uninstall:
@rm -f "${DESTDIR}${PREFIX}/bin/pass" \
.PHONY: dist install uninstall test