ソースを参照

- README target support: make README will regenerate the README from all
the current modules
- man target: (experimental) make man will generate a man page for all the
modules that support it (.xml file in the module directory, for now only
acc_db, acc_syslog & auth_db support it)

Andrei Pelinescu-Onciul 17 年 前
コミット
617ced3968
3 ファイル変更76 行追加0 行削除
  1. 12 0
      INSTALL
  2. 36 0
      Makefile
  3. 28 0
      Makefile.modules

+ 12 - 0
INSTALL

@@ -330,6 +330,18 @@ or
 
 dpkg-buildpackage
 
+Documentation:
+
+make README
+
+Regenerates the README for all the "default" modules (include_modules,
+ skip_modules a.s.o can be used to alter the module list).
+
+make man
+
+Generates a manpage for all the modules that support it (.xml file in the
+ module directory).
+
 Install:
 
 make prefix=/usr/local  install

+ 36 - 0
Makefile

@@ -45,6 +45,8 @@
 #  2007-03-29  install-modules changed to use make -C modpath install (andrei)
 #  2007-05-04  "if ! foo" not supported in standard sh, switched to 
 #                "if foo; then :; else ... ; fi" (andrei)
+# 2008-06-23  added 2 new targets: README and man (re-generate the README
+#              or manpages for all the modules) (andrei)
 
 auto_gen=lex.yy.c cfg.tab.c #lexx, yacc etc
 auto_gen_others=cfg.tab.h  # auto generated, non-c
@@ -403,6 +405,40 @@ modules-doc:
 		fi ; \
 	done 
 
+.PHONY: modules-readme
+modules-readme: README
+
+.PHONY: README
+README:
+	-@for r in $(modules) "" ; do \
+		if [ -n "$$r" ]; then \
+			echo  "" ; \
+			echo  "" ; \
+			if  $(MAKE) -C $$r README || [ ${err_fail} != 1 ] ; then \
+				:; \
+			else \
+				exit 1; \
+			fi ; \
+		fi ; \
+	done; true 
+
+.PHONY: modules-man
+modules-man: man
+
+.PHONY: man
+man:
+	-@for r in $(modules) "" ; do \
+		if [ -n "$$r" ]; then \
+			echo  "" ; \
+			echo  "" ; \
+			if  $(MAKE) -C $$r man || [ ${err_fail} != 1 ] ; then \
+				:; \
+			else \
+				exit 1; \
+			fi ; \
+		fi ; \
+	done; true
+
 .PHONY: install
 install: install-bin install-modules install-cfg \
 	install-doc install-man install-utils

+ 28 - 0
Makefile.modules

@@ -9,6 +9,7 @@
 #  2007-03-29  if a module depends on SER_LIBS, it will be rebuilt on install
 #               with the proper rpath; libraries will be automatically
 #               installed if needed (andrei)
+#  2008-06-23  added the README & man targets (andrei)
 #
 
 MOD_NAME=$(NAME:.so=)
@@ -70,3 +71,30 @@ install-libs:
 		$(MAKE) -C "$${lib}" install-if-newer ;\
 	done
 
+# README build rules
+ifneq (,$(wildcard doc/Makefile))
+#doc/Makefile present => we can generate README
+
+README: doc/*.xml
+	$(MAKE) -C doc $(MOD_NAME).txt
+	cp doc/$(MOD_NAME).txt $@
+
+else
+# do nothing
+
+README:
+endif
+
+#man page build rules
+ifneq (,$(wildcard $(MOD_NAME).xml))
+
+$(MOD_NAME).7: $(MOD_NAME).xml
+	docbook2x-man -s ../../doc/stylesheets/serdoc2man.xsl $<
+
+man: $(MOD_NAME).7
+
+else
+
+man:
+
+endif