aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/Makefile24
-rw-r--r--Makefile7
2 files changed, 29 insertions, 2 deletions
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 4644dc5..d5785bf 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -6,11 +6,13 @@ ifeq ($(VERBOSE),1)
6 Q = 6 Q =
7 print_asciidoc = 7 print_asciidoc =
8 print_xsltproc = 8 print_xsltproc =
9 print_install =
9 hide_xsltproc_output = 10 hide_xsltproc_output =
10else 11else
11 Q = @ 12 Q = @
12 print_asciidoc = echo ' ASCIIDOC '`basename $@`; 13 print_asciidoc = echo ' ASCIIDOC '`basename $@`;
13 print_xsltproc = echo ' XSLTPROC '`basename $@`; 14 print_xsltproc = echo ' XSLTPROC '`basename $@`;
15 print_install = echo ' INSTALL '`basename $1`' to '$2;
14 hide_xsltproc_output = 2> /dev/null 16 hide_xsltproc_output = 2> /dev/null
15endif 17endif
16 18
@@ -49,11 +51,29 @@ $(obj)/%.1: $(obj)/%.xsl
49 51
50TEXT = $(wildcard *.txt) 52TEXT = $(wildcard *.txt)
51XML = $(patsubst %.txt,$(obj)/%.xsl, ${TEXT}) 53XML = $(patsubst %.txt,$(obj)/%.xsl, ${TEXT})
52MAN = $(patsubst %.txt,$(obj)/%.1, ${TEXT}) 54MAN1 = $(patsubst %.txt,$(obj)/%.1, ${TEXT})
53 55
54all: ${MAN} 56all: $(MAN1)
55 57
56 58
59define do_install
60 $(print_install) \
61 if [ ! -d $2 ]; then \
62 $(INSTALL) -d -m 755 $2 ; \
63 fi; \
64 $(INSTALL) $1 $2;
65endef
66
67MAN1_INSTALL = $(subst .1,.install,$(MAN1))
68
69$(MAN1_INSTALL): %.install : %.1 force
70 $(Q)$(call do_install, $<, '$(man_dir_SQ)/man1')
71
72install: $(MAN1_INSTALL)
73
57clean: 74clean:
58 (cd $(obj); \ 75 (cd $(obj); \
59 $(RM) *.xml *.xsl *.1) 76 $(RM) *.xml *.xsl *.1)
77
78.PHONE: force
79force: \ No newline at end of file
diff --git a/Makefile b/Makefile
index dc5241e..121c101 100644
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,10 @@ INSTALL = install
21prefix ?= /usr/local 21prefix ?= /usr/local
22bindir_relative = bin 22bindir_relative = bin
23bindir = $(prefix)/$(bindir_relative) 23bindir = $(prefix)/$(bindir_relative)
24man_dir = $(prefix)/share/man
25man_dir_SQ = '$(subst ','\'',$(man_dir))'
26
27export man_dir man_dir_SQ INSTALL
24 28
25ifeq ($(prefix),$(HOME)) 29ifeq ($(prefix),$(HOME))
26plugin_dir = $(HOME)/.trace-cmd/plugins 30plugin_dir = $(HOME)/.trace-cmd/plugins
@@ -424,6 +428,9 @@ doc:
424doc_clean: 428doc_clean:
425 $(MAKE) -C $(src)/Documentation clean 429 $(MAKE) -C $(src)/Documentation clean
426 430
431install_doc:
432 $(MAKE) -C $(src)/Documentation install
433
427clean: 434clean:
428 $(RM) *.o *~ $(TARGETS) *.a *.so ctracecmd_wrap.c .*.d 435 $(RM) *.o *~ $(TARGETS) *.a *.so ctracecmd_wrap.c .*.d
429 $(RM) tags TAGS trace_plugin_dir 436 $(RM) tags TAGS trace_plugin_dir