Browse code

Makefile.utils: new target to install manpage for util tools

Daniel-Constantin Mierla authored on 23/10/2012 22:04:11
Showing 1 changed files
... ...
@@ -84,7 +84,7 @@ modules:
84 84
 
85 85
 .PHONY: install
86 86
 .PHONY: install-libs
87
-install: $(NAME) $(util_dst) install-libs
87
+install: $(NAME) $(util_dst) install-libs install-util-man
88 88
 	$(INSTALL_TOUCH) $(util_dst)/$(NAME)
89 89
 	$(INSTALL_BIN)  $(NAME)  $(util_dst)
90 90
 
... ...
@@ -133,6 +133,21 @@ man:
133 133
 
134 134
 endif
135 135
 
136
+.PHONY: install-util-man
137
+#src-name man page install rules
138
+ifneq (,$(wildcard $(UTIL_SRC_NAME).8))
139
+install-util-man: $(man_prefix)/$(man_dir)/man8
140
+		sed -e "s#$(UTIL_SRC_NAME)#$(UTIL_NAME)#g" \
141
+			-e "s#$(SRC_NAME)#$(MAIN_NAME)#g" \
142
+			< $(UTIL_SRC_NAME).8 > $(man_prefix)/$(man_dir)/man8/$(UTIL_NAME).8
143
+		chmod 644  $(man_prefix)/$(man_dir)/man8/$(UTIL_NAME).8
144
+
145
+else
146
+
147
+install-util-man:
148
+
149
+endif
150
+
136 151
 endif # ifeq($(makefile_defs),1)
137 152
 
138 153
 include $(COREPATH)/Makefile.cfg