# httpproxy and related tools
#
# copyright 1995-96 Matthias Hopf
#
# All rights reserved.
#


# All objects
HTTPPROXY_O   = httpproxy.o logging.o service.o cache.o queue.o net_amitcp.o net_as225.o
HTTPDELETE_O  = httpdelete.o cache.o
HTTPFETCH_O   = httpfetch.o net_amitcp.o net_as225.o
HTTPRESOLVE_O = httpresolve.o cache.o

# Front end
test:
	@smake "CFLAGS=cpu=000 noopt stackcheck" all

debug:
	@smake "CFLAGS=cpu=000 noopt stackcheck define DEBUG=1" all

db:
	@smake clean
	@smake "CFLAGS=cpu=000 noopt noerrrexx stackcheck define DEBUG=1" all

ndb:
	@smake clean
	@smake "CFLAGS=cpu=000 noopt noerrrexx" all

ndb000:
	@smake clean
	@smake "CFLAGS=cpu=000 opt noerrrexx" all

ndb020:
	@smake clean
	@smake "CFLAGS=cpu=020 opt noerrrexx" all

depend:
	@echo >t:makedepend.shell  "makedepend `list lformat=%s%s \#?.c`"
	@execute t:makedepend.shell

all:    httpproxy httpdelete httpfetch httpresolve


# Special: clean
clean:
	-delete \#?.o \#?.lnk

# Special: check in
ci:
	-ci -l \#?.c \#?.h makefile
	-ci -l \#?.guide \#?.html
	-ci -l Install \#?.rexx

# Special: make lha archive
lha:
	execute makelha

small:
	execute makelha SMALL

alpha:
	execute makelha ALPHA

# Standard files

# Linking step
httpproxy: $(HTTPPROXY_O)
	sc link to $@ $(HTTPPROXY_O)

httpdelete: $(HTTPDELETE_O)
	sc link to $@ $(HTTPDELETE_O)

httpfetch: $(HTTPFETCH_O)
	sc link to $@ $(HTTPFETCH_O)

httpresolve: $(HTTPRESOLVE_O)
	sc link to $@ $(HTTPRESOLVE_O)

# Spezial rules
net_amitcp.o:
	$(CC) $(CFLAGS) $< idir netinclude: gst include:allnet.gst

net_as225.o:
	$(CC) $(CFLAGS) $< idir netinc: nogst


# Source dependencies - should be done by makedepend, but isn't... :(

logging.o:      logging.c
net_amitcp.o:   net_amitcp.c
httpfetch.o:    httpfetch.c
net_as225.o:    net_as225.c
httpresolve.o:  httpresolve.c
httpproxy.o:    httpproxy.c
httpdelete.o:   httpdelete.c
service.o:      service.c
cache.o:        cache.c
queue.o:        queue.c


# DO NOT DELETE THIS LINE -- make depend depends on it.

net_as225.o: net.h debug.h
logging.o: httpproxy.h cache.h debug.h logging.h
httpresolve.o: httpproxy.h cache.h debug.h httpproxy_rev.h
net_amitcp.o: net.h debug.h
httpfetch.o: net.h debug.h
queue.o: queue.h logging.h httpproxy.h cache.h debug.h
httpproxy.o: httpproxy.h cache.h debug.h net.h logging.h queue.h
httpproxy.o: httpproxy_rev.h
httpdelete.o: httpproxy.h cache.h debug.h
cache.o: httpproxy.h cache.h debug.h logging.h
service.o: httpproxy.h cache.h debug.h
