#
# makefile for copying all of the help docs into this folder for 
# inclusion into the externals packages
#

DOC_DIR = .

all:
# add write perms to allow rewriting over all files
	chmod -R u+w $(DOC_DIR)
#----------------------------------------------------------------------------
# all standard objs' help files
	install -p -m0644 \
			 ../../OSCx/doc/*.pd \
			../../control/*/*.pd \
			../../signal/*/*.pd \
			../../aenv~/*.pd \
			../../arraysize/*.pd \
			../../beatpipe/*.pd \
			../../build/*.pd \
			../../bbogart/chaos/tools/*.pd \
			../../bbogart/*/*.pd \
			../../creb/doc/*.pd \
			../../creb/doc/examples/*.pd \
			../../cxc/reference/*.pd \
			../../dfx/*/*.pd \
			../../ext13/doc/*.pd \
			../../ggee/*/*.pd \
			../../gem2pdp/*.pd \
			../../ff/*.pd \
			../../hcs/*-help.pd \
			../../hcs/*/doc/*.pd \
			../../hcs/hid/examples/*.pd \
			../../hcs/pan/*-help.pd \
			../../iem/comport/*/*-help.pd \
			../../markex/*.pd \
			../../maxlib/help/*.* \
			../../mjlib/doc/*.pd \
			../../motex/*.pd \
			../../nusmuk/line3/*.pd\
			../../pdogg/*/*.pd \
			../../plugin~/*.pd \
			../../pmpd/help/*.pd\
			../../rhythm_estimator/*.p? \
			../../susloop~/*.pd \
			../../svf~/*.pd \
			../../vbap/*.pd \
			../../vst/*.pd \
			../../zhzxh~/*.pd \
			$(DOC_DIR)
#----------------------------------------------------------------------------
# [sprinkler]'s help file is generated by ./configure
	cd ../../sprinkler && autoconf && ./configure
	cp -p ../../sprinkler/sprinkler-help.pd $(DOC_DIR)
#----------------------------------------------------------------------------
# IEMlib uses its own dir and since its not maintained in CVS
# its best not to change the objects
	install -d -m0755 $(DOC_DIR)/iemhelp
	install -p -m0644 ../../iemlib/iemhelp/*.* $(DOC_DIR)/iemhelp
#----------------------------------------------------------------------------
# PMDP examples
	install -d -m0755  $(DOC_DIR)/pmpd
# pmpd exemples files has to go in an other directory
	install -p -m0644 ../../pmpd/exemples/*.pd $(DOC_DIR)/pmpd
# pmpd documentation
	cp -Rp ../../pmpd/doc $(DOC_DIR)/pmpd/doc
#----------------------------------------------------------------------------
# zexy uses its own dir
	install -d -m0755 $(DOC_DIR)/zexy
	install -p -m0644 ../../zexy/zexy.pd  $(DOC_DIR)
	install -p -m0644 ../../zexy/examples/*.* $(DOC_DIR)/zexy


#----------------------------------------------------------------------------
# remove help files for objects that are not included due to conflicts, etc.
#
#  mjlib [prob] conflicts with cyclone's [prob]
	rm prob-help.pd
#  maxlib conflicts with cyclone
	rm help-split.pd


#----------------------------------------------------------------------------
# this is mildly dangerous, since it just deletes everything
clean:
	rm -f *.pd *.ps *.txt test.som *~
	rm -Rf iemhelp zexy pmpd