KLIC=klic
CFLAGS = -c -g
LDFLAGS=-g
CC = gcc

OBJ = support.o list.o connect.o interface.o cci_interface.o \
	tohtml.o util.o html.o cgi.o unwrap.o http.o ping.o \
	url.o page.o server webpage inttostr.o univ.o

all: $(OBJ)

webpage: webpage.o html.o util.o http.o unwrap.o tohtml.o url.o inttostr.o page.o
	$(KLIC) -o webpage $(LDFLAGS) webpage.o html.o util.o http.o unwrap.o tohtml.o url.o inttostr.o page.o

## FIX: replace /home/http/programs/epontell with the path to the local
##   CGI directory
server: server.o util.o html.o http.o unwrap.o inttostr.o tohtml.o cgi.o
	$(KLIC) -o server $(LDFLAGS) server.o html.o util.o http.o unwrap.o tohtml.o inttostr.o cgi.o

webpage.o: http_connect.h cio.h webpage.kl1
	$(KLIC) $(CFLAGS) webpage.kl1

server.o: server.kl1
	$(KLIC) $(CFLAGS) server.kl1

html.o: html.kl1
	$(KLIC) $(CFLAGS) html.kl1

univ.o: univ.kl1
	$(KLIC) $(CFLAGS) univ.kl1

util.o: util.kl1
	$(KLIC) $(CFLAGS) util.kl1

http.o: http.kl1 
	$(KLIC) $(CFLAGS) http.kl1

unwrap.o: unwrap.kl1
	$(KLIC) $(CFLAGS) unwrap.kl1

tohtml.o: tohtml.kl1
	$(KLIC) $(CFLAGS) tohtml.kl1

cgi.o: cgi.kl1
	$(KLIC) $(CFLAGS) cgi.kl1

inttostr.o: inttostr.kl1
	$(KLIC) $(CFLAGS) inttostr.kl1

url.o: url.kl1
	$(KLIC) $(CFLAGS) url.kl1

ping.o: ping.kl1
	$(KLIC) $(CFLAGS) ping.kl1

page.o: http_connect.h cio.h page.kl1
	$(KLIC) $(CFLAGS) page.kl1

support.o: support.c cci.h
	$(CC) $(CFLAGS) -c support.c
list.o: list.c list.h listP.h
	$(CC) $(CFLAGS) -c list.c
connect.o: connect.c connect.h port.h memStuffForPipSqueeks.h
	$(CC) $(CFLAGS) -c connect.c
interface.o: interface.c cci.h
	$(CC) $(CFLAGS) -c interface.c
cci_interface.o: cci_interface.kl1 port.h cci.h interface.h interface.o connect.o list.o support.o
	$(KLIC) $(KLICFLAGS) -c -o cci_interface.o cci_interface.kl1 interface.o connect.o list.o support.o

