Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 72 lines (54 sloc) 1.742 kb
babea9c [enhance] manpages: now builds manpages in standard build directory
Mathieu Baudet authored
1 .PHONY: all clean help view
9489580 [enhance] manpages: created dir manpage and its Makefile
Mathieu Baudet authored
2
4a27a07 [enhance] manpages: improved Makefile
Mathieu Baudet authored
3 # --
4 # build the list of target binaries to be documented:
5 # bin/* and lib/opa/bin/* together with inclusions and exclusions
6 # --
babea9c [enhance] manpages: now builds manpages in standard build directory
Mathieu Baudet authored
7 BLDDIR ?= ../_build
5baea24 [fix] manpages: when called from the main Makefile, do not assume 'insta...
Mathieu Baudet authored
8 OCAMLBUILD ?= bld
9
c55ebd1 [enhance] manpages: created simple program for quick manpage generation
Mathieu Baudet authored
10 BINDIR=$(BLDDIR)/bin
4a27a07 [enhance] manpages: improved Makefile
Mathieu Baudet authored
11 EXCLUDE=opa-bin mlstate_platform genproto ocamlbase.top ppdebug-opa ppjs
c55ebd1 [enhance] manpages: created simple program for quick manpage generation
Mathieu Baudet authored
12 INCLUDE=opa
13 BINS=$(INCLUDE) $(filter-out $(EXCLUDE), $(notdir $(wildcard $(BLDDIR)/bin/* $(BLDDIR)/lib/opa/bin/*)))
14
babea9c [enhance] manpages: now builds manpages in standard build directory
Mathieu Baudet authored
15 TARGETDIR=$(BLDDIR)/man/man1
16 TARGETS=$(addprefix $(TARGETDIR)/, $(addsuffix .1, $(BINS)))
c55ebd1 [enhance] manpages: created simple program for quick manpage generation
Mathieu Baudet authored
17
18 all: $(TARGETS)
19
4a27a07 [enhance] manpages: improved Makefile
Mathieu Baudet authored
20 # for debugging
21 help: $(TARGETS:.1=.help)
c55ebd1 [enhance] manpages: created simple program for quick manpage generation
Mathieu Baudet authored
22
4a27a07 [enhance] manpages: improved Makefile
Mathieu Baudet authored
23 clean:
24 rm -f $(TARGETS) $(TARGETS:.1=.help)
c55ebd1 [enhance] manpages: created simple program for quick manpage generation
Mathieu Baudet authored
25
babea9c [enhance] manpages: now builds manpages in standard build directory
Mathieu Baudet authored
26 view: $(TARGETS)
27 man $(TARGETS)
28
4a27a07 [enhance] manpages: improved Makefile
Mathieu Baudet authored
29 # --
30 # first check if a manpage has been written by hand
31 # --
babea9c [enhance] manpages: now builds manpages in standard build directory
Mathieu Baudet authored
32 $(TARGETDIR)/%.1: %.man
33 @mkdir -p $(TARGETDIR)
4a27a07 [enhance] manpages: improved Makefile
Mathieu Baudet authored
34 cp $< $@
c55ebd1 [enhance] manpages: created simple program for quick manpage generation
Mathieu Baudet authored
35
4a27a07 [enhance] manpages: improved Makefile
Mathieu Baudet authored
36 # --
37 # second run specific manpage generation programs
38 # --
c55ebd1 [enhance] manpages: created simple program for quick manpage generation
Mathieu Baudet authored
39 $(BLDDIR)/opa/gen_opa_manpage.native: ../opa/gen_opa_manpage.ml
5baea24 [fix] manpages: when called from the main Makefile, do not assume 'insta...
Mathieu Baudet authored
40 cd ..; $(OCAMLBUILD) opa/gen_opa_manpage.native
9489580 [enhance] manpages: created dir manpage and its Makefile
Mathieu Baudet authored
41
babea9c [enhance] manpages: now builds manpages in standard build directory
Mathieu Baudet authored
42 $(TARGETDIR)/opa.1: $(BLDDIR)/opa/gen_opa_manpage.native
43 @mkdir -p $(TARGETDIR)
9489580 [enhance] manpages: created dir manpage and its Makefile
Mathieu Baudet authored
44 $< > $@
45
4a27a07 [enhance] manpages: improved Makefile
Mathieu Baudet authored
46 $(BLDDIR)/opatop/gen_opatop_manpage.native: ../opatop/gen_opatop_manpage.ml
5baea24 [fix] manpages: when called from the main Makefile, do not assume 'insta...
Mathieu Baudet authored
47 cd ..; $(OCAMLBUILD) opatop/gen_opatop_manpage.native
4a27a07 [enhance] manpages: improved Makefile
Mathieu Baudet authored
48
babea9c [enhance] manpages: now builds manpages in standard build directory
Mathieu Baudet authored
49 $(TARGETDIR)/opatop.1: $(BLDDIR)/opatop/gen_opatop_manpage.native
50 @mkdir -p $(TARGETDIR)
4a27a07 [enhance] manpages: improved Makefile
Mathieu Baudet authored
51 $< > $@
52
53 # --
54 # third run our hackish conversion tool help->manpage
55 # --
56 GENMAN=$(BLDDIR)/manpages/genman.native
57
58 $(GENMAN): genman.ml
5baea24 [fix] manpages: when called from the main Makefile, do not assume 'insta...
Mathieu Baudet authored
59 cd ..; $(OCAMLBUILD) -cflags "-w -14" manpages/genman.native
c55ebd1 [enhance] manpages: created simple program for quick manpage generation
Mathieu Baudet authored
60
babea9c [enhance] manpages: now builds manpages in standard build directory
Mathieu Baudet authored
61 $(TARGETDIR)/%.help: $(BLDDIR)/bin/%
62 @mkdir -p $(TARGETDIR)
c55ebd1 [enhance] manpages: created simple program for quick manpage generation
Mathieu Baudet authored
63 $< --help >$@ 2>&1 ||true
64
babea9c [enhance] manpages: now builds manpages in standard build directory
Mathieu Baudet authored
65 $(TARGETDIR)/%.help: $(BLDDIR)/lib/opa/bin/%
66 @mkdir -p $(TARGETDIR)
c55ebd1 [enhance] manpages: created simple program for quick manpage generation
Mathieu Baudet authored
67 $< --help >$@ 2>&1 ||true
9489580 [enhance] manpages: created dir manpage and its Makefile
Mathieu Baudet authored
68
babea9c [enhance] manpages: now builds manpages in standard build directory
Mathieu Baudet authored
69 $(TARGETDIR)/%.1: $(TARGETDIR)/%.help $(GENMAN)
70 @mkdir -p $(TARGETDIR)
71 $(GENMAN) $* $(TARGETDIR)/$* > $@
Something went wrong with that request. Please try again.