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
|
#!/usr/bin/make -f
# Uncomment the following to enable more makefile output
#export DH_VERBOSE = 1
#
# The merge directory holds intermediate stages in setting
# up an image. It is not needed to build DUE into a .deb,
# but it will interfere with Git seeing a clean directory.
#
MERGE_DIR = due-build-merge
# Path to install of Pandoc.
PANDOC_PRESENT = /usr/bin/pandoc
# Manual page is generated from manpage-due-1.md via Pandoc
MAN_PAGE = docs/due.1
# Discover any template builds before make targets
# Forces wildcard cache to be up to date
build:
# Build
%:
dh $@
.PHONY: docs
docs: $(MAN_PAGE)
# Docs will not automatically rebuild.
# Run:
# /usr/bin/make -f ./debian/rules docs
# To update documentation.
# If Pandoc is installed generate the man page from man.md
# Otherwise, use the last checked in version of it.
# Odds are any users building this will be looking to build the
# installer and not make changes to the man pages.
# Pandoc can pull in 50-150 MB of additional files, which may be
# a bit of an ask.
ifneq ($(wildcard $(PANDOC_PRESENT)),)
@echo ""
@echo "#######################################################################"
@echo "# Pandoc detected: updating documentation "
@echo "# Removing existing $(MAN_PAGE) "
rm $(MAN_PAGE)
@echo "# Generating new man page from docs/manpage-due-1.md "
pandoc --standalone --to man docs/manpage-due-1.md -o $(MAN_PAGE)
@echo ""
/bin/ls -lrt ./docs
@echo ""
@echo "#######################################################################"
@echo ""
else
@echo ""
@echo "#######################################################################"
@echo "# Pandoc is not installed. NOT regenerating due.1 man page #"
@echo "# If you want to update the man pages: #"
@echo "# apt-get install pandoc #"
@echo "# ...and retry this make -f debian/control docs #"
@echo "#######################################################################"
@echo ""
endif
override_dh_clean:
# remove intermediate merge directories, if they exist
ifneq ($(wildcard $(MERGE_DIR)),)
@echo ""
@echo " Note: $(MERGE_DIR) work directory exists."
@echo " Consider removing it when building DUE as a Debian package."
@echo ""
else
@echo "Making clean."
endif
# Execute Debian clean
dh_clean
|