.PHONY: all clean cleanall tags

.c.o:
	$(CC) -c $(CFLAGS2) $<


WWW_MACH = os2
CC = gcc -s -O2 -Wall -DOS2
LD = ld
AR = ar rcs
MAKE = make
MV = mv
CP = cp
RM = rm -f

CDEBUGFLAGS = -O3 -pipe

# Where is the WWW source root?
WWW = ..

# Where should temporary (object) files go?
WTMP =

#	Common Makefile for W3 Library Code
#	-----------------------------------
#
#	(c) CERN 1990, 1991 -- see Copyright.html for conditions

#	make		Compile and link the software (private version)
#	make clean	Remove intermediate files

# Where shall we put the objects and built library?

# Bug: This path, if relative, is taken relative to the directory
# in which this makefile is, not the pwd. This screws up the
# recursive invocation

VC = 2.17

CFLAGS2 = $(CFLAGS) -I.

CFILES=HTParse.c HTAccess.c HTTP.c HTFile.c HTFTP.c HTTCP.c SGML.c \
HTML.c HTMLDTD.c HTPlain.c HTWriter.c HTFWriter.c HTMLGen.c HTChunk.c \
HTAtom.c HTAnchor.c HTStyle.c HTList.c HTString.c HTAlert.c HTRules.c \
HTFormat.c HTInit.c HTMIME.c HTHistory.c HTNews.c HTGopher.c HTTelnet.c \
HTError.c HTErrorMsg.c HTDirBrw.c HTAABrow.c HTAAUtil.c HTIcons.c HTUU.c \
HTDescript.c HTAssoc.c HTBTree.c HTMulti.c HTTee.c HTGuess.c HTTeXGen.c \
HTWSRC.c # HTWAIS.c

COMMON=$(addsuffix .o,$(basename $(CFILES)))

HFILES=HTParse.h HTAccess.h HTTP.h HTFile.h HTFTP.h HTTCP.h \
SGML.h HTML.h HTMLDTD.h HTChunk.h HTPlain.h HTWriter.h HTFWriter.h \
HTMLGen.h HTStream.h HTAtom.h HTAnchor.h HTStyle.h HTList.h \
HTString.h HTAlert.h HTRules.h HTFormat.h HTInit.h HTMIME.h HTHistory.h \
HTNews.h HTGopher.h HTUtils.h tcp.h WWW.h HText.h HTTelnet.h HTTeXGen.h \
HTWAIS.h HTWSRC.h

SOURCES =$(CFILES) $(HFILES) Version.make CommonMakefile \
	 $(WWW)/README.txt $(WWW)/Copyright.txt $(WWW)/BUILD
SPECIFIC = $(WWW)/All

#	Library
#
all: $(WWW)/libwww.a

$(WWW)/libwww.a : $(COMMON)
	rm -f $(WWW)/libwww.a
	$(AR) $(WWW)/libwww.a $(COMMON)

#	Clean up everything generatable except final products
clean ::
	$(RM) $(WWW)/libwww.a $(COMMON)

#	Clean up everything generatable including final products

cleanall :: clean
	$(RM) $(WWW)/libwww.a

tags::
	$(TAGS) -w *.[ch]
	$(TAGS) -xw *.[ch] > TAGS

HTList.o : HTList.c HTUtils.h HTList.h
HTAnchor.o : HTAnchor.c HTUtils.h HTList.h
HTFormat.o : HTFormat.c HTUtils.h HTList.h
HTInit.o : HTInit.c HTUtils.h HTList.h
HTMIME.o : HTMIME.c HTUtils.h HTList.h
HTHistory.o : HTHistory.c HTUtils.h HTList.h
HTNews.o : HTNews.c HTUtils.h HTList.h
HTGopher.o : HTGopher.c HTUtils.h HTList.h
HTTelnet.o : HTTelnet.c HTUtils.h HTTelnet.h
HTStyle.o : HTStyle.c HTUtils.h
HTAtom.o : HTAtom.c HTUtils.h
HTChunk.o : HTChunk.c HTUtils.h
SGML.o : SGML.c HTUtils.h
HTML.o : HTML.c HTUtils.h HTMLDTD.h
HTMLGen.o : HTMLGen.c HTUtils.h HTMLDTD.h
HTMLDTD.o : HTMLDTD.c SGML.h
HTPlain.o : HTPlain.c HTPlain.h HTStream.h
HTWSRC.o : HTWSRC.c HTUtils.h HTList.h
HTWriter.o : HTWriter.c HTWriter.h HTStream.h
HTFWriter.o : HTFWriter.c HTFWriter.h HTStream.h

HTString.o : HTString.c HTUtils.h Version.make
	$(CC) -c $(CFLAGS2) -DVC=\"$(VC)\" HTString.c

HTAlert.o : HTAlert.c HTUtils.h Version.make
	$(CC) -c $(CFLAGS2) -DVC=\"$(VC)\" HTAlert.c

HTRules.o : HTRules.c HTUtils.h Version.make
	$(CC) -c $(CFLAGS2) -DVC=\"$(VC)\" HTRules.c

HTWAIS.o : HTWAIS.c HTUtils.h HTList.h
	$(CC) -c $(CFLAGS2) $(WAISINC) HTWAIS.c

#	Communications & Files

HTTP.o : HTTP.c HTUtils.h
HTTCP.o : HTTCP.c HTUtils.h
HTFile.o : HTFile.c HTUtils.h
HTFTP.o : HTFTP.c HTUtils.h
HTAccess.o : HTAccess.c HTUtils.h
HTParse.o : HTParse.c HTUtils.h
