source: tags/arb_5.2/GDEHELP/Makefile.helpfiles

Last change on this file was 5609, checked in by westram, 15 years ago

avoid generation of defect intermediate files (happens if lynx is not installed).
These files had to be removed manually, to force regeneration after lynx-installation.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 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
12
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
27CLUSTALW=$(GDE)/CLUSTALW
28CLUSTALW_HELP=$(CLUSTALW)/clustalw_help
29CLUSTALW_DOC=$(CLUSTALW)/clustalw.doc
30
31$(GENHELPDEST)/clustalw.help: $(CLUSTALW_HELP) $(CLUSTALW_DOC)
32        ./genhelptree.sh $@ "$(subst .help,,$(notdir $@))" $(HEADER) $^
33
34AXML_HELP=$(GDE)/AxML/AxML.doc
35FASTDNAML_DOC=$(GDE)/FASTDNAML/fastDNAml.doc
36
37$(GENHELPDEST)/dnaml.help: $(AXML_HELP) $(FASTDNAML_DOC)
38        ./genhelptree.sh $@ "$(subst .help,,$(notdir $@))" $(HEADER) $^
39
40PROTML=$(GDE)/MOLPHY/doc
41PROTML_DOC_NAMES=protml protml_cli
42PROTML_DOCS=$(addsuffix .doc,$(addprefix $(PROTML)/,$(PROTML_DOC_NAMES)))
43
44$(GENHELPDEST)/protml.help: $(PROTML_DOCS)
45        ./genhelptree.sh $@ "$(subst .help,,$(notdir $@))" $(HEADER) $^
46
47READSEQ=$(ARBHOME)/READSEQ
48READSEQ_DOC_NAMES=Readme Formats Readseq.help
49READSEQ_DOCS=$(addprefix $(READSEQ)/,$(READSEQ_DOC_NAMES))
50
51$(GENHELPDEST)/readseq.help: $(READSEQ_DOCS)
52        ./genhelptree.sh $@ "$(subst .help,,$(notdir $@))" $(HEADER) $^
53
54PHYLIP_DISTANCE_HELP_NAMES=fitch kitsch neighbor dnadist protdist
55PHYLIP_DISTANCE_HELPS=$(addsuffix .doc,$(addprefix $(GENDOCDEST)/,$(PHYLIP_DISTANCE_HELP_NAMES)))
56
57$(GENHELPDEST)/phylip_distance.help: $(PHYLIP_DISTANCE_HELPS)
58        ./genhelptree.sh $@ "$(subst .help,,$(notdir $@))" $(HEADER) $^
59
60# all help files in ./HELP_PLAIN are automatically found
61
62$(GENHELPDEST)/%.help: $(HELP_PLAIN)/%.help $(HEADER)
63        ./genhelp.sh $@ "$(subst .help,,$(notdir $@))" $(HEADER) $<
64
65# all help files in ./HELP_DOC_GEN are automatically found
66
67$(GENHELPDEST)/%.help: $(GENDOCDEST)/%.doc $(HEADER)
68        ./genhelp.sh $@ "$(subst .help,,$(notdir $@))" $(HEADER) $<
69
70# ------------------------------------------------------------
71# rules to generate plain doc from provided html files
72
73HELP_TREEPUZZLE=../GDE/TREEPUZZLE/doc
74HELP_PHYLIP=../GDE/PHYLIP/doc
75HELP_PHYML=../GDE/PHYML
76
77FORCED_DOC_NAMES=proml dnapars protpars phyml
78LYNX_PARA=-dump -nolist -display_charset=iso-8859-1
79
80$(GENDOCDEST)/%.doc: $(HELP_PHYLIP)/%.html Makefile.helpfiles
81        lynx $(LYNX_PARA) $< | sed -e 's/©/(C)/' > $@
82        test -s $@ || (echo $@ not generated or empty && rm $@ && false)
83
84$(GENDOCDEST)/treepuzzle.doc: $(HELP_TREEPUZZLE)/manual.html Makefile.helpfiles
85        lynx $(LYNX_PARA) $< | sed -e 's/©/(C)/' > $@
86        test -s $@ || (echo $@ not generated or empty && rm $@ && false)
87
88$(GENDOCDEST)/phyml.doc: $(HELP_PHYML)/usersguide_phyliplike.html Makefile.helpfiles
89        lynx $(LYNX_PARA) $< | sed -e 's/©/(C)/' > $@
90        test -s $@ || (echo $@ not generated or empty && rm $@ && false)
91
92FORCED_DOCS=$(addsuffix .doc,$(addprefix $(GENDOCDEST)/,$(FORCED_DOC_NAMES)))
93forcedoc: $(FORCED_DOCS)
94
95# ------------------------------------------------------------
96# default rule to raise error if no rule is given to generate a helpfile.
97# dont warn if there's a help file in HELP_WRITTEN
98# (files there are processed by ../HELP_SOURCE/genhelp/Makefile )
99
100$(GENHELPDEST)/%.help:
101        @( test -f $(HELP_WRITTEN)/$(notdir $@) ) \
102        || \
103        ( \
104                echo "Makefile.helpfiles:18: Error: No rule to make $(notdir $@) (to which is referred to in a GDE menu)" ; \
105                grep -n $(notdir $@) MENUS/*.menu ; \
106                false )
107
108clean:
109        rm -f $(GENHELPDEST)/*.help
110        rm -f $(GENDOCDEST)/*.doc
Note: See TracBrowser for help on using the repository browser.