# $Header: /home/amb/wwwoffle/RCS/Makefile 1.1 1997/01/11 13:09:34 amb Exp $
#
# WWWOFFLE - World Wide Web Offline Explorer - Version 1.0.
#
# Program Makefile.
#
# Written by Andrew M. Bishop
#
# This file Copyright 1995,96 Andrew M. Bishop
# It may be distributed under the GNU Public License, version 2, or
# any higher version.  See section COPYING of the GNU Public license
# for conditions under which this file may be redistributed.
#

########

INSTDIR=/usr/local
SPOOLDIR=/var/spool/wwwoffle

########

CC=gcc
CFLAGS=-O2 -Wall -g

LD=gcc
LDFLAGS=-g

########

INCLUDE=
LIBRARY=

COMPILE=$(CC) -c $(CFLAGS)

LINK=$(LD) $(LDFLAGS)

########

all : programs
	@

programs : wwwoffle wwwoffled wwwoffles
	@

########

install : programs
	install -d $(INSTDIR)/bin
	install -m 755 wwwoffle  $(INSTDIR)/bin
	install -m 755 wwwoffled $(INSTDIR)/bin
	install -m 755 wwwoffles $(INSTDIR)/bin
	install -d $(INSTDIR)/man
	install -d $(INSTDIR)/man/man1
	install -m 644 wwwoffle.man $(INSTDIR)/man/man1/wwwoffle.1
	install -m 644 wwwoffled.man $(INSTDIR)/man/man1/wwwoffled.1
	install -d $(SPOOLDIR)
	-@rm -f $(SPOOLDIR)/wwwoffles
	ln -s $(INSTDIR)/bin/wwwoffles $(SPOOLDIR)

########

clean :
	-rm -f wwwoffle wwwoffled wwwwoffles core *.o *~

########

WWWOFFLE_OBJ=wwwoffle.o io.o errors.o sockets.o

wwwoffle : $(WWWOFFLE_OBJ)
	$(LINK) $(WWWOFFLE_OBJ) -o $@ $(LIBRARY)

########

WWWOFFLED_OBJ=wwwoffled.o connect.o purge.o io.o errors.o sockets.o

wwwoffled : $(WWWOFFLED_OBJ)
	$(LINK) $(WWWOFFLED_OBJ) -o $@ $(LIBRARY)

########

WWWOFFLES_OBJ=wwwoffles.o spool.o parse.o messages.o index.o io.o errors.o sockets.o

wwwoffles : $(WWWOFFLES_OBJ)
	$(LINK) $(WWWOFFLES_OBJ) -o $@ $(LIBRARY)

########

%.o:%.c
	$(COMPILE) $< -o $@ $(INCLUDE)

wwwoffle.o  : wwwoffle.c  wwwoffle.h errors.h sockets.h
wwwoffled.o : wwwoffled.c wwwoffle.h errors.h sockets.h
wwwoffles.o : wwwoffles.c wwwoffle.h errors.h sockets.h

connect.o   : connect.c  wwwoffle.h errors.h
purge.o     : purge.c    wwwoffle.h errors.h
spool.o     : spool.c    wwwoffle.h errors.h
io.o        : io.c       wwwoffle.h
parse.o     : parse.c    wwwoffle.h
messages.o  : messages.c wwwoffle.h
index.o     : index.c    wwwoffle.h errors.h

errors.o    : errors.c  errors.h
sockets.o   : sockets.c sockets.h errors.h

########
