# Makefile for wwwish
# edit to taste, specifically the tcl/tk directories


SHELL = /bin/sh

#### Start of system configuration section. ####
CC = gcc
CFLAGS = -O2 -m486
LDFLAGS = -O2
DEFINES =  -DSTDC_HEADERS=1

prefix = /usr/local
exec_prefix = ${prefix}

# Where to install the executable.
bindir = $(exec_prefix)/bin

# where is your Tcl/Tk headers and libraries? Needed for compiling.
TCL_INCDIR = -I/usr/local/include
TCL_LIBDIR = -L/usr/local/lib
TK_INCDIR = -I/usr/local/include
TK_LIBDIR = -L/usr/X11R6/lib

# if you are using term, uncomment the following:
TERMINC = #-include /usr/src/term200/termnet.h
TERMLIB = #-ltermnet

INCLUDES = -I./ $(TERMINC) $(TCL_INCDIR) $(TK_INCDIR) \
	$(XINCLUDES) -I./libwww

ALL_CFLAGS= $(DEFINES) $(INCLUDES) $(CFLAGS)

WWW_LIB= libwww/libwww.a

LIBS= $(TCL_LIBDIR) $(TK_LIBDIR) $(TERMLIB) -ltk -ltcl -lX11 -lm

objs =  TkWWWCmds.o HText.o HTML.o HTFile.o HTAlert.o HTFormat.o TkWWWBitmap.o

srcs =  TkWWWCmds.c HText.c HTML.c HTFile.c HTAlert.c HTFormat.c TkWWWBitmap.c

distfiles = $(srcs)

all:
	@echo making libwww.a
	@cd libwww;make CC=$(CC) CFLAGS='$(CFLAGS) -DACCESS_AUTH $(TERMINC)'
	@echo making wwwish
	@make wwwish 

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

wwwish:	TclAppInit.o $(objs)
	$(CC) -o $@ $(LDFLAGS) TclAppInit.o $(objs) $(WWW_LIB) $(LIBS)

install:

clean:
	rm -f sed *.o core wwwish libwww/libwww.a libwww/*.o

mostlyclean: clean

