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 | |
---|
7 | HELP_NAMES=$(shell cat $(HELPFILELIST)) |
---|
8 | HELP_TARGETS=$(addprefix $(GENHELPDEST)/,$(HELP_NAMES)) |
---|
9 | HELP_PLAIN=./HELP_PLAIN |
---|
10 | HELP_WRITTEN=./HELP_WRITTEN |
---|
11 | HEADER=arb_help.head |
---|
12 | SED:=$(ARBHOME)/SH/arb_sed |
---|
13 | all: info forcedoc $(HELP_TARGETS) |
---|
14 | |
---|
15 | info: |
---|
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 | ARBHOME=.. |
---|
25 | GDE=$(ARBHOME)/GDE |
---|
26 | |
---|
27 | GENHELP_DEPENDS=genhelp.sh Makefile.helpfiles |
---|
28 | GENHELPTREE_DEPENDS=genhelptree.sh $(GENHELP_DEPENDS) |
---|
29 | |
---|
30 | # ---------- CLUSTALW |
---|
31 | |
---|
32 | CLUSTALW=$(GDE)/CLUSTALW |
---|
33 | CLUSTALW_HELP=$(CLUSTALW)/clustalw_help |
---|
34 | CLUSTALW_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 | |
---|
41 | AXML_HELP=$(GDE)/AxML/AxML.doc |
---|
42 | FASTDNAML_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 | |
---|
49 | READSEQ=$(ARBHOME)/READSEQ |
---|
50 | READSEQ_DOC_NAMES=Readme Formats Readseq.help |
---|
51 | READSEQ_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 | |
---|
58 | PHYLIP_DISTANCE_HELP_NAMES=fitch kitsch neighbor dnadist protdist |
---|
59 | PHYLIP_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 | |
---|
78 | HELP_TREEPUZZLE=../GDE/TREEPUZZLE/doc |
---|
79 | PHYLIP_MAIN=../GDE/PHYLIP |
---|
80 | HELP_PHYLIP=$(PHYLIP_MAIN)/doc |
---|
81 | HELP_PHYML=../GDE/PHYML |
---|
82 | |
---|
83 | FORCED_DOC_NAMES=proml dnapars protpars phyml phylip |
---|
84 | LYNX_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 | |
---|
110 | FORCED_DOCS=$(addsuffix .doc,$(addprefix $(GENDOCDEST)/,$(FORCED_DOC_NAMES))) |
---|
111 | forcedoc: $(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 | |
---|
126 | clean: |
---|
127 | rm -rf $(GENHELPDEST) $(GENDOCDEST) |
---|