MOVIESMALL=/usr/local/jean-luc/movies-small MOVIEBIG=/usr/local/jean-luc/movies-big MAKE_ROOT=$(MOVIESMALL) SCRIPTS=$(MOVIESMALL) export MOVIESMALL export MOVIEBIG MOVIETAR=$(MOVIESMALL) MOVIEMPG=$(MOVIESMALL) MOVIEMOV=$(MOVIEBIG) #HERE:=$(shell /bin/pwd) HERE:=$(PWD) BIGMOV:=$(subst small,big,$(HERE)) SMLMOV:=$(subst big,small,$(HERE)) SECTION:=$(subst $(MOVIESMALL),,$(HERE)) DIRS:=$(filter %/,$(shell /bin/ls -dF *)) NIXDIRS:=$(filter %/,$(shell /bin/ls -dF *.bak sequence images Images bak *.bak jpg *.rgbdir 2> /dev/null)) SUBDIRS:=$(filter-out $(NIXDIRS),$(DIRS)) SUBMAKES=$(addsuffix Makefile, $(SUBDIRS)) SRC:=$(shell $(SCRIPTS)/src.sh) ifeq ($(SRC),) # No movie here. all: submakes html html: pure-html # No images to make here img: # No Movie includes to make here clean:: $(RM) *..inc inc: $(SCRIPTS)/movieinc.sh $(SCRIPTS)/movieinc.sh else all: submakes html clean:: @if [ -d ./$(SRC).rgbdir/ ]; then rm -r ./$(SRC).rgbdir/; fi img: $(SRC).jpg $(SRC).gif movies: $(SRC).mpg html img inc: $(SRC).inc $(SRC)..inc $(SRC)...inc $(SRC)....inc $(SRC).....inc clean:: $(RM) $(SRC).inc $(SRC)..inc $(SRC)...inc $(SRC)....inc $(SRC).....inc $(SRC).inc: $(SCRIPTS)/mov2inc.sh Makefile $(SRC).jpg $(SRC).gif $(SRC)*mpg $(SRC)*mov $(SRC).tar* $(SCRIPTS)/mov2inc.sh $(SRC)..inc $(SRC)...inc $(SRC)....inc $(SRC).....inc: # already done with .inc endif src: @echo Source is $(SRC) help:: @echo ' index.html Create an HTML Index file.' @echo ' html Create an HTML Index file recursively.' index.html: tablist movieshtml inc imageshtml Makefile $(SCRIPTS)/index.sh $(SCRIPTS)/index.sh > $@ html: html_all index.html credits.html # # Make propagation # submakes: $(SUBMAKES) $(SUBMAKES): ln -s ../Makefile $(@D)/ CMD=all help:: @echo ' inc Generated include files for this movie directory' @echo ' inc_all Generated movie include files for all subdirs' @echo ' rclean Recursively remove dynamically generated files' rclean: clean $(MAKE) recursive CMD=rclean inc_all: inc $(MAKE) recursive CMD=inc_all html_all: $(MAKE) recursive CMD=html recursive: $(SUBDIRS) $(SUBDIRS): $(MAKE) -C $@ ${CMD} help:: @echo ' subdirs List relevant subdirs' subdirs: @echo $(SUBDIRS) .PHONY: $(SUBDIRS) # # HTML Generation rules # pure-html: credits.html tablist index.html credits.html: echo '' >> $@ # Tablist Generation Rules tablist: tablist.html tablist..html tablist...html tablist....html tablist.....html tablist......html clean:: -$(RM) tablist.html tablist..html tablist...html tablist....html tablist.....html tablist......html vitablist: vi $(SCRIPTS)/tablist.sh tablist.html: $(MAKE_ROOT)/Makefile $(SCRIPTS)/tablist.sh $(SCRIPTS)/tablist.sh > tablist.html tablist..html: $(MAKE_ROOT)/Makefile $(SCRIPTS)/tablist.sh $(SCRIPTS)/tablist.sh ../ > tablist..html tablist...html: $(MAKE_ROOT)/Makefile $(SCRIPTS)/tablist.sh $(SCRIPTS)/tablist.sh ../../ > tablist...html tablist....html: $(MAKE_ROOT)/Makefile $(SCRIPTS)/tablist.sh $(SCRIPTS)/tablist.sh ../../../ > $@ tablist.....html: $(MAKE_ROOT)/Makefile $(SCRIPTS)/tablist.sh $(SCRIPTS)/tablist.sh ../../../../ > $@ tablist......html: $(MAKE_ROOT)/Makefile $(SCRIPTS)/tablist.sh $(SCRIPTS)/tablist.sh ../../../../../ > $@ help:: @echo ' movieshtml Create Movie Overview' clean:: -$(RM) movies.html movies..html movies...html movies....html movieshtml: movies.html movies..html movies...html movies....html movies.html: $(MAKE_ROOT)/Makefile $(SCRIPTS)/submovies.sh $(wildcard */*..inc) $(SCRIPTS)/submovies.sh > $@ movies..html: $(MAKE_ROOT)/Makefile $(SCRIPTS)/submovies.sh $(wildcard */*...inc) $(SCRIPTS)/submovies.sh . > $@ movies...html: $(MAKE_ROOT)/Makefile $(SCRIPTS)/submovies.sh $(wildcard */*....inc) $(SCRIPTS)/submovies.sh .. > $@ movies....html: $(MAKE_ROOT)/Makefile $(SCRIPTS)/submovies.sh $(wildcard */*.....inc) $(SCRIPTS)/submovies.sh ... > $@ ################################################## # imageshtml: images.html images..html images...html images....html images.html: $(MAKE_ROOT)/Makefile $(SCRIPTS)/subimages.sh $(wildcard */*..inc) $(SCRIPTS)/subimages.sh > $@ images..html: $(MAKE_ROOT)/Makefile $(SCRIPTS)/subimages.sh $(wildcard */*...inc) $(SCRIPTS)/subimages.sh . > $@ images...html: $(MAKE_ROOT)/Makefile $(SCRIPTS)/subimages.sh $(wildcard */*....inc) $(SCRIPTS)/subimages.sh .. > $@ images....html: $(MAKE_ROOT)/Makefile $(SCRIPTS)/subimages.sh $(wildcard */*.....inc) $(SCRIPTS)/subimages.sh ... > $@ # ################################################# # # Movie generation / conversion rules # jpeg.mov: $(SRC).jpeg.mov anim.mov: $(SRC).anim.mov $(SRC).jpeg.mov: /usr/sbin/dmconvert -f qt -p video,comp=jpeg $(SRC).rgbdir/$(SRC)####.rgb $@ $(SRC).anim.mov: /usr/sbin/dmconvert -f qt -p video,comp=qt_anim $(SRC).rgbdir/$(SRC)####.rgb $@ $(SRC).mpg: /usr/sbin/dmconvert -f mpeg1v $(SRC).rgbdir/$(SRC)####.rgb $@ $(SRC)*mpg $(SRC)*mov $(SRC).tar*: moviehtml: $(SRC).html $(SRC).gif $(SRC).jpg $(SRC).html: $(SRC).inc $(SRC).jpg Makefile $(MOVIESMALL)/mov2html.sh $< $@ $(SRC).gif: $(SRC).jpg convert -colors 16 -sample 50 $< $@ $(SRC).jpg: if [ ! -r $(SRC).rgbdir/*0000.rgb ]; then { echo Please do make rgbdir; exit 1; } fi convert $(SRC).rgbdir/*0000.rgb pnm:- | pnmscale -xscale 0.25 -yscale 0.25 | cjpeg -optimize -quality 75 > $@ # # rgbdir rule et al # rgbdir: $(SRC).rgbdir $(SRC).rgbdir: -mkdir $@ cd $@; gzcat ../$(SRC).tar.gz | tar xvf - frames: $(SRC).frames $(SRC).frames: zcat $(SRC).tar.gz | tar tvf - | wc -l > $@ xtar: $(SRC).rgbdir # # Rules for the BIG movie # bigmovie: $(BIGMOV) $(SRC).mov $(BIGMOV)/$(SRC).mov $(BIGMOV)/$(SRC).mov: -@mkdir -p $(BIGMOV) /usr/sbin/dmconvert -f qt -p video $(SRC).rgbdir/$(SRC)####.rgb $@ $(SRC).mov: $(BIGMOV)/$(SRC).mov ln -fs $< $@ $(BIGMOV): mkdir -p $@ # # Backconversion # rgbtar: rgbdir tar mk-rgbdir: -@mkdir $(SRC).rgbdir /usr/sbin/dmconvert -f rgb -p video $(SRC).mov $(SRC).rgbdir/$(SRC)####.rgb cd $(SRC).rgbdir; $(MOVIESMALL)/rgb2rgb tar: cd $(SRC).rgbdir; tar cvf ../$(SRC).tar *.rgb gzip -9 $(SRC).tar touch $(SRC).rgbdir # # Images # images: Images/* Images/*/* $(SCRIPTS)/images.sh Images/.htaccess $(SCRIPTS)/images.sh images/images.html: $(SCRIPTS)/images.sh viimages: vi $(SCRIPTS)/images.sh Images/.htaccess: ln -fs /usr/local/jean-luc/Movies/HTACCESS $@ # # Local images # Images.html: -mkdir .icons echo > $@ for f in *.tif; \ do \ echo $$f ; \ convert $$f $${f%tif}jpg ; \ convert -size 100x100 $$f .icons/$${f%tif}jpg ; \ echo "" >> $@ ; \ done