3 # Debian build rules for help2man.
5 # Copyright (C) 2012, 2014 Free Software Foundation, Inc.
7 # Copying and distribution of this file, with or without modification,
8 # are permitted in any medium without royalty provided the copyright
9 # notice and this notice are preserved. This file is offered as-is,
10 # without any warranty.
12 # Written by Brendan O'Dea <bod@debian.org>
15 DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
16 DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
18 ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
19 CONFARGS = --host=$(DEB_HOST_GNU_TYPE)
22 build: build-arch build-indep
23 build-arch build-indep: build-stamp
26 ./configure --prefix=/usr --enable-nls --mandir='$${prefix}/share/man' \
27 --infodir='$${prefix}/share/info' $(CONFARGS)
30 $(MAKE) help2man.h2m # for examples
34 test README -nt help2man.PL # maintainer sanity check
37 [ ! -f Makefile ] || $(MAKE) distclean
38 rm -f build-stamp install-stamp
41 install: install-stamp
42 install-stamp: build-stamp
47 $(MAKE) install DESTDIR=$(CURDIR)/debian/help2man
50 # Build architecture-independent files here.
51 binary-arch: build install
68 # Build architecture-dependent files here.
69 binary-indep: build install
70 # We have nothing to do by default.
73 @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
75 # maintainer pre-release setup
76 AM_DOC = COPYING INSTALL
77 AM_AUX = install-sh missing mkinstalldirs
78 AM_DIR = $(shell ls -d /usr/share/automake* 2>/dev/null | tail -1)
79 VERSION = $(shell ./help2man.PL --version)
82 test `dpkg-parsechangelog | sed -n 's/^Version:\s\+//p'` = $(VERSION)
83 cp $(addprefix $(AM_DIR)/,$(AM_DOC)) .
84 cp $(addprefix $(AM_DIR)/,$(AM_AUX)) build-aux
85 (echo " README for GNU help2man version $(VERSION)"; \
87 echo "help2man is a script to create simple man pages from the --help and"; \
88 echo "--version output of programs."; \
90 echo " http://www.gnu.org/software/help2man/"; \
91 echo " ftp://ftp.gnu.org/gnu/help2man/help2man-$(VERSION).tar.xz"; \
93 echo " git://anonscm.debian.org/users/bod/help2man.git"; \
94 echo " http://anonscm.debian.org/gitweb/?p=users/bod/help2man.git"; \
96 echo "Since most GNU documentation is now in info format, this provides a"; \
97 echo "way to generate a placeholder man page pointing to that resource while"; \
98 echo "still providing some useful information."; \
101 echo "Brendan O'Dea <bod@debian.org>") >README
102 ln -sf debian/changelog ChangeLog
105 $(MAKE) update-po all distclean
107 maint-clean: maint-prep
109 $(MAKE) maintainer-clean
110 rm -f README ChangeLog $(AM_DOC) $(addprefix build-aux/,$(AM_AUX))
112 binary: binary-indep binary-arch
113 .PHONY: build clean binary-indep binary-arch binary maint-prep maint-clean