-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
88 lines (64 loc) · 1.97 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
PREFIX=/usr
DESTDIR=
AWSCMD := $(shell ./dist/getexe aws ${PREFIX}/bin)
AWSROOT := $(shell ./dist/getexedir aws ${PREFIX}/bin)
INSTALLROOT := ${AWSROOT}
INSTALLDIR := $(DESTDIR)${INSTALLROOT}
MANDIR := ${INSTALLDIR}/../man
INSTALL := $(shell which install)
INSTALL_FLAGS =
CLEAN = rm -f
GPG=$(shell which gpg2 || which gpg || echo gpg)
CODENAME=setup
SCRIPTS=src/s3checkout src/s3update src/s3commit \
src/s3setroot src/s3setopts src/s3import \
src/s3root src/s3src
INSTALLED=${INSTALLDIR}/s3checkout \
${INSTALLDIR}/s3update \
${INSTALLDIR}/s3commit \
${INSTALLDIR}/s3import \
${INSTALLDIR}/s3setroot \
${INSTALLDIR}/s3setopts \
${INSTALLDIR}/s3root \
${INSTALLDIR}/s3src
src/%: src/%.in src/header.sh
@cat src/header.sh $< > $@
@chmod a+x $@
@echo "# (s3scripts/makefile) Generated $@";
${INSTALLDIR}/%: src/%
@echo Installing $< to $@ using ${INSTALLDIR} and '${DESTDIR}'
@${INSTALL} ${INSTALLFLAGS} -m 775 $< $@
@echo Installed $< to $@
# The default
default build scripts: ${SCRIPTS}
.PHONY: build scripts default
# Getting rid of stuff
uninstall:
rm -f ${INSTALLED}
tidy:
@${CLEAN} *~ src/*~ docs/*~ docs/ronn/*~ docs/man/*~
@${CLEAN} docs/man.html/*~ docs/man.html.include/*~
@${CLEAN} #*# src/#*# docs/#*# docs/ronn/#*# docs/man/#*#
@${CLEAN} docs/man.html/#*# docs/man.html.include/#*#
clean:
@${CLEAN} ${SCRIPTS}
@${CLEAN} docs/man/*.1 docs/man/*.gz
@${CLEAN} docs/man.html/*.html docs/man.html.include/*.html
.PHONY: uninstall clean tidy
# Documentation
docs:
@cd docs; make
manpages:
@cd docs; make man.gz
.PHONY: docs install-docs
# Installation
install: ${INSTALLDIR} ${INSTALLED} install-docs
${INSTALLDIR}:
@${INSTALL} -d ${INSTALLFLAGS} $@
install-docs: ${INSTALLDIR} docs manpages
@${INSTALL} -d ${MANDIR}/man1
@${INSTALL} docs/man/*.1.gz ${MANDIR}/man1
install-man install-manpages: manpages
@${INSTALL} docs/man/*.1.gz ${MANDIR}/man1
.PHONY: install install-docs install-man install-manpages