SHELL           = /bin/sh
PROJECT		= PgBgl
ROOT		= .
LIBRARY_DIR	= $(ROOT)/PgBgLib
EXAMPLE_DIR	= $(ROOT)/PgresExample
DISTRIB		= $(PROJECT).tar
PRCS		= prcs
COMPRESS	= gzip

all:
	(cd $(LIBRARY_DIR) ; $(MAKE) lib)
	(cd $(EXAMPLE_DIR) ; $(MAKE) all)

lib:
	(cd $(LIBRARY_DIR) ; $(MAKE) lib)

tar:	cleanall
	(cd ../ ; tar cf $(DISTRIB) $(PROJECT) )

tar.gz:	tar
	(cd ../ ; $(COMPRESS) $(DISTRIB))

populate:
	$(MAKE) cleanall
	$(PRCS) populate $(PROJECT) $(LIBRARY_DIR) $(EXAMPLE_DIR)

checkout:
	$(PRCS) checkout $(PROJECT)

checkin:
	$(PRCS) checkin $(PROJECT)

clean:
	rm -f *~ $(DISTRIB)
	(cd $(LIBRARY_DIR) ; $(MAKE) clean)
	(cd $(EXAMPLE_DIR) ; $(MAKE) clean)

cleanall:
	rm -f *~ $(DISTRIB) $(DISTRIB).gz
	(cd $(LIBRARY_DIR) ; $(MAKE) cleanall)
	(cd $(EXAMPLE_DIR) ; $(MAKE) cleanall)

libinstall:
	(cd $(LIBRARY_DIR) ; $(MAKE) install)

exinstall:
	(cd $(EXAMPLE_DIR) ; $(MAKE) install)

install: libinstall
