Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[enhance] manpages: improved Makefile

  • Loading branch information...
commit 4a27a077500379f36e833dcf46817be573c3797f 1 parent 41daf15
Mathieu Baudet authored
Showing with 33 additions and 13 deletions.
  1. +33 −13 manpages/Makefile
46 manpages/Makefile
View
@@ -1,10 +1,12 @@
-BLDDIR=../_build
+.PHONY: all clean help
+# --
+# build the list of target binaries to be documented:
+# bin/* and lib/opa/bin/* together with inclusions and exclusions
+# --
+BLDDIR=../_build
BINDIR=$(BLDDIR)/bin
-
-.PHONY: all clean
-
-EXCLUDE=opa-bin mlstate_platform
+EXCLUDE=opa-bin mlstate_platform genproto ocamlbase.top ppdebug-opa ppjs
INCLUDE=opa
BINS=$(INCLUDE) $(filter-out $(EXCLUDE), $(notdir $(wildcard $(BLDDIR)/bin/* $(BLDDIR)/lib/opa/bin/*)))
@@ -12,22 +14,40 @@ TARGETS=$(BINS:=.1)
all: $(TARGETS)
-clean:
- rm -f $(TARGETS)
+# for debugging
+help: $(TARGETS:.1=.help)
-GENMAN=$(BLDDIR)/manpages/genman.native
+clean:
+ rm -f $(TARGETS) $(TARGETS:.1=.help)
-$(GENMAN): genman.ml
- cd ..; bld -cflags "-w -14" manpages/genman.native
+# --
+# first check if a manpage has been written by hand
+# --
+%.1: %.man
+ cp $< $@
+# --
+# second run specific manpage generation programs
+# --
$(BLDDIR)/opa/gen_opa_manpage.native: ../opa/gen_opa_manpage.ml
- cd ..; bld -cflags manpages/opa/gen_opa_manpage.native
+ cd ..; bld opa/gen_opa_manpage.native
opa.1: $(BLDDIR)/opa/gen_opa_manpage.native
$< > $@
-#opatop.1: $(BLDDIR)/opatop/gen_opatop_manpage.native
-# $< > $@
+$(BLDDIR)/opatop/gen_opatop_manpage.native: ../opatop/gen_opatop_manpage.ml
+ cd ..; bld opatop/gen_opatop_manpage.native
+
+opatop.1: $(BLDDIR)/opatop/gen_opatop_manpage.native
+ $< > $@
+
+# --
+# third run our hackish conversion tool help->manpage
+# --
+GENMAN=$(BLDDIR)/manpages/genman.native
+
+$(GENMAN): genman.ml
+ cd ..; bld -cflags "-w -14" manpages/genman.native
%.help: $(BLDDIR)/bin/%
$< --help >$@ 2>&1 ||true
Please sign in to comment.
Something went wrong with that request. Please try again.