source: tags/ms_r16q3/GDEHELP/Makefile.helpfiles

Last change on this file was 14799, checked in by westram, 8 years ago
  • make 4.1 spams the compile log with
    recipe for target 'xxx' failed
    
    • replaces -oktofail by oktofail || true
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.6 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$(GENDOCDEST)/%.doc: $(HELP_PHYLIP)/%.html Makefile.helpfiles
87        @(test -f $@ && chmod u+w $@) || true
88        (echo "# generated from ../$<"; lynx $(LYNX_PARA) $<) | $(SED) -e 's/©/(C)/' > $@
89        @test -s $@ || (echo $@ not generated or empty && rm $@ && false)
90        @chmod a-w $@
91
92$(GENDOCDEST)/treepuzzle.doc: $(HELP_TREEPUZZLE)/manual.html Makefile.helpfiles
93        @(test -f $@ && chmod u+w $@) || true
94        (echo "# generated from ../$<"; lynx $(LYNX_PARA) $<) | $(SED) -e 's/©/(C)/' > $@
95        @test -s $@ || (echo $@ not generated or empty && rm $@ && false)
96        @chmod a-w $@
97
98$(GENDOCDEST)/phyml.doc: $(HELP_PHYML)/usersguide_phyliplike.html Makefile.helpfiles
99        @(test -f $@ && chmod u+w $@) || true
100        (echo "# generated from ../$<"; lynx $(LYNX_PARA) $<) | $(SED) -e 's/©/(C)/' > $@
101        @test -s $@ || (echo $@ not generated or empty && rm $@ && false)
102        @chmod a-w $@
103
104$(GENDOCDEST)/phylip.doc: $(PHYLIP_MAIN)/phylip.html Makefile.helpfiles
105        @(test -f $@ && chmod u+w $@) || true
106        (echo "# generated from ../$<"; lynx $(LYNX_PARA) $<) | $(SED) -e 's/©/(C)/' > $@
107        @test -s $@ || (echo $@ not generated or empty && rm $@ && false)
108        @chmod a-w $@
109
110FORCED_DOCS=$(addsuffix .doc,$(addprefix $(GENDOCDEST)/,$(FORCED_DOC_NAMES)))
111forcedoc: $(FORCED_DOCS) Makefile
112
113# ------------------------------------------------------------
114# default rule to raise error if no rule is given to generate a helpfile.
115# dont warn if there's a help file in HELP_WRITTEN
116# (files there are processed by ../HELP_SOURCE/genhelp/Makefile )
117
118$(GENHELPDEST)/%.help:
119        @( test -f $(HELP_WRITTEN)/$(notdir $@) ) \
120        || \
121        ( \
122                echo "Makefile.helpfiles:22: Error: No rule to make $(notdir $@) (to which is referred-to inside GDE menus, see hits below)" ; \
123                grep -n $(notdir $@) MENUS/*.menu ; \
124                false )
125
126clean:
127        rm -rf $(GENHELPDEST) $(GENDOCDEST)
Note: See TracBrowser for help on using the repository browser.