source: trunk/GDEHELP/Makefile.helpfiles

Last change on this file was 18863, checked in by westram, 3 years ago
  • document 'Import fields from calc-sheet'.
  • link to 'Export fields (to calc-sheet using NDS)'.
  • add another pointer, where to add helpfiles for GDE menus.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.2 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#
24# Different ways to include help are (HOWTO_ADD_GDE_HELP):
25# - existing file in tool directory, e.g. .@FASTDNAML
26# - multiple existing files in tool directory, e.g. .@CLUSTALW
27# - single existing files in ./HELP_PLAIN or ./HELP_WRITTEN
28# - files generated into ./HELP_DOC_GEN (e.g. used for html ducumentation like proml)
29
30
31ARBHOME=..
32GDE=$(ARBHOME)/GDE
33
34GENHELP_DEPENDS=genhelp.sh Makefile.helpfiles
35GENHELPTREE_DEPENDS=genhelptree.sh $(GENHELP_DEPENDS)
36
37# ---------- CLUSTALW
38
39CLUSTALW=$(GDE)/CLUSTALW
40CLUSTALW_HELP=$(CLUSTALW)/clustalw_help
41CLUSTALW_DOC=$(CLUSTALW)/clustalw.doc
42
43$(GENHELPDEST)/clustalw.help: $(CLUSTALW_HELP) $(CLUSTALW_DOC) $(GENHELPTREE_DEPENDS)
44        ./genhelptree.sh $@ "$(subst .help,,$(notdir $@))" $(HEADER) $(CLUSTALW_HELP) $(CLUSTALW_DOC)
45
46# ---------- AXML / FASTDNAML
47
48AXML_HELP=$(GDE)/AxML/AxML.doc
49FASTDNAML_DOC=$(GDE)/FASTDNAML/fastDNAml.doc
50
51$(GENHELPDEST)/dnaml.help: $(AXML_HELP) $(FASTDNAML_DOC) $(GENHELPTREE_DEPENDS)
52        ./genhelptree.sh $@ "$(subst .help,,$(notdir $@))" $(HEADER) $(AXML_HELP) $(FASTDNAML_DOC)
53
54# ---------- READSEQ
55
56READSEQ=$(ARBHOME)/READSEQ
57READSEQ_DOC_NAMES=Readme Formats Readseq.help
58READSEQ_DOCS=$(addprefix $(READSEQ)/,$(READSEQ_DOC_NAMES))
59
60$(GENHELPDEST)/readseq.help: $(READSEQ_DOCS) $(GENHELPTREE_DEPENDS)
61        ./genhelptree.sh $@ "$(subst .help,,$(notdir $@))" $(HEADER) $(READSEQ_DOCS)
62
63# ---------- PHYLIP
64
65PHYLIP_DISTANCE_HELP_NAMES=fitch kitsch neighbor dnadist protdist
66PHYLIP_DISTANCE_HELPS=$(addsuffix .doc,$(addprefix $(GENDOCDEST)/,$(PHYLIP_DISTANCE_HELP_NAMES)))
67
68$(GENHELPDEST)/phylip_distance.help: $(PHYLIP_DISTANCE_HELPS) $(GENHELPTREE_DEPENDS)
69        ./genhelptree.sh $@ "$(subst .help,,$(notdir $@))" $(HEADER) $(PHYLIP_DISTANCE_HELPS)
70
71# ------------------------------------------------------------
72# all help files in ./HELP_PLAIN are automatically found
73
74$(GENHELPDEST)/%.help: $(HELP_PLAIN)/%.help $(HEADER) $(GENHELP_DEPENDS)
75        ./genhelp.sh $@ "$(subst .help,,$(notdir $@))" $(HEADER) $<
76
77# all help files in ./HELP_DOC_GEN are automatically found
78
79$(GENHELPDEST)/%.help: $(GENDOCDEST)/%.doc $(HEADER) $(GENHELP_DEPENDS)
80        ./genhelp.sh $@ "$(subst .help,,$(notdir $@))" $(HEADER) $<
81
82# ------------------------------------------------------------
83# rules to generate plain doc from provided html files
84
85HELP_TREEPUZZLE=../GDE/TREEPUZZLE/doc
86PHYLIP_MAIN=../GDE/PHYLIP
87HELP_PHYLIP=$(PHYLIP_MAIN)/doc
88HELP_PHYML=../GDE/PHYML
89
90FORCED_DOC_NAMES=proml dnapars protpars phyml phylip
91LYNX_PARA=-dump -nolist -display_charset=iso-8859-1
92
93# - convert copyright symbol dumped by lynx
94# - remove underscore lines dumped for "<HR/>" (causes paragraph-reflow to fail)
95FILTER_LYNX_OUTPUT=$(SED) -e 's/©/(C)/' -e 's/^\s\s*__*$$//'
96
97$(GENDOCDEST)/%.doc: $(HELP_PHYLIP)/%.html Makefile.helpfiles
98        @(test -f $@ && chmod u+w $@) || true
99        (echo "   [ generated from ../$< ]"; echo ""; lynx $(LYNX_PARA) $<) | $(FILTER_LYNX_OUTPUT) > $@
100        @test -s $@ || (echo $@ not generated or empty && rm $@ && false)
101        @chmod a-w $@
102
103$(GENDOCDEST)/treepuzzle.doc: $(HELP_TREEPUZZLE)/manual.html Makefile.helpfiles
104        @(test -f $@ && chmod u+w $@) || true
105        (echo "   [ generated from ../$< ]"; echo ""; lynx $(LYNX_PARA) $<) | $(FILTER_LYNX_OUTPUT) > $@
106        @test -s $@ || (echo $@ not generated or empty && rm $@ && false)
107        @chmod a-w $@
108
109$(GENDOCDEST)/phyml.doc: $(HELP_PHYML)/usersguide_phyliplike.html Makefile.helpfiles
110        @(test -f $@ && chmod u+w $@) || true
111        (echo "   [ generated from ../$< ]"; echo ""; lynx $(LYNX_PARA) $<) | $(FILTER_LYNX_OUTPUT) > $@
112        @test -s $@ || (echo $@ not generated or empty && rm $@ && false)
113        @chmod a-w $@
114
115$(GENDOCDEST)/phylip.doc: $(PHYLIP_MAIN)/phylip.html Makefile.helpfiles
116        @(test -f $@ && chmod u+w $@) || true
117        (echo "   [ generated from ../$< ]"; echo ""; lynx $(LYNX_PARA) $<) | $(FILTER_LYNX_OUTPUT) > $@
118        @test -s $@ || (echo $@ not generated or empty && rm $@ && false)
119        @chmod a-w $@
120
121FORCED_DOCS=$(addsuffix .doc,$(addprefix $(GENDOCDEST)/,$(FORCED_DOC_NAMES)))
122forcedoc: $(FORCED_DOCS) Makefile
123
124# ------------------------------------------------------------
125# default rule to raise error if no rule is given to generate a helpfile.
126# dont warn if there's a help file in HELP_WRITTEN
127# (files there are processed by ../HELP_SOURCE/genhelp/Makefile )
128#
129# if you encounter an error, please read .@HOWTO_ADD_GDE_HELP
130
131$(GENHELPDEST)/%.help:
132        @( test -f $(HELP_WRITTEN)/$(notdir $@) ) \
133        || \
134        ( \
135                echo "Makefile.helpfiles:22: Error: No rule to make $(notdir $@) (to which is referred-to inside GDE menus, see hits below)" ; \
136                grep -n $(notdir $@) MENUS/*.menu ; \
137                false )
138
139clean:
140        rm -rf $(GENHELPDEST) $(GENDOCDEST)
Note: See TracBrowser for help on using the repository browser.