# ----------------------------------------------------------------------------
# - Makefile                                                                 -
# - aleph documentation - volume 2 makefile                                  -
# ----------------------------------------------------------------------------
# - This program is  free software;  you can  redistribute it and/or  modify -
# - it provided that this copyright notice is kept intact.                   -
# -                                                                          -
# - This  program  is  distributed in the hope  that it  will be useful, but -
# - without  any   warranty;  without  even   the   implied    warranty   of -
# - merchantability  or fitness for a particular purpose. In not event shall -
# - the copyright holder be  liable for  any direct, indirect, incidental or -
# - special damages arising in any way out of the use of this software.      -
# ----------------------------------------------------------------------------
# - copyright (c) 1999-2001 amaury darsch                                    -
# ----------------------------------------------------------------------------

TOPDIR		= ../..
MAKDIR		= $(TOPDIR)/cnf/mak
CONFFILE	= $(MAKDIR)/aleph-conf.mak
DOCSFILE	= $(MAKDIR)/aleph-docs.mak
include		  $(CONFFILE)

# ----------------------------------------------------------------------------
# project configurationn                                                     -
# ----------------------------------------------------------------------------

DSTDIR		= $(BLDDST)/tex/vol-2
ETCLNK		= aleph.sty epspk.sty preface.tex license.tex
MANUAL		= vol-2

# ----------------------------------------------------------------------------
# - project rules                                                            -
# ----------------------------------------------------------------------------

# rule: all
# this rule is the default rule which call the build rule

all: build

# include: aleph-docs.mak
# this rule includes the documentation rules

include $(DOCSFILE)

# liblnk
# this rule links the library specific tex file

liblnk:
	@# the sio library
	@$(LN) $(SRCDIR)/lib/sio/tex/pgm-sio-1.tex pgm-sio-1.tex
	@$(LN) $(SRCDIR)/lib/sio/tex/ref-sio-1.tex ref-sio-1.tex
	@$(LN) $(SRCDIR)/lib/sio/tex/ref-sio-2.tex ref-sio-2.tex
	@# the sys library
	@$(LN) $(SRCDIR)/lib/sys/tex/pgm-sys-1.tex pgm-sys-1.tex
	@$(LN) $(SRCDIR)/lib/sys/tex/ref-sys-1.tex ref-sys-1.tex
	@$(LN) $(SRCDIR)/lib/sys/tex/ref-sys-2.tex ref-sys-2.tex
	@# the net library
	@$(LN) $(SRCDIR)/lib/net/tex/pgm-net-1.tex pgm-net-1.tex
	@$(LN) $(SRCDIR)/lib/net/tex/ref-net-1.tex ref-net-1.tex
	@$(LN) $(SRCDIR)/lib/net/tex/ref-net-2.tex ref-net-2.tex
	@# the www library
	@$(LN) $(SRCDIR)/lib/www/tex/pgm-www-1.tex pgm-www-1.tex
	@$(LN) $(SRCDIR)/lib/www/tex/ref-www-1.tex ref-www-1.tex
.PHONY: liblnk

# rule: build
# build the postscript manual

build: liblnk epsman pdfman
	@$(MKDIR) $(BLDDOC)
	@$(CP)    vol-2.ps  $(BLDDOC)
	@$(CP)    vol-2.pdf $(BLDDOC)
.PHONY: doc

# rule: distri
# this rule install the vol-2 distribution files

distri:
	@$(MKDIR) $(DSTDIR)
	@$(CP)    Makefile  $(DSTDIR)
	@$(CP)    vol-2.bib $(DSTDIR)
	@$(CP)    *.tex     $(DSTDIR)
.PHONY: distri

# rule: clean
# clean the numerous files generated by latex

clean::
	@$(RM) $(ETCLNK)
	@$(RM) pgm-*-*.tex ref-*-*.tex
