#!/usr/bin/make

# This makefile is for demoing an apache httpd and mozilla with
# HTTP Extensions. It is intended to be called from ../..
# ../..# make -f 2002/httpExt/Makefile demo

# You will need to check out patchPanel to run this demo.
# cvs -d :pserver:anonymous@dev.w3.org:/sources/public co patchPanel

OPTIONAL_EXT	= http://localhost:9002/doc1.xhtml
REQUIRED_EXT	= http://localhost:9002/dir1/doc2.xhtml
HTTP_EXT_INFO	= http://localhost:9002/PEP
EXTENSION_LIST	= http://localhost:9002/PEP?list
XTERM_OPTIONS	= -sl 8192

# Try these with lynx, too. The REQUIRED_EXT URL should result in a
# Not Extended (510) error.

all: demo

docServer: 
	./httpd-2.0/httpd -DONE_PROCESS -d 2002/httpExt/apache_2/DocServerRoot/ &

proxyServer: 
	./httpd-2.0/httpd -DONE_PROCESS -d 2002/httpExt/apache_2/ProxyServerRoot/ &

demo: docServer proxyServer patchPanel/patchPanel
	xterm -T proxy\ server $(XTERM_OPTIONS) -e ./patchPanel/patchPanel "proxy 9004 localhost 9003" "mask DATA" &
	xterm -T document\ server $(XTERM_OPTIONS) -e ./patchPanel/patchPanel "proxy 9002 localhost 9001" "mask DATA" &
	./mozilla/dist/bin/mozilla $(OPTIONAL_EXT) &

patchPanel/patchPanel.cpp:
	cvs -d :pserver:anonymous@dev.w3.org:/sources/public co patchPanel

patchPanel/patchPanel: patchPanel/patchPanel.cpp
	(cd patchPanel && make)

killDocServer: 
	kill `cat 2002/httpExt/apache_2/DocServerRoot/logs/httpd.pid`

killProxyServer: 
	kill `cat 2002/httpExt/apache_2/ProxyServerRoot/logs/httpd.pid`

kill: killDocServer killProxyServer

