#

CC = gcc
CFLAGS = -g -O2 -DXMOSAIC
RANLIB = ranlib

EXETARGET = html2latex
LIBTARGET = libhtmlp.a
DOCTARGET = html2latex.tex

all: $(LIBTARGET) $(EXETARGET) $(DOCTARGET)

CFILES = HTMLparse.c HTMLplist.c

OBJS = $(CFILES:.c=.o)

$(LIBTARGET): $(OBJS)
	-rm -f $(LIBTARGET)
	ar rv $(LIBTARGET) $(OBJS)
	$(RANLIB) $(LIBTARGET)

$(EXETARGET): $(LIBTARGET) $(EXETARGET).c
	$(CC) $(CFLAGS) -o $(EXETARGET) $(EXETARGET).c $(LIBTARGET)

$(DOCTARGET): $(EXETARGET) html2latex.html
	./$(EXETARGET) html2latex.html

$(OBJS): HTMLparse.h

install: $(EXETARGET)
	install -m 0755 $(EXETARGET) /usr/bin

uninstall:
	rm /usr/bin/$(EXETARGET)

clean:
	-rm $(EXETARGET) $(OBJS) $(LIBTARGET) $(DOCTARGET)



