# makefile for snarf, the Simple Non-interactive All Purpose Resource Fetcher
# Copyright (C) 1995, 1996 Zachary Beane
# 
# Can you tell this is my first makefile?

# if you don't have install, you're out of luck
   INSTALL = /usr/bin/install
INSTALLDIR = /usr/local
      USER = root
     GROUP = bin

# define your compiler
        CC = gcc

# Some SunOS's, uncomment the following, thanks to Greg Lewis for
# finding this for me
#LIBS = -lsocket -lnsl -L/usr/ucblib -lucb
CFLAGS = -O2
#
#CFLAGS = -DDEBUG

# Don't touch anything below. Unless, of course, you know more than me.
# NOTE: This is easily accomplished.

OBJS = snarf.o url.o simple.o ftp.o alias.o option.o http.o misc.o


snarf : ${OBJS}
	${CC} ${CFLAGS} -o snarf ${OBJS} ${LIBS}

snarf.o : snarf.c url.h protocol.h option.h snarf.h
	${CC} ${CFLAGS} -c snarf.c

url.o : url.c url.h protocol.h
	${CC} ${CFLAGS} -c url.c

simple.o : simple.c url.h option.h
	${CC} ${CFLAGS} -c simple.c

ftp.o : ftp.c url.h option.h
	${CC} ${CFLAGS} -c ftp.c

alias.o : alias.c
	${CC} ${CFLAGS} -c alias.c

misc.o : misc.c misc.h
	${CC} ${CFLAGS} -c misc.c

http.o : http.c
	${CC} ${CFLAGS} -c http.c

install : snarf.1 snarf
	${INSTALL} -g ${GROUP} -o ${USER} -m 0644 snarf.1 ${INSTALLDIR}/man/man1
	${INSTALL} -g ${GROUP} -o ${USER} -m 0755 snarf ${INSTALLDIR}/bin
	@echo ======================================================
	@echo Visit snarf on the web! http://xach.dorknet.com/snarf/
	@echo ======================================================
	@echo Don\'t forget to install a personal snarfrc file.

clean :
	rm -f *~ *.o snarf \#*\#

love :
	@echo "Error: no sexd present."

war :
	@echo "Make love, not war."

out :
	@echo "Heavy petting, maybe, but no making out."
