# $Id: Makefile.in,v 1.4 2002/01/14 10:45:50 bubuchka Exp $

DESTDIR =

SUBDIRS = ./src ./man
prefix = @prefix@
DOCDIR = $(DESTDIR)@datadir@/doc/cdbkup
SNARDIR = $(DESTDIR)@SNARDIR@
DUMPER = @DUMPER@
DUMPGRP = @DUMPGRP@
INSTALL = @INSTALL@
RM = rm -f

all:

install:
	@for x in $(SUBDIRS); \
	do \
		(echo "-> Entering $$x"; cd $$x ;\
		make $@ );\
	done
	@echo "-> Creating dirs & installing misc documentation."
	$(INSTALL) -d -o $(DUMPER) -g $(DUMPGRP) -m 700 $(SNARDIR)
	$(INSTALL) -d -m 755 $(DOCDIR)
	$(INSTALL) -m 644 README $(DOCDIR)
	$(INSTALL) -m 644 TODO $(DOCDIR)
	$(INSTALL) -m 644 COMPLIANCE $(DOCDIR)
	@echo "-> All done."

uninstall:
	@for x in $(SUBDIRS); \
	do \
		(echo "-> Entering $$x"; cd $$x ;\
		make $@ );\
	done
	@echo "-> Removing others."
	$(RM) $(DOCDIR)/README 
	$(RM) $(DOCDIR)/TODO 
	$(RM) $(DOCDIR)/COMPLIANCE 
	-rmdir $(DOCDIR)
	-rmdir $(SNARDIR)
	@echo "-> All done."

clean:
	@for x in $(SUBDIRS); \
	do \
		(echo "-> Entering $$x"; cd $$x ;\
		make $@ );\
	done
	@echo "Cleaning in `pwd`..."
	$(RM) config.*
	$(RM) Makefile
	@echo "-> All done."

