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 405
 		fi ; \
404 406
 	done 
405 407
 
408
+.PHONY: modules-readme
409
+modules-readme: README
410
+
411
+.PHONY: README
412
+README:
413
+	-@for r in $(modules) "" ; do \
414
+		if [ -n "$$r" ]; then \
415
+			echo  "" ; \
416
+			echo  "" ; \
417
+			if  $(MAKE) -C $$r README || [ ${err_fail} != 1 ] ; then \
418
+				:; \
419
+			else \
420
+				exit 1; \
421
+			fi ; \
422
+		fi ; \
423
+	done; true 
424
+
425
+.PHONY: modules-man
426
+modules-man: man
427
+
428
+.PHONY: man
429
+man:
430
+	-@for r in $(modules) "" ; do \
431
+		if [ -n "$$r" ]; then \
432
+			echo  "" ; \
433
+			echo  "" ; \
434
+			if  $(MAKE) -C $$r man || [ ${err_fail} != 1 ] ; then \
435
+				:; \
436
+			else \
437
+				exit 1; \
438
+			fi ; \
439
+		fi ; \
440
+	done; true
441
+
406 442
 .PHONY: install
407 443
 install: install-bin install-modules install-cfg \
408 444
 	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 71
 		$(MAKE) -C "$${lib}" install-if-newer ;\
71 72
 	done
72 73
 
74
+# README build rules
75
+ifneq (,$(wildcard doc/Makefile))
76
+#doc/Makefile present => we can generate README
77
+
78
+README: doc/*.xml
79
+	$(MAKE) -C doc $(MOD_NAME).txt
80
+	cp doc/$(MOD_NAME).txt $@
81
+
82
+else
83
+# do nothing
84
+
85
+README:
86
+endif
87
+
88
+#man page build rules
89
+ifneq (,$(wildcard $(MOD_NAME).xml))
90
+
91
+$(MOD_NAME).7: $(MOD_NAME).xml
92
+	docbook2x-man -s ../../doc/stylesheets/serdoc2man.xsl $<
93
+
94
+man: $(MOD_NAME).7
95
+
96
+else
97
+
98
+man:
99
+
100
+endif