#
# Makefile for unhtml
#
# If you are parsing an HTML file that has a large Javascript program
# in it, you may need to set MAX_TAG_SIZE to something higher and
# recompile
#

CC     = gcc
MAKE   = make
RM     = rm -f
CFLAGS = -Wall
# CFLAGS = -Wall -DDEBUG


all:	unhtml

unhtml:	unhtml.o ops.o esc.o
	$(CC) -o unhtml unhtml.o ops.o esc.o

unhtml.o:	unhtml.c ops.h esc.h
	$(CC) $(CFLAGS) -c unhtml.c

ops.o:	ops.c ops.h
	$(CC) $(CFLAGS) -c ops.c

esc.o:	esc.c esc.h
	$(CC) $(CFLAGS) -c esc.c

check: all
	$(MAKE) -C tests

clean:
	$(RM) core *.o unhtml

install:
	cp unhtml /usr/local/bin
	chmod 755 /usr/local/bin/unhtml
	cp unhtml.1 /usr/local/man/man1
	chmod 644 /usr/local/man/man1/unhtml.1
