include ${SEPINC}/SEP.top
include ${SEPINC}/sepweb.top

IMG_SCRIPT_PATH = /net/sepwww/sepwww/pub/sep/morgan/
# Some global updating commands

IMG_DIR_LIST    = 

CONFIG      = /net/sepwww/sepwww/pub/sep/valencia/webify.config
BASE_PATH   = /net/sepwww/sepwww/pub/sep/valencia/Personal/Isabel/
BASE_LINK   = http://sepwww.stanford.edu/sep/valencia/Personal/Isabel/
THIS_DIR    = Video 
TOP_DIR     = Isabel 
SUB_PATH    = Video/
DIR_TITLE   = Video 
NO_INCLUDE  = . ..
HTML_FILES  = $(patsubst %.txt,%.html, $(wildcard *.txt))
TXT_FILES   = $(wildcard *.txt)

DIR_LIST    = 

define GlobalMake
	@for dir in $(IMG_DIR_LIST) ${DUMMY}; do( cd $$dir; $(MAKE) $@) done
endef

global-make:
	${MAKE} all
	${GlobalMake}

define GlobalImgMake
	@for dir in $(IMG_DIR_LIST) ${DUMMY}; do( cd $$dir; $(MAKE) $@) done
endef

global-image-make:
	${MAKE} imagegal
	${GlobalImgMake}

imagegal:
	${IMG_SCRIPT_PATH}img_gal.pl thisdir=${THIS_DIR} maketitle=1 zoom=0

#	Some global updating commands


define GlobalWebify
	@for dir in $(DIR_LIST) ${DUMMY}; do( cd $$dir; $(MAKE) $@) done
endef

global-webify:
	touch ${TXT_FILES}
	${MAKE} webify
	echo "This dir: ${SUB_PATH}"
	${GlobalWebify}

${THIS_DIR}.layout: ${TXT_FILES}
	${SCRIPT_PATH}make_layout.pl dir=${BASE_PATH}${SUB_PATH} noinclude="${NO_INCLUDE}" \
	title="${DIR_TITLE}" dirlist="${DIR_LIST}"

webify: ${HTML_FILES}
	echo ${TXT_FILES}

%.html:	%.txt ${THIS_DIR}.layout
ifneq (${THIS_DIR}, ${TOP_DIR}) 
	cd ../; gmake webify
endif
	${SCRIPT_PATH}text2sepweb.pl title="${DIR_TITLE}" infile=$*.txt config=${CONFIG} dir=${BASE_PATH}${SUB_PATH} \
	top=${TOP_DIR} baselink=${BASE_LINK}

include ${SEPINC}/SEP.bottom
