# ex: set ro:
# DO NOT EDIT THIS FILE
# Generated by Parrot::Configure::Compiler from config/gen/makefiles/docs.in

# Copyright (C) 2001-2012, Parrot Foundation.

# Setup of some commands
PERL    = /usr/bin/perl
CHMOD   = $(PERL) -MExtUtils::Command -e chmod
MKPATH  = $(PERL) -MExtUtils::Command -e mkpath
TOUCH   = $(PERL) -MExtUtils::Command -e touch
RM_F    = $(PERL) -MExtUtils::Command -e rm_f
RM_RF   = $(PERL) -MExtUtils::Command -e rm_rf
PERLDOC = echo
POD2MAN = /usr/bin/pod2man
VERSION = 5.2.0
ADDGENERATED = $(PERL) ../tools/build/addgenerated.pl
OPS_SUMMARY = ../tools/docs/ops_summary.pl

# long list of .pod files
POD = 

MAN_1 = binaries/parrot.1 \
	binaries/ops2c.1 \
	binaries/parrotbug.1 \
	binaries/parrot_config.1 \
	binaries/parrot_nci_thunk_gen.1 \
	binaries/parrot-nqp.1 \
	binaries/parrot-prove.1 \
	binaries/pbc_to_exe.1 \
	binaries/plumage.1 \
	binaries/winxed.1

.SUFFIXES : .pod .1

#
# Targets
#

# The default target
all: doc-prep packfile-c.pod $(POD) ops/index.pod man

# This is a listing of all targets, that are meant to be called by users
# Most of them are proxied in the root makefile parrot/Makefile
help :
	@echo ""
	@echo "Following targets are available to the user:"
	@echo ""
	@echo "all:             Generate documentation from .pod files or from the sources."
	@echo "                 This is the default target."
	@echo ""
	@echo "man:             Generate man files (not on windows)"
	@echo "htmlhelp:        generate a .chm file (windows only)."
	@echo "htmlhelp-clean:  Remove generated .chm"
	@echo ""
	@echo "pdf:             Generate a PDF from the html docs"
	@echo "pdf-clean:       Remove generated pdf"
	@echo ""
	@echo "clean:           Remove the generated documentation."
	@echo ""

$(POD): doc-prep

doc-prep:
	$(MKPATH) ops
	$(TOUCH) doc-prep

packfile-c.pod: ../src/packfile/api.c
	$(PERLDOC) -u ../src/packfile/api.c > packfile-c.pod
	$(ADDGENERATED) "docs/$@" "[doc]"

.pod.1 : # suffix rule (limited support)
	$(POD2MAN) $< > $@
	$(ADDGENERATED) "docs/$@" "[main]" man

ops/index.pod : $(POD) $(OPS_SUMMARY)
	$(PERL) $(OPS_SUMMARY) > ops/index.pod
	$(ADDGENERATED) "docs/$@" "[doc]"

man: man.good

man.good: $(MAN_1)

man.stub:
	@echo "pod2man is required, but not detected."

man-clean:
	$(RM_F) $(MAN_1)

clean: man-clean html-clean pdf-clean htmlhelp-clean
	$(RM_F) packfile-c.pod $(POD) doc-prep
	$(RM_RF) ops

html:
	$(PERL) -I../lib ../tools/docs/mk_html_docs.pl --version=$(VERSION)
html-clean:
	$(RM_RF) html

# If you are missing the command 'pdflatex' then you have first to install a
# LaTeX distribution with it. For Windows and UNIX downloads are for example
# available from: http://miktex.org, http://tug.org/texlive or
# http://www.ctan.org
pdf: ../tools/docs/filename_and_chapter.pl
	$(MKPATH) build/modified_pod
	$(PERL) ../tools/docs/filename_and_chapter.pl
	cd build && pdflatex parrot-book.tex && pdflatex parrot-book.tex
	$(ADDGENERATED) "docs/build/parrot-book.pdf" "[main]" doc

#pdf-release: build/parrot-book.pdf
#	cp build/parrot-book.pdf build/parrot-book-$$(date +"%Y.%m").pdf

pdf-clean:
	$(RM_RF) build

htmlhelp: html

htmlhelp-clean:



# Local variables:
#   mode: makefile
# End:
# vim: ft=make:
