Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > media > main > by-pkgid > 6c1629ca18f6adf273e73d0f5069fa8c > files > 493

Borges-doc-0.7.12-1mdk.noarch.rpm


#---------------------------------------------------------------
# Project         : Mandrake Linux
# Module          : Borges
# File            : Makefile
# Author          : Camille Bégnis
# Created On      : Tue Nov 27 2001 16:25:21 2001
# Copyright       : Camille Bégnis camille@mandrakesoft.com,
#                    MandrakeSoft under the GPL license
#---------------------------------------------------------------

include ../Makefile.include

XSLSUMMARY=$(DISTDIR)XSL/report_summary.xsl
XSLMAILS=$(DISTDIR)XSL/report2mail.xsl
CONF=conf/repository.xml

reports=$(addsuffix /master-report.html,$(MANUALS))

mail_header="Hi,\n\nI am R2D2, and these are the tasks I have found assigned to you for manuals:\n\n"

mail_footer="\n\nDo not forget to update the revisions in each module file so that this report is always up-to date.\n\nThanks, R2D2."

allmodules=$(strip $(shell find $(ROOTDIR)/$(MODULESDIR)/ -name '*.xml' ! \( -name '*.html.xml' -o -name '*changes.xml' -o -name '*.db.xml' -o -name '*id.xml' -o -name '*ids.xml' \) ))

# this target compiles all manuals in PDF and HTML in all languages
# plus the report.
# all is then stored in reports/
# then reports/ is suited for Web publication
all: index.html allguidelines

allguidelines:
	-for m in $(MANUALS); do \
		make -C $(ROOTDIR)/$(MANUALSDIR)/$$m/ master.top.{pdf,flat.html}; \
		mkdir -p $$m/; \
		mv $(ROOTDIR)/$(MANUALSDIR)/$$m/{master.top.{pdf,flat.html},images} $$m/; \
	done

%/master-report.html: $(allmodules) ../$(MANUALSDIR)/%/master.top.xml
	@make -rC ../$(MANUALSDIR)/$*/ master-report.html
	@rm -rf $*
	@mkdir -p $*
	@cp -a ../$(MANUALSDIR)/$*/master-report.html $*
	@[ -e ../$(MANUALSDIR)/$*/reports ] && cp -a ../$(MANUALSDIR)/$*/reports $*

index.html: $(reports) $(XSLSUMMARY)
	$(XSLT) --param manualdir '"$(ROOTDIR)/$(MANUALSDIR)"' \
		-o $@.tmp $(XSLSUMMARY) $(ROOTDIR)/$(CONF)
# Some timezones as set in Linux are not recognized by Date::Manip
# That's why I force it to GMT
	TZ=GMT ETA.pl $@.tmp > $@
	rm -f $@.tmp

mails: $(reports)
	@echo "Preparing mails..."
	@rm -f *@*
ifneq ($(strip $(MANUALS)),)
	@for t in $(MANUALS); do \
		$(XSLT) --stringparam master $(ROOTDIR)/$(MANUALSDIR)/$$t/$(TOP) \
			$(XSLMAILS) $$t/master-report.html; \
		for m in $$(ls *@*.tasks); do \
			[ -e $$m ] && cat $$m >> $$m.mail; \
			rm -f $$m; \
		done; \
	done
ifneq ($(strip $(shell echo *@*.mail)),)
	@for m in $$(ls *@*.mail); do \
		f=`basename $$m .tasks.mail`; \
		echo "Preparing mail for $$f"; \
		printf $(mail_header) > $$f; \
		cat $$m | sort -u >> $$f; \
		printf $(mail_footer) >> $$f; \
		rm -f $$m; \
		[ -e ../conf/mailfooter.txt ] && \
			cat ../conf/mailfooter.txt >> $$f; \
	done
endif
endif

%/costs.html: $(allmodules) $(ROOTDIR)/$(MANUALSDIR)/%/master.top.xml
	make -rC $(ROOTDIR)/$(MANUALSDIR)/$*/ $(@F); \
	mkdir -p $*; \
	cp -f $(ROOTDIR)/$(MANUALSDIR)/$*/$(@F) $*; \

accounting.html: $(foreach man,$(MANUALS),$(man)/costs.html) $(ROOTDIR)/conf/repository.xml
	costs.pl $(ROOTDIR)/conf/repository.xml costs.html > $@

clean:
	rm -rf $(MANUALS) $(shell cat .cvsignore) images