1 # GNU Makefile for archives2git
3 PACKAGE_NAME
= archives2git
4 PACKAGE_TARNAME
= archives2git
6 # Get the version via git or from the VERSION file or from the project
8 VERSION
= $(shell test -x version.sh
&& .
/version.sh
$(PACKAGE_TARNAME
) \
9 || echo
"unknown_version")
10 # Allow either to be overwritten by setting DIST_VERSION on the command line.
12 VERSION
= $(DIST_VERSION
)
14 PACKAGE_VERSION
= $(VERSION
)
16 prefix = $(HOME
)/.local
17 bindir = $(prefix)/bin
18 datarootdir
= $(prefix)/share
19 docdir
= $(datarootdir
)/doc
/$(PACKAGE_TARNAME
)
20 mandir = $(datarootdir
)/man
21 # DESTDIR = # distributors set this on the command line
25 HELPMESSAGE2POD
= helpmessage2pod
27 POD2MAN_FLAGS
= --utf8
-c
"User manuals" -r
"$(VERSION)"
31 ASCIIDOC_FLAGS
= -apackagename
="$(PACKAGE_NAME)" -aversion
="$(VERSION)"
33 SCRIPTS
= archives2git
34 MANDOC
= $(SCRIPTS
:%=%.1)
35 TEXTDOC
= $(SCRIPTS
:%=%.1.txt
)
36 HTMLDOC
= $(SCRIPTS
:%=%.1.html
) README.html
37 ALLDOC
= $(MANDOC
) $(TEXTDOC
) $(HTMLDOC
)
39 .PHONY
: .help
all clean build doc
install install-doc
44 @echo
"Useful targets:"
45 @echo
" doc clean distclean install install-doc"
48 $(RM
) *.1.helpm
*.pod pod2htmd.tmp pod2htmi.tmp
*~ .
*~
52 install: build install-doc
53 $(MKDIR
) -p
$(DESTDIR
)$(bindir)
54 $(INSTALL
) -m
755 $(SCRIPTS
) $(DESTDIR
)$(bindir)/
56 $(MKDIR
) -p
$(DESTDIR
)$(mandir)/man1
57 $(INSTALL
) -m
644 $(MANDOC
) $(DESTDIR
)$(mandir)/man1
/
62 README.html
: README asciidoc.conf
63 $(ASCIIDOC
) $(ASCIIDOC_FLAGS
) -b xhtml11
-d article
-a readme
$<
68 <$< $(HELPMESSAGE2POD
) - >$@
71 $(POD2MAN
) $(POD2MAN_FLAGS
) --section
1 $< >$@
73 $(POD2TEXT
) --utf8
$< >$@
75 $(POD2HTML
) --noindex
--title
"$(shell printf "%s
(1)" "$*" | LC_ALL=C tr a-z A-Z)" \