###########################
# finddupe
# written by George Shearer

###########################
# Change these as necessary
CC=gcc
CFLAGS=-O6

###################
# Installation path
INSTPATH=/usr/local/bin

PROG=finddupe
OBJS=finddupe.o

usage:
	#####################################################
	#
	# Usage: make <option>
	# Where: <option> is one of the following:
	#        all     - make the binary in the current dir
	#        archive - make a .tar.gz of the current dir
	#        install - install the binary to $(INSTPATH)
	#        clean   - clean directory of object files
	#
	######################################################

install:	all
		mv $(PROG) $(INSTPATH)
		chown bin.bin $(INSTPATH)/$(PROG)
		chmod 555 $(INSTPATH)/$(PROG)
		ls -laF $(INSTPATH)/$(PROG)

all:	$(OBJS)
	$(CC) $(CFLAGS) -o $(PROG) $(OBJS)
	strip $(PROG)

archive:
	tar -cvvf - * | gzip -9v >finddupe.tar.gz

clean:
	rm -f *.o core debug.out a.out $(PROG)
