Browse code

- 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 authored on 23/06/2008 18:35:26
Showing 3 changed files
... ...
@@ -330,6 +330,18 @@ or
330 330
 
331 331
 dpkg-buildpackage
332 332
 
333
+Documentation:
334
+
335
+make README
336
+
337
+Regenerates the README for all the "default" modules (include_modules,
338
+ skip_modules a.s.o can be used to alter the module list).
339
+
340
+make man
341
+
342
+Generates a manpage for all the modules that support it (.xml file in the
343
+ module directory).
344
+
333 345
 Install:
334 346
 
335 347
 make prefix=/usr/local  install
... ...
@@ -45,6 +45,8 @@
45 45
 #  2007-03-29  install-modules changed to use make -C modpath install (andrei)
46 46
 #  2007-05-04  "if ! foo" not supported in standard sh, switched to 
47 47
 #                "if foo; then :; else ... ; fi" (andrei)
48
+# 2008-06-23  added 2 new targets: README and man (re-generate the README
49
+#              or manpages for all the modules) (andrei)
48 50
 
49 51
 auto_gen=lex.yy.c cfg.tab.c #lexx, yacc etc
50 52
 auto_gen_others=cfg.tab.h  # auto generated, non-c
... ...
@@ -403,6 +405,40 @@ modules-doc:
403 403
 		fi ; \
404 404
 	done 
405 405
 
406
+.PHONY: modules-readme
407
+modules-readme: README
408
+
409
+.PHONY: README
410
+README:
411
+	-@for r in $(modules) "" ; do \
412
+		if [ -n "$$r" ]; then \
413
+			echo  "" ; \
414
+			echo  "" ; \
415
+			if  $(MAKE) -C $$r README || [ ${err_fail} != 1 ] ; then \
416
+				:; \
417
+			else \
418
+				exit 1; \
419
+			fi ; \
420
+		fi ; \
421
+	done; true 
422
+
423
+.PHONY: modules-man
424
+modules-man: man
425
+
426
+.PHONY: man
427
+man:
428
+	-@for r in $(modules) "" ; do \
429
+		if [ -n "$$r" ]; then \
430
+			echo  "" ; \
431
+			echo  "" ; \
432
+			if  $(MAKE) -C $$r man || [ ${err_fail} != 1 ] ; then \
433
+				:; \
434
+			else \
435
+				exit 1; \
436
+			fi ; \
437
+		fi ; \
438
+	done; true
439
+
406 440
 .PHONY: install
407 441
 install: install-bin install-modules install-cfg \
408 442
 	install-doc install-man install-utils
... ...
@@ -9,6 +9,7 @@
9 9
 #  2007-03-29  if a module depends on SER_LIBS, it will be rebuilt on install
10 10
 #               with the proper rpath; libraries will be automatically
11 11
 #               installed if needed (andrei)
12
+#  2008-06-23  added the README & man targets (andrei)
12 13
 #
13 14
 
14 15
 MOD_NAME=$(NAME:.so=)
... ...
@@ -70,3 +71,30 @@ install-libs:
70 70
 		$(MAKE) -C "$${lib}" install-if-newer ;\
71 71
 	done
72 72
 
73
+# README build rules
74
+ifneq (,$(wildcard doc/Makefile))
75
+#doc/Makefile present => we can generate README
76
+
77
+README: doc/*.xml
78
+	$(MAKE) -C doc $(MOD_NAME).txt
79
+	cp doc/$(MOD_NAME).txt $@
80
+
81
+else
82
+# do nothing
83
+
84
+README:
85
+endif
86
+
87
+#man page build rules
88
+ifneq (,$(wildcard $(MOD_NAME).xml))
89
+
90
+$(MOD_NAME).7: $(MOD_NAME).xml
91
+	docbook2x-man -s ../../doc/stylesheets/serdoc2man.xsl $<
92
+
93
+man: $(MOD_NAME).7
94
+
95
+else
96
+
97
+man:
98
+
99
+endif