################################################################
# Makefile for the SWI-Prolog based latex2html converter
#
# Author: Jan Wielemaker
# E-mail: jan@swi.psy.uva.nl
#
# Free for personal usage and usage by academic institutions.
# This package may be distributed freely.
# This package may be modified if it is clearly indicated is concerns a
# modified version, and the copyright and authorship notices are left
# in place.
#
# Copyright (c) 1996, SWI, University of Amsterdam, all rights reserved
################################################################

prefix=@prefix@
exec_prefix=@exec_prefix@
srcdir=@srcdir@
@VPATH@ @srcdir@
bindir=$(exec_prefix)/bin
PLBASE=$(prefix)/lib/@PL@-$(PLVERSION)
man_prefix=$(prefix)/man
mansec=1
lmansec=3
mandir=$(man_prefix)/man$(mansec)
lmandir=$(man_prefix)/man$(lmansec)
plmandir=$(PLBASE)/man

CC=@CC@
AR=@AR@
RANLIB=@RANLIB@
COFLAGS=@COFLAGS@
CWFLAGS=@CWFLAGS@
CIFLAGS=@CIFLAGS@
CMFLAGS=@CMFLAGS@
CFLAGS=	$(CWFLAGS) $(COFLAGS) $(CIFLAGS) $(CMFLAGS)

INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
INSTALL_DATA=@INSTALL_DATA@

LIBOBJ=	html.o access.o build.o util.o

all:	plrc

plrc:	librc.a rc.o
	$(CC) -o $@ rc.o -L. -lrc

librc.a:	$(LIBOBJ)
	rm -f $@
	$(AR) cq $@ $(LIBOBJ)
	$(RANLIB) $@

.c.o:
	$(CC) -c -I.. $(CFLAGS) $< @COUTOPT@

################################################################
# Documentation
################################################################

html:	rc.tex
	latex2html rc

dvi:	rc.dvi

rc.dvi:	rc.tex
	./latex_if_needed rc

rc.tex:	rc.doc
	../xpce/bin/doc2tex rc.doc > rc.tex

################################################################
# Cleanup
################################################################

clean:
	rm -f *% *~ $(LIBOBJ) rc.o

distclean:	clean
	rm -f Makefile
	rm -f plrc librc.a

