CPPFLAGS=-DUNIX
CXXFLAGS=-Wall -O2
#
# The following two macros must be set to the root location of the location
# to install into, and the location to copy the documentation to.
#
INSTALLDIR=/usr/local
DOCDIR=/usr/doc


all: filesync install clean

filesync: filesync.o
	${CC} ${CPPFLAGS} -o $@ $<

.PHONY: clean

clean:
	rm -f filesync.o; \
	rm -f filesync;

install: filesync
	if [ ! -d ${INSTALLDIR}/man/man1 ]; then \
	   mkdir ${INSTALLDIR}/man/man1; \
	fi
	if [ ! -d ${INSTALLDIR}/bin ]; then \
	   mkdir ${INSTALLDIR}/bin; \
	fi 
	if [ ! -d ${DOCDIR}/filesync-0.1 ]; then \
	   mkdir ${DOCDIR}/filesync-0.1; \
	fi
	cp -p $<.1 ${INSTALLDIR}/man/man1; \
	cp -p $< ${INSTALLDIR}/bin; \
	cp -p COPYING ${DOCDIR}/filesync-0.1;
