#
# Makefile for contents in www
# $Id: Makefile,v 1.22 2008/10/05 11:13:22 mdk Exp $
#

include ../JF.conf

ifndef WORKDIR
WORKDIR         = /var/tmp/JF
endif

ADMDIR=../admin
VPATH=../:bin:../bin:../lists

.SUFFIXES: .html .xml .m4

CONTENTS = links.html index.html news.html copyright.html \
	WhatisJF.html jf-ml.html jf-gofer-ml.html old-news.html \
	notfound.html updated-docs.html onegai.html update.xml

.m4.html:
	nkf -e $*.m4 > /tmp/$*.m4
	m4 -P -D _WORKDIR=$(WORKDIR) /tmp/$*.m4 | nkf -w > $*.html
	rm -f /tmp/$*.m4

.m4.xml:
	$(NKF) -e $*.m4 > /tmp/$*.m4
	m4 -P -D _WORKDIR=$(WORKDIR) /tmp/$*.m4 | $(NKF) -w > $*.xml
	rm -f /tmp/$*.m4

all: contents
	cd workshop; make
	cd announcement; make

contents: $(CONTENTS)

*.html: jf_www.m4

index.html: jfindex.db categ_num.pl news.m4

updated-docs.html: jfindex.db news.m4

copyright.html: jfindex.db mknocomlist.pl

update.xml: jfindex.db news.m4 jf_www.m4

install: all
	mkdir -p $(WWW_ROOT)
	rsync -av \
	--exclude='bin' \
	--exclude='*.m4' \
	--exclude='Makefile' \
	--exclude='ChangeLog' \
	* .htaccess $(WWW_ROOT)

clean:
	cd workshop; make clean
	cd announcement; make clean
	for page in $(CONTENTS); do \
	  m4src=`basename $$page .html`.m4;\
          if test -f $$m4src; then $(RM) $$page;fi;\
        done
	$(RM) update.xml
# EOF
