aboutsummaryrefslogtreecommitdiff
path: root/doc/makefile
blob: f0c38a3e83488e5edc2e669f27568baf5a3f6c0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# file      : doc/makefile
# author    : Boris Kolpackov <boris@codesynthesis.com>
# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC
# license   : GNU GPL v2; see accompanying LICENSE file

include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make

default := $(out_base)/
dist    := $(out_base)/.dist
clean   := $(out_base)/.clean

# Import.
#
$(call import,\
  $(scf_root)/import/cli/stub.make,\
  cli: cli,cli-rules: cli_rules)

# Build.
#
$(default): $(out_base)/odb.xhtml $(out_base)/odb.1

$(out_base)/odb.xhtml $(out_base)/odb.1: cli := $(cli)

$(out_base)/odb.xhtml: $(src_root)/odb/options.cli    \
                       $(src_base)/odb-prologue.xhtml \
                       $(src_base)/odb-epilogue.xhtml
	$(call message,cli-html $<,$(cli) --generate-html --stdout \
--html-prologue $(src_base)/odb-prologue.xhtml \
--html-epilogue $(src_base)/odb-epilogue.xhtml $< >$@)

$(out_base)/odb.1: $(src_root)/odb/options.cli    \
                       $(src_base)/odb-prologue.1 \
                       $(src_base)/odb-epilogue.1
	$(call message,cli-man $<,$(cli) --generate-man --stdout \
--man-prologue $(src_base)/odb-prologue.1 \
--man-epilogue $(src_base)/odb-epilogue.1 $< >$@)

# Dist.
#
$(dist): data_dist := default.css
$(dist): export docs := odb.xhtml
$(dist): export mans := odb.1
$(dist): export extra_dist := $(data_dist)
$(dist): $(out_base)/odb.xhtml $(out_base)/odb.1
	$(call dist-data,$(data_dist))
	$(call dist-data,$(out_base)/odb.1)
	$(call dist-data,$(out_base)/odb.xhtml)
	$(call meta-automake)

# Clean.
#
$(clean):
	$(call message,rm $$1,rm -f $$1,$(out_base)/odb.xhtml)
	$(call message,rm $$1,rm -f $$1,$(out_base)/odb.1)

# Generated .gitignore.
#
ifeq ($(out_base),$(src_base))
$(out_base)/odb.xhtml $(out_base)/odb.1: | $(out_base)/.gitignore

$(out_base)/.gitignore: files := odb.xhtml odb.1
$(clean): $(out_base)/.gitignore.clean

$(call include,$(bld_root)/git/gitignore.make)
endif

$(call include,$(bld_root)/dist.make)
$(call include,$(bld_root)/meta/automake.make)