source: tags/ms_r18q1/GDEHELP/Makefile.helpfiles

Last change on this file was 15411, checked in by westram, 8 years ago
  • fix warnings caused by converted documentation
    • conversion of html docs
      • remove lynx-"<HR/>"-output (arb-help-converter tries to add that to paragraphs)
      • add empty line after "generated from" message
    • manual reflow of one problematic section in READSEQ/Formats
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.9 KB
Line 
1# -*-Mode: Makefile;-*-  (emacs! this is a makefile!)
2
3.SUFFIXES: .doc .help .html
4
5# GENHELPDEST, GENDOCDEST and HELPFILELIST are passed from 'Makefile'
6
7HELP_NAMES=$(shell cat $(HELPFILELIST))
8HELP_TARGETS=$(addprefix $(GENHELPDEST)/,$(HELP_NAMES))
9HELP_PLAIN=./HELP_PLAIN
10HELP_WRITTEN=./HELP_WRITTEN
11HEADER=arb_help.head
12SED:=$(ARBHOME)/SH/arb_sed
13all: info forcedoc $(HELP_TARGETS)
14
15info:
16        @echo "----------------------------------------------------------------"
17        @echo "Collecting documentation for external programs used in GDE menus"
18#       @echo "HELP_TARGETS=$(HELP_TARGETS)"
19
20# ------------------------------------------------------------
21# rules to generate helpfiles
22# we need rules here for each helpfile specified on an 'itemhelp' line in GDE menus.
23
24ARBHOME=..
25GDE=$(ARBHOME)/GDE
26
27GENHELP_DEPENDS=genhelp.sh Makefile.helpfiles
28GENHELPTREE_DEPENDS=genhelptree.sh $(GENHELP_DEPENDS)
29
30# ---------- CLUSTALW
31
32CLUSTALW=$(GDE)/CLUSTALW
33CLUSTALW_HELP=$(CLUSTALW)/clustalw_help
34CLUSTALW_DOC=$(CLUSTALW)/clustalw.doc
35
36$(GENHELPDEST)/clustalw.help: $(CLUSTALW_HELP) $(CLUSTALW_DOC) $(GENHELPTREE_DEPENDS)
37        ./genhelptree.sh $@ "$(subst .help,,$(notdir $@))" $(HEADER) $(CLUSTALW_HELP) $(CLUSTALW_DOC)
38
39# ---------- AXML / FASTDNAML
40
41AXML_HELP=$(GDE)/AxML/AxML.doc
42FASTDNAML_DOC=$(GDE)/FASTDNAML/fastDNAml.doc
43
44$(GENHELPDEST)/dnaml.help: $(AXML_HELP) $(FASTDNAML_DOC) $(GENHELPTREE_DEPENDS)
45        ./genhelptree.sh $@ "$(subst .help,,$(notdir $@))" $(HEADER) $(AXML_HELP) $(FASTDNAML_DOC)
46
47# ---------- READSEQ
48
49READSEQ=$(ARBHOME)/READSEQ
50READSEQ_DOC_NAMES=Readme Formats Readseq.help
51READSEQ_DOCS=$(addprefix $(READSEQ)/,$(READSEQ_DOC_NAMES))
52
53$(GENHELPDEST)/readseq.help: $(READSEQ_DOCS) $(GENHELPTREE_DEPENDS)
54        ./genhelptree.sh $@ "$(subst .help,,$(notdir $@))" $(HEADER) $(READSEQ_DOCS)
55
56# ---------- PHYLIP
57
58PHYLIP_DISTANCE_HELP_NAMES=fitch kitsch neighbor dnadist protdist
59PHYLIP_DISTANCE_HELPS=$(addsuffix .doc,$(addprefix $(GENDOCDEST)/,$(PHYLIP_DISTANCE_HELP_NAMES)))
60
61$(GENHELPDEST)/phylip_distance.help: $(PHYLIP_DISTANCE_HELPS) $(GENHELPTREE_DEPENDS)
62        ./genhelptree.sh $@ "$(subst .help,,$(notdir $@))" $(HEADER) $(PHYLIP_DISTANCE_HELPS)
63
64# ------------------------------------------------------------
65# all help files in ./HELP_PLAIN are automatically found
66
67$(GENHELPDEST)/%.help: $(HELP_PLAIN)/%.help $(HEADER) $(GENHELP_DEPENDS)
68        ./genhelp.sh $@ "$(subst .help,,$(notdir $@))" $(HEADER) $<
69
70# all help files in ./HELP_DOC_GEN are automatically found
71
72$(GENHELPDEST)/%.help: $(GENDOCDEST)/%.doc $(HEADER) $(GENHELP_DEPENDS)
73        ./genhelp.sh $@ "$(subst .help,,$(notdir $@))" $(HEADER) $<
74
75# ------------------------------------------------------------
76# rules to generate plain doc from provided html files
77
78HELP_TREEPUZZLE=../GDE/TREEPUZZLE/doc
79PHYLIP_MAIN=../GDE/PHYLIP
80HELP_PHYLIP=$(PHYLIP_MAIN)/doc
81HELP_PHYML=../GDE/PHYML
82
83FORCED_DOC_NAMES=proml dnapars protpars phyml phylip
84LYNX_PARA=-dump -nolist -display_charset=iso-8859-1
85
86# - convert copyright symbol dumped by lynx
87# - remove underscore lines dumped for "<HR/>" (causes paragraph-reflow to fail)
88FILTER_LYNX_OUTPUT=$(SED) -e 's/©/(C)/' -e 's/^\s\s*__*$$//'
89
90$(GENDOCDEST)/%.doc: $(HELP_PHYLIP)/%.html Makefile.helpfiles
91        @(test -f $@ && chmod u+w $@) || true
92        (echo "   [ generated from ../$< ]"; echo ""; lynx $(LYNX_PARA) $<) | $(FILTER_LYNX_OUTPUT) > $@
93        @test -s $@ || (echo $@ not generated or empty && rm $@ && false)
94        @chmod a-w $@
95
96$(GENDOCDEST)/treepuzzle.doc: $(HELP_TREEPUZZLE)/manual.html Makefile.helpfiles
97        @(test -f $@ && chmod u+w $@) || true
98        (echo "   [ generated from ../$< ]"; echo ""; lynx $(LYNX_PARA) $<) | $(FILTER_LYNX_OUTPUT) > $@
99        @test -s $@ || (echo $@ not generated or empty && rm $@ && false)
100        @chmod a-w $@
101
102$(GENDOCDEST)/phyml.doc: $(HELP_PHYML)/usersguide_phyliplike.html Makefile.helpfiles
103        @(test -f $@ && chmod u+w $@) || true
104        (echo "   [ generated from ../$< ]"; echo ""; lynx $(LYNX_PARA) $<) | $(FILTER_LYNX_OUTPUT) > $@
105        @test -s $@ || (echo $@ not generated or empty && rm $@ && false)
106        @chmod a-w $@
107
108$(GENDOCDEST)/phylip.doc: $(PHYLIP_MAIN)/phylip.html Makefile.helpfiles
109        @(test -f $@ && chmod u+w $@) || true
110        (echo "   [ generated from ../$< ]"; echo ""; lynx $(LYNX_PARA) $<) | $(FILTER_LYNX_OUTPUT) > $@
111        @test -s $@ || (echo $@ not generated or empty && rm $@ && false)
112        @chmod a-w $@
113
114FORCED_DOCS=$(addsuffix .doc,$(addprefix $(GENDOCDEST)/,$(FORCED_DOC_NAMES)))
115forcedoc: $(FORCED_DOCS) Makefile
116
117# ------------------------------------------------------------
118# default rule to raise error if no rule is given to generate a helpfile.
119# dont warn if there's a help file in HELP_WRITTEN
120# (files there are processed by ../HELP_SOURCE/genhelp/Makefile )
121
122$(GENHELPDEST)/%.help:
123        @( test -f $(HELP_WRITTEN)/$(notdir $@) ) \
124        || \
125        ( \
126                echo "Makefile.helpfiles:22: Error: No rule to make $(notdir $@) (to which is referred-to inside GDE menus, see hits below)" ; \
127                grep -n $(notdir $@) MENUS/*.menu ; \
128                false )
129
130clean:
131        rm -rf $(GENHELPDEST) $(GENDOCDEST)
Note: See TracBrowser for help on using the repository browser.