# just use the default Makefile rules
#
# how do I communicate SEPINC?
# how do I ensure that PREFIX is set correctly when installed?
# modules and configure combination? 

www    = /sepwww/pub/redoc
cdrom  = /usr/local/cdrom/assembly/src/make
nomad  = /nomad/usr/local/src/make
gnu    = /usr/local/src/gnu

sepfiles = Adm Doc* Prg* SEP* README Make* docs
cipfiles = Cip Rules Frog README
www : 
	${MAKE} target=${www} copy
	# get index.html, sep.ps, cip.ps, sep.txt
	cd ${www}/docs/Sephelp; ${MAKE} sep.ps; mv sep.ps ${www}; ${MAKE} clean
	cd ${www}/docs/Cip;     ${MAKE} cip.ps; mv cip.ps ${www}; ${MAKE} clean
	cd ${www}/docs; cp Cip/cip.html   ${www}
	cd ${www}/docs; cp index.html     ${www}
	cd ${www}/docs; cp meeting.html   ${www}
	cd ${www}/docs; cp blurb.html     ${www}
	cd ${www}/docs; cp cake.ps        ${www}
	cd ${www}/docs; cp seg92.html     ${www}
	cd ${www}/docs; cp cdvswww.html   ${www}
	cd ${www}/docs; cp Cip/Fig/* 	  ${www}
	# bundle seprules.tar
	cd ${www}; tar -cvf seprules.tar ${sepfiles} 
	cd ${www}; gzip -c  seprules.tar > seprules.tar.gz
	cd ${www}; compress seprules.tar
	# bundle cip.tar
	cd ${www}/docs; tar -cvf cip.tar ${cipfiles} 
	cd ${www}/docs; gzip -c  cip.tar > cip.tar.gz ; mv cip.tar.gz ${www}
	cd ${www}/docs; compress cip.tar              ; mv cip.tar.Z  ${www}
	# clean www site
	cd ${www}; /bin/rm -rf ${sepfiles} 
	# bundle and copy gnu make
	cd ${gnu}/make-3.74; ${MAKE} -i distclean; 
	cd ${gnu}; tar -cvf make-3.74.tar ./make-3.74
	cd ${gnu}; mv make-3.74.tar gmake.tar
	cd ${gnu}; gzip -c  gmake.tar > gmake.gz; mv ${gnu}/gmake.tar.gz ${www}
	cd ${gnu}; compress gmake.tar           ; mv ${gnu}/gmake.tar.Z  ${www}

cdrom: 
	${MAKE} export=cdrom copy
	# change SEP.defs.top variable definitions (CDROM 3 platforms)
	/bin/rm      ${target}/SEP.defs.top 
	./copy.cdrom target=${www} < ../SEP.defs.top > ${target}/SEP.defs.top 

nomad: 
	${MAKE} target=${nomad} copy

copy:
	# clean it all up
	# check if   ${target} exists
	/bin/rm -rf  ${target}/*
	# copy what necessary
	cp -r ../*   ${target}
	cd ${target}; /bin/rm -rf RCS AVS.* docs/Notes

clean: 
	cd ../docs/Cip    ; ${MAKE} clean
	cd ../docs/Sephelp; ${MAKE} clean