#------- You should not change ANYTHING in this file ----------------
#------- All customizable options are in the file ../SETTINGS -------
#------- CAUTION: any change in this directory should be also made in the 

include ../SETTINGS
include ../SHARED


EXAMPLESDIR = $(REALLIBDIR)/examples
ALLFILES = *

phony:

install:
	@echo "*** ---------------------------------------------------------"
	@echo "*** Installing $(BASEMAIN) examples..."
	@echo "*** (in $(DESTDIR)$(EXAMPLESDIR))"
	@echo "*** ---------------------------------------------------------"
	mkdir -p $(DESTDIR)$(EXAMPLESDIR)
	-chmod $(EXECMODE) $(DESTDIR)$(EXAMPLESDIR)
	-cp -pR $(ALLFILES) $(DESTDIR)$(EXAMPLESDIR)
	-@(cd $(DESTDIR)$(EXAMPLESDIR) && find . -type d -exec chmod $(EXECMODE) {} \; )
	-@(cd $(DESTDIR)$(EXAMPLESDIR) && find . ! -type d -exec chmod $(DATAMODE) {} \; )
	-@(cd $(DESTDIR)$(EXAMPLESDIR) && find . -name '*~' -exec 'rm' -f {} \; )
	-@(cd $(DESTDIR)$(EXAMPLESDIR) && find . -name '*.po' -exec 'rm' -f {} \; )
	-@(cd $(DESTDIR)$(EXAMPLESDIR) && find . -name '*.itf' -exec 'rm' -f {} \; )

uninstall:
	@echo "*** ---------------------------------------------------------"
	@echo "*** Uninstalling $(BASEMAIN) examples..."
	@echo "*** (in $(DESTDIR)$(EXAMPLESDIR))"
	@echo "*** ---------------------------------------------------------"
	-rm -r $(DESTDIR)$(EXAMPLESDIR)

realclean: distclean
	/bin/rm -rf hw hw.cpx
	cd misc && $(MAKE) realclean
	cd agenda && $(MAKE) realclean

distclean clean:
	@echo "*** ---------------------------------------------------------"
	@echo "*** Cleaning up directory."
	@echo "*** ---------------------------------------------------------"
	/bin/rm -rf *.itf *.dep *.po 
	/bin/rm -rf *~
	cd misc && $(MAKE) distclean
	cd agenda && $(MAKE) realclean
