#
# 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 notfound.html \
         basic.html external.html classics.html cbasic.html \
         ctutorial.html colorspace.html colorfits.html \
         itone.html guide.html faq.html vobs.html history.html \
         modules.html credits.html pererr.html lctut.html kombitut.html \
         phcorrtut.html colorimage.html colorcal.html colcal.html cmd.html chart.html \
         man_intro.html man_help.html man_coloring.html man_ctrafo.html \
         man_bias.html man_dark.html man_flat.html man_phcorr.html \
         man_cone.html man_astrometry.html man_phcal.html man_aphot.html \
         man_list.html man_fitsut.html man_votable.html man_com.html \
         man_env.html man_kombine.html man_timeseries.html \
         dataform_tmseries.html dataform_photometry.html dataform_astrometry.html \
         dataform_photosys.html dataform_phfotran.html dataform_proc.html mosaics.html \
         phcalibration.html phoverview.html astoverview.html deka154.html \
         man_find.html man_frameconv.html man_phfotran.html man_cross.html \
         fwhm.html changelog.html debbuilder.html rpmbuilder.html install.html \
         version.html SourceInstallation.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 $< > $@
