CC=gcc
CFLAGS=-O -Wall

BINDIR=/usr/local/bin

entrypt:
	@echo "Make what? Decide:"
	@echo "make holecp - makes the program in this dir"
	@echo "make clean  - removes stale .o files but leaves program"
	@echo "make purge  - removes .o and program"
	@echo "make install - makes and installs to " $(BINDIR)
	@echo "    (not needed for SARdisk)"
	exit 1

holecp: holecp.o copyfiles.o error.o getprogname.o usage.o message.o \
		file2file.o parseargs.o
	$(CC) -o holecp holecp.o copyfiles.o error.o getprogname.o usage.o \
		message.o file2file.o parseargs.o

clean:
	rm -f *.o

purge:
	rm -f *.o holecp

install: holecp
	install holecp $(BINDIR)

holecp.o: holecp.c holecp.h
copyfiles.o: copyfiles.c holecp.h
error.o: error.c holecp.h
file2file.o: file2file.c holecp.h
getprogname.o: getprogname.c holecp.h
message.o: message.c holecp.h
parseargs.o: parseargs.c holecp.h
usage.o: usage.c holecp.h
