#  Output Directory

MAN_DIR  = ../man/man3
HTML_DIR = ../html

#  Input Directory

SRC_DIR  = ../src

.SUFFIXES:	.c .in .txt

#  Name of the sources
API_TPL = misc/src/dbxerr.c.in
API_SRC = misc/src/mpe_seq.c misc/src/privtags.c misc/src/mpe_io.c \
          misc/src/mpehname.c misc/src/decomp.c misc/src/getgrank.c \
          logging/src/mpe_log.c \
          graphics/src/mpe_graphics.c graphics/src/xmouse.c
INC_TXT = 

#  The following statements require GNU make.
REAL_TPL = $(API_TPL:%.in=$(SRC_DIR)/%.in)
REAL_SRC = $(API_SRC:%.c=$(SRC_DIR)/%.c)
REAL_TXT = $(INC_TXT:%.txt=$(SRC_DIR)/%.txt)

#  The utilities property
DOCTEXT = /home/gropp/bin/linux-rh73/doctext
DOC_OPT = -heading MPE

all:	man html

man:	FORCE 
	if [ ! -d $(MAN_DIR) ] ; then \
		mkdir -p $(MAN_DIR) ; fi
	$(DOCTEXT) -mpath $(MAN_DIR) $(DOC_OPT) \
	                  $(REAL_TXT) $(REAL_SRC) $(REAL_TPL)
FORCE:

html:	FORCE
	if [ ! -d $(HTML_DIR) ] ; then \
		mkdir -p $(HTML_DIR) ; fi
	$(DOCTEXT) -html -mpath $(HTML_DIR) $(DOC_OPT) \
	           -index $(HTML_DIR)/libmpe.cit -indexdir $(HTML_DIR) \
	           $(REAL_TXT) $(REAL_SRC) $(REAL_TPL)
FORCE:

clean:
	rm -f $(MAN_DIR)/*.3 $(HTML_DIR)/*.html $(HTML_DIR)/*.cit
