Files
gnatdashboard/Makefile
Charly Delay f308b04a81 chore(doc): Makefile rework
Rewrite the Makefile to comply with good practices and conventions (see
https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html).

Change-Id: I123a7fde2b7abdddecc1aa225f32b8b3c82ac45c
2016-06-16 14:18:13 -04:00

55 lines
1.3 KiB
Makefile

# Makefile for GNATdashboard
# Command variables
CP = cp
MKDIR = install -d
# General conventions for Makefiles
SHELL = /bin/sh
.SUFFIXES:
# Common prefix for installation directories.
# NOTE: This directory must exist when you start the install.
prefix = /usr/local
datarootdir = $(prefix)/share
docdir = $(datarootdir)/doc/gnatdashboard
pdfdir = $(docdir)/pdf
htmldir = $(docdir)/html
mkfile := $(abspath $(lastword $(MAKEFILE_LIST)))
rootdir := $(patsubst %/,%,$(dir $(mkfile)))
builddir = $(rootdir)/build
gnathubdir = $(rootdir)/gnathub
MAKE_DOC = $(MAKE) -C docs builddir=$(builddir) GNATHUBDIR=$(gnathubdir)
# Generate both HTML and PDF documents
all: gnathub-api-docs docs-html docs-pdf
gnathub-api-docs: docs/Makefile
$(MAKE_DOC) api-doc
$(MAKE_DOC) plugins-doc
# Generate the HTML documentation
docs-html: gnathub-api-docs
$(MAKE_DOC) html
# Generate the PDF documentation
docs-pdf: gnathub-api-docs
$(MAKE_DOC) latexpdf
installdirs:
$(MKDIR) $(docdir)
$(MKDIR) $(pdfdir)
$(MKDIR) $(htmldir)
install-html: docs-html installdirs
(cd $(builddir)/docs && tar cf - html) | \
(cd $(htmldir) && tar xf - --strip-components 1)
install-pdf: docs-pdf installdirs
$(CP) $(builddir)/docs/latex/GNATdashboard.pdf $(pdfdir)
install: install-html install-pdf