# # module : # generation of documentations from XML files (and some IDL files) in HTML and # wiki forms # # original location : # /Users/fplod/SAXO_DIR_ws/SRC/Documentation/xmldoc/makefile sur aedon.locean-ipsl.upmc.fr # # update : # $Id$ # fplod 2008-04-16T10:06:39Z aedon.locean-ipsl.upmc.fr (Darwin) # working on wiki production using # http://xmlstar.sourceforge.net/doc/UG/xmlstarlet-ug.html # fplod 2008-04-15T15:37:59Z aedon.locean-ipsl.upmc.fr (Darwin) # java is not ok now : # http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl; Ligne #53; Colonne #35; XSLT Error (javax.xml.transform.TransformerConfigurationException): javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: Had IO Exception with stylesheet file: keywords.xsl # replaced by xsltproc which is now ok for callouts # fplod 2008-04-15T08:10:09Z aedon.locean-ipsl.upmc.fr (Darwin) # add xml validation using xmlstarlet # fplod 2007-06-27T10:07:59Z aedon.locean-ipsl.upmc.fr (Darwin) # creation in order to replace makehtml.sh # PRODUCT = \ saxo DIRBASE = \ ./ DIRSRC = \ $(DIRBASE) DIRTMP = \ ./ DIRWWW = \ ./ DIRWIKI = \ ./wiki/ .PHONY : \ all \ clean \ dbkcheck \ help \ html \ tracwiki help : @echo "\$$ make clean" @echo "\$$ make all" @echo "\$$ make dbkcheck" @echo "++ check link" @echo "++ depot html et wiki" clean : -@rm -f $(DIRTMP)/*_full.xml -@rm -f $(DIRTMP)/err_xmlstarlet_xsd -@rm -f $(DIRTMP)/rowscm.xml -@rm -f $(DIRTMP)/rowskwd.xml -@rm -f $(DIRTMP)/titlepage.saxo.xsl -@rm -f $(DIRTMP)/all_plots.xml -@rm -f $(DIRTMP)/getsaxo_sed.xml -@rm -f $(DIRTMP)/firststeps_sed.xml dbkcheck : @-rm $(DIRTMP)/err_xmlstarlet_xsd 2> /dev/null @for file in $(DIRTMP)/*_full.xml $(DIRTMP)/all_plots.xml; do \ xml val --err \ --xsd http://www.docbook.org/xml/5.0/xsd/docbook.xsd \ $${file} 1>> $(DIRTMP)/err_xmlstarlet_xsd 2>&1; done @echo "check for valid diag for each file in $(DIRTMP)/err_xmlstarlet_xsd" all : \ html \ tracwiki html : \ $(DIRWWW)/getsaxo.html \ $(DIRWWW)/websaxo.html \ $(DIRWWW)/whatsnew.html \ $(DIRWWW)/updatesaxo.html \ $(DIRWWW)/whatissaxo.html \ $(DIRWWW)/faqsaxo.html \ $(DIRWWW)/infoupdatekwd.html \ $(DIRWWW)/infoupdatecm.html \ $(DIRWWW)/mailing.html \ $(DIRWWW)/tiplink.html \ $(DIRWWW)/mini_notice.html \ $(DIRWWW)/firststeps.html \ $(DIRWWW)/all_plots.html tracwiki : \ $(DIRWIKI)/AllPlots \ $(DIRWIKI)/GetSaxo \ $(DIRWIKI)/WikiStart \ $(DIRWIKI)/FaqSaxo \ $(DIRWIKI)/FirstSteps \ $(DIRWIKI)/InfoUpdateKwd \ $(DIRWIKI)/InfoUpdateCm \ $(DIRWIKI)/Mailing \ $(DIRWIKI)/MiniNotice \ $(DIRWIKI)/TipLink \ $(DIRWIKI)/WhatisSaxo \ $(DIRWIKI)/UpdateSaxo \ $(DIRWIKI)/WhatsNew @echo "Do not forget to import wiki pages" @echo "\$$ ssh $(PRODUCT)@forge.ipsl.jussieu.fr mkdir -p /tmp/$(PRODUCT)/" @echo "\$$ rsync -av --exclude=".DS_Store" --exclude=".svn" $(DIRWIKI) $(PRODUCT)@forge.ipsl.jussieu.fr:/tmp/$(PRODUCT)/" @echo "\$$ ssh $(PRODUCT)@forge.ipsl.jussieu.fr trac-admin /ipsl/forge/projets/$(PRODUCT)/trac wiki load /tmp/$(PRODUCT)/" @echo "\$$ ssh $(PRODUCT)@forge.ipsl.jussieu.fr rmdir -f /tmp/$(PRODUCT)/" $(DIRWIKI)/WikiStart : \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/websaxo_full.xml @xsltproc \ --output ginette \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/websaxo_full.xml @xsltproc \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/websaxo_full.xml | \ awk 'sub(/ @star@ $$/,""){printf(" * %s", $$0);next};1' | \ sed -e "s+@star@+ *+" \ > $@ $(DIRWWW)/websaxo.html : \ $(DIRTMP)/websaxo_full.xml \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/titlepage.saxo.xsl \ $(DIRSRC)/style.css \ $(DIRSRC)/$(PRODUCT).css @xsltproc \ --param html.stylesheet "'style.css $(PRODUCT).css'" \ --param css.decoration 1 \ --param link.mailto.url "'mailto:saxo-dev_at_forge.ipsl.jussieu.fr'" \ --param section.autolabel 1 \ --output $@ \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/websaxo_full.xml $(DIRTMP)/websaxo_full.xml : \ $(DIRSRC)/websaxo.xml @xmllint \ --xinclude \ --encode utf-8 \ --noent \ --output $@ \ $(DIRSRC)/websaxo.xml $(DIRWIKI)/FaqSaxo : \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/faqsaxo_full.xml @xsltproc \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/faqsaxo_full.xml | \ awk 'sub(/ @star@ $$/,""){printf(" * %s", $$0);next};1' | \ sed -e "s+@star@+*+" \ > $@ $(DIRWWW)/faqsaxo.html : \ $(DIRTMP)/faqsaxo_full.xml \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/titlepage.saxo.xsl \ $(DIRSRC)/style.css \ $(DIRSRC)/$(PRODUCT).css @xsltproc \ --param html.stylesheet "'style.css $(PRODUCT).css'" \ --param css.decoration 1 \ --param link.mailto.url "'mailto:saxo-dev_at_forge.ipsl.jussieu.fr'" \ --param section.autolabel 1 \ --output $@ \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/faqsaxo_full.xml $(DIRTMP)/faqsaxo_full.xml : \ $(DIRSRC)/faqsaxo.xml @xmllint \ --xinclude \ --encode utf-8 \ --noent \ --output $@ \ $(DIRSRC)/faqsaxo.xml $(DIRWIKI)/GetSaxo : \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/getsaxo_full.xml @xsltproc \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/getsaxo_full.xml | \ awk 'sub(/ @star@ $$/,""){printf(" * %s", $$0);next};1' | \ sed -e "s+@star@+*+" \ > $@ $(DIRWWW)/getsaxo.html : \ $(DIRTMP)/getsaxo_full.xml \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/titlepage.saxo.xsl \ $(DIRSRC)/style.css \ $(DIRSRC)/$(PRODUCT).css @xsltproc \ --param html.stylesheet "'style.css $(PRODUCT).css'" \ --param css.decoration 1 \ --param link.mailto.url "'mailto:saxo-dev_at_forge.ipsl.jussieu.fr'" \ --param section.autolabel 1 \ --output $@ \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/getsaxo_full.xml $(DIRTMP)/getsaxo_full.xml : \ $(DIRSRC)/getsaxo.xml \ $(DIRSRC)/getsaxo_pre.sh @$(DIRSRC)/getsaxo_pre.sh @xmllint \ --xinclude \ --encode utf-8 \ --noent \ --output $@ \ $(DIRTMP)/getsaxo_sed.xml $(DIRWIKI)/FirstSteps : \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/firststeps_full.xml @xsltproc \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/firststeps_full.xml | \ awk 'sub(/ @star@ $$/,""){printf(" * %s", $$0);next};1' | \ sed -e "s+@star@+*+" \ > $@ $(DIRWWW)/firststeps.html : \ $(DIRTMP)/firststeps_full.xml \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/titlepage.saxo.xsl \ $(DIRSRC)/style.css \ $(DIRSRC)/$(PRODUCT).css @xsltproc \ --param html.stylesheet "'style.css $(PRODUCT).css'" \ --param css.decoration 1 \ --param link.mailto.url "'mailto:saxo-dev_at_forge.ipsl.jussieu.fr'" \ --param section.autolabel 1 \ --output $@ \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/firststeps_full.xml $(DIRWIKI)/AllPlots : \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/all_plots.xml @xsltproc \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/all_plots.xml | \ awk 'sub(/ @star@ $$/,""){printf(" * %s", $$0);next};1' | \ sed -e "s+@star@+*+" \ > $@ $(DIRWWW)/all_plots.html : \ $(DIRTMP)/all_plots.xml \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/titlepage.saxo.xsl \ $(DIRSRC)/style.css \ $(DIRSRC)/$(PRODUCT).css @xsltproc \ --param html.stylesheet "'style.css $(PRODUCT).css'" \ --param css.decoration 1 \ --param link.mailto.url "'mailto:saxo-dev_at_forge.ipsl.jussieu.fr'" \ --param section.autolabel 1 \ --output $@ \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/all_plots.xml $(DIRTMP)/all_plots.xml : \ $(DIRSRC)/all_plots_docbook.xsl \ $(DIRTMP)/firststeps_full.xml @xsltproc \ --output $@ \ $(DIRSRC)/all_plots_docbook.xsl \ $(DIRTMP)/firststeps_full.xml $(DIRTMP)/firststeps_full.xml : \ $(DIRSRC)/firststeps.xml \ $(DIRSRC)/firststeps_pre.sh @$(DIRSRC)/firststeps_pre.sh @xmllint \ --xinclude \ --encode utf-8 \ --noent \ --output $@ \ $(DIRTMP)/firststeps_sed.xml $(DIRWIKI)/Mailing : \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/mailing_full.xml @xsltproc \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/mailing_full.xml | \ awk 'sub(/ @star@ $$/,""){printf(" * %s", $$0);next};1' | \ sed -e "s+@star@+*+" \ > $@ $(DIRWWW)/mailing.html : \ $(DIRTMP)/mailing_full.xml \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/titlepage.saxo.xsl \ $(DIRSRC)/style.css \ $(DIRSRC)/$(PRODUCT).css @xsltproc \ --param html.stylesheet "'style.css $(PRODUCT).css'" \ --param css.decoration 1 \ --param link.mailto.url "'mailto:saxo-dev_at_forge.ipsl.jussieu.fr'" \ --param section.autolabel 1 \ --output $@ \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/mailing_full.xml $(DIRTMP)/mailing_full.xml : \ $(DIRSRC)/mailing.xml @xmllint \ --xinclude \ --encode utf-8 \ --noent \ --output $@ \ $(DIRSRC)/mailing.xml $(DIRWIKI)/MiniNotice : \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/mini_notice_full.xml @xsltproc \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/mini_notice_full.xml | \ awk 'sub(/ @star@ $$/,""){printf(" * %s", $$0);next};1' | \ sed -e "s+@star@+*+" \ -e "s+=== idl\>+=== idl\>+" \ -e "s+---\>+---\>+" \ > $@ $(DIRWWW)/mini_notice.html : \ $(DIRTMP)/mini_notice_full.xml \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/titlepage.saxo.xsl \ $(DIRSRC)/style.css \ $(DIRSRC)/$(PRODUCT).css @xsltproc \ --param html.stylesheet "'style.css $(PRODUCT).css'" \ --param css.decoration 1 \ --param link.mailto.url "'mailto:saxo-dev_at_forge.ipsl.jussieu.fr'" \ --param section.autolabel 1 \ --output $@ \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/mini_notice_full.xml $(DIRTMP)/mini_notice_full.xml : \ $(DIRSRC)/mini_notice.xml @xmllint \ --xinclude \ --encode utf-8 \ --noent \ --output $@ \ $(DIRSRC)/mini_notice.xml $(DIRWIKI)/TipLink : \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/tiplink_full.xml @xsltproc \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/tiplink_full.xml | \ awk 'sub(/ @star@ $$/,""){printf(" * %s", $$0);next};1' | \ sed -e "s+@star@+*+" \ > $@ $(DIRWWW)/tiplink.html : \ $(DIRTMP)/tiplink_full.xml \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/titlepage.saxo.xsl \ $(DIRSRC)/style.css \ $(DIRSRC)/$(PRODUCT).css @xsltproc \ --param html.stylesheet "'style.css $(PRODUCT).css'" \ --param css.decoration 1 \ --param link.mailto.url "'mailto:saxo-dev_at_forge.ipsl.jussieu.fr'" \ --param section.autolabel 1 \ --output $@ \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/tiplink_full.xml $(DIRTMP)/tiplink_full.xml : \ $(DIRSRC)/tiplink.xml @xmllint \ --xinclude \ --encode utf-8 \ --noent \ --output $@ \ $(DIRSRC)/tiplink.xml $(DIRWIKI)/InfoUpdateCm : \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/infoupdatecm_full.xml @xsltproc \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/infoupdatecm_full.xml | \ awk 'sub(/ @star@ $$/,""){printf(" * %s", $$0);next};1' | \ sed -e "s+@star@+*+" \ > $@ $(DIRWWW)/infoupdatecm.html : \ $(DIRTMP)/infoupdatecm_full.xml \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/titlepage.saxo.xsl \ $(DIRSRC)/style.css \ $(DIRSRC)/$(PRODUCT).css @xsltproc \ --param html.stylesheet "'style.css $(PRODUCT).css'" \ --param css.decoration 1 \ --param link.mailto.url "'mailto:saxo-dev_at_forge.ipsl.jussieu.fr'" \ --param section.autolabel 1 \ --output $@ \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/infoupdatecm_full.xml $(DIRTMP)/infoupdatecm_full.xml : \ $(DIRSRC)/infoupdatecm.xml \ $(DIRTMP)/rowscm.xml @xmllint \ --xinclude \ --encode utf-8 \ --noent \ --output $@ \ $(DIRSRC)/infoupdatecm.xml $(DIRWIKI)/InfoUpdateKwd : \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/infoupdatekwd_full.xml @xsltproc \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/infoupdatekwd_full.xml | \ awk 'sub(/ @star@ $$/,""){printf(" * %s", $$0);next};1' | \ sed -e "s+@star@+*+" \ > $@ $(DIRWWW)/infoupdatekwd.html : \ $(DIRTMP)/infoupdatekwd_full.xml \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/titlepage.saxo.xsl \ $(DIRSRC)/style.css \ $(DIRSRC)/$(PRODUCT).css @xsltproc \ --param html.stylesheet "'style.css $(PRODUCT).css'" \ --param css.decoration 1 \ --param link.mailto.url "'mailto:saxo-dev_at_forge.ipsl.jussieu.fr'" \ --param section.autolabel 1 \ --output $@ \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/infoupdatekwd_full.xml $(DIRTMP)/infoupdatekwd_full.xml : \ $(DIRTMP)/infoupdatekwd.xml \ $(DIRTMP)/rowskwd.xml @xmllint \ --xinclude \ --encode utf-8 \ --noent \ --output $@ \ $(DIRTMP)/infoupdatekwd.xml $(DIRTMP)/rowscm.xml : \ ../../ForOldVersion/updateold.pro @echo "" > $@ @grep "IF NOT key_forgetold AND n_elements(\(.* = .*\)" ../../ForOldVersion/updateold.pro | \ sort | \ sed -e "s/\(^.* THEN \)\(.*\)\( = \)\(.*\)/\2<\/varname><\/entry> \4<\/varname><\/entry><\/row>/" >> $@ @echo "" >> $@ $(DIRTMP)/rowskwd.xml : \ ../../ForOldVersion/updatekwd.pro @echo "" > $@ @grep "^ old = \[old, .* new = \[new" ../../ForOldVersion/updatekwd.pro | \ sort | \ sed -e "s/\( old = \[old, '\)\(.*\)\('\] *& new = \[new, '\)\(.*\)\('\]\)/\2<\/varname><\/entry> \4<\/varname><\/entry><\/row>/" >> $@ @echo "" >> $@ $(DIRWIKI)/WhatisSaxo : \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/whatissaxo_full.xml @xsltproc \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/whatissaxo_full.xml | \ awk 'sub(/ @star@ $$/,""){printf(" * %s", $$0);next};1' | \ sed -e "s+@star@+*+" \ > $@ $(DIRWWW)/whatissaxo.html : \ $(DIRTMP)/whatissaxo_full.xml \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/titlepage.saxo.xsl \ $(DIRSRC)/style.css \ $(DIRSRC)/$(PRODUCT).css @xsltproc \ --param html.stylesheet "'style.css $(PRODUCT).css'" \ --param css.decoration 1 \ --param link.mailto.url "'mailto:saxo-dev_at_forge.ipsl.jussieu.fr'" \ --param section.autolabel 1 \ --output $@ \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/whatissaxo_full.xml $(DIRTMP)/whatissaxo_full.xml : \ $(DIRSRC)/whatissaxo.xml @xmllint \ --xinclude \ --encode utf-8 \ --noent \ --output $@ \ $(DIRSRC)/whatissaxo.xml $(DIRWIKI)/WhatsNew : \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/whatsnew_full.xml @xsltproc \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/whatsnew_full.xml | \ awk 'sub(/ @star@ $$/,""){printf(" * %s", $$0);next};1' | \ sed -e "s+@star@+*+" \ > $@ $(DIRWWW)/whatsnew.html : \ $(DIRTMP)/whatsnew_full.xml \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/titlepage.saxo.xsl \ $(DIRSRC)/style.css \ $(DIRSRC)/$(PRODUCT).css @xsltproc \ --param html.stylesheet "'style.css $(PRODUCT).css'" \ --param css.decoration 1 \ --param link.mailto.url "'mailto:saxo-dev_at_forge.ipsl.jussieu.fr'" \ --param section.autolabel 1 \ --output $@ \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/whatsnew_full.xml $(DIRTMP)/whatsnew_full.xml : \ $(DIRSRC)/whatsnew.xml @xmllint \ --xinclude \ --encode utf-8 \ --noent \ --output $@ \ $(DIRSRC)/whatsnew.xml $(DIRWIKI)/UpdateSaxo : \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/updatesaxo_full.xml @xsltproc \ $(DIRSRC)/saxo_tracwiki.xsl \ $(DIRTMP)/updatesaxo_full.xml | \ awk 'sub(/ @star@ $$/,""){printf(" * %s", $$0);next};1' | \ sed -e "s+@star@+*+" \ > $@ $(DIRWWW)/updatesaxo.html : \ $(DIRTMP)/updatesaxo_full.xml \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/titlepage.saxo.xsl \ $(DIRSRC)/style.css \ $(DIRSRC)/$(PRODUCT).css @xsltproc \ --param html.stylesheet "'style.css $(PRODUCT).css'" \ --param css.decoration 1 \ --param link.mailto.url "'mailto:saxo-dev_at_forge.ipsl.jussieu.fr'" \ --param section.autolabel 1 \ --output $@ \ $(DIRSRC)/saxo_html.xsl \ $(DIRTMP)/updatesaxo_full.xml $(DIRTMP)/updatesaxo_full.xml : \ $(DIRSRC)/updatesaxo.xml @xmllint \ --xinclude \ --encode utf-8 \ --noent \ --output $@ \ $(DIRSRC)/updatesaxo.xml $(DIRTMP)/titlepage.saxo.xsl : \ $(DIRSRC)/titlepage.saxo.xml @xsltproc \ --output $@ \ http://docbook.sourceforge.net/release/xsl/current/template/titlepage.xsl \ $(DIRSRC)/titlepage.saxo.xml \ $(DIRSRC)/titlepage.saxo.xml