#
# process #include directores in .shtml files
# in fashion of Apache's SSI includes
#
# the tags: <!-- #include virtual="*" --> are replaced by content of a file
# 

.SUFFIXES: .shtml .html

TARGETS= munipack.html features.html download.html docs.html \
         basic.html external.html classics.html cbasic.html \
         ctutorial.html colorspace.html colorfits.html \
         itone.html guide.html faq.html fitsut.html vobs.html \
         astrometry.html astrometry_guide.html history.html \
         modules.html credits.html pererr.html lctut.html kombitut.html \
         corrtut.html colorimage.html colorcal.html cmd.html chart.html \
         man_intro.html man_help.html man_mdark.html man_mflat.html \
         man_dark.html man_flat.html man_coloring.html man_ctrafo.html \
         man_cone.html man_astrometry.html man_photometry.html \
         man_list.html man_fitsut.html man_votable.html man_com.html \
         man_env.html man_kombine.html

#TARGETS=$(patsubst %.shtml,%.html,$(wildcard *.html))

all: $(TARGETS)

install: all
	ln -sf munipack.html index.html

.ONESHELL:
mini:
	for A in Screenshot-*.png; do \
           convert $${A} -resize 300x200 $${A%.png}-mini.png; \
        done
	convert big_logo.png -resize 100x100 title_logo.png

feed:
	python munipack-atom.py > news_feed.xml

clean:
	rm -f $(TARGETS); rm -f *~; rm -f Screenshot-*-mini.png; \
        rm -f title_logo.png; \
        rm -f index.html

.shtml.html:
	awk -f include.awk $< >$@
