CC=gcc
OPT=
OPT=-DAIX 
LDOPT=

all:
	gcc $(OPT) -c -o chain.o chain.c
	gcc $(OPT) -c -o inifile.o inifile.c
	gcc $(OPT) -c -o filedb.o filedb.c
	gcc $(OPT) -o watchd watchd.c inifile.o chain.o filedb.o

debug:
	gcc $(OPT) -g -c -o inifile.o inifile.c
	gcc $(OPT) -g -c -o chain.o chain.c
	gcc $(OPT) -DDEBUG -g -c -o filedb.o filedb.c
	gcc $(LDOPT) -g -DDEBUG -DAIX -o watchd watchd.c inifile.o chain.o filedb.o 


install: all
	cp watchd $(PREFIX)/usr/local/bin 
	chmod a+x ./installconf.sh
	./installconf.sh watchd.conf /etc/watchd.conf

doc: doc/watchfolder.dvi
	cd doc
	latex watchfolder.tex
	dvips watchfolder.dvi

clean:
	rm -f *.o watchd depp
		
