Browse code

- fail compilation if building a module or an utility ends with an error (unless err_fail is set to 0, e.g.: make err_fail=0) - don't attempt to compile a module if it has no Makefile - various spelling and lines longer then 80 chars fixes

Andrei Pelinescu-Onciul authored on 01/03/2007 17:11:09
Showing 1 changed files
... ...
@@ -32,13 +32,15 @@
32 32
 #  2006-02-14  added utils & install-utils (andrei)
33 33
 #  2006-03-15  added nodeb parameter for make tar (andrei)
34 34
 #  2006-09-29  added modules-doc as target and doc_format= as make option (greger)
35
-#  2006-12-09  added new group_include as make option and defined groups defining
36
-#		which modules to include
37
-#		Also added new target print-modules that you can use to check which
38
-#		modules will be compiled (greger)
39
-#  2007-01-10   added new group_include targets mysql, radius, and presence 
40
-#		improved print-modules output
41
-#		fixed problem in include/exclude logic when using group_include (greger)
35
+#  2006-12-09  added new group_include as make option and defined groups 
36
+#               defining which modules to include. Also added new target 
37
+#               print-modules that you can use to check which modules will be 
38
+#               compiled (greger)
39
+#  2007-01-10  added new group_include targets mysql, radius, and presence 
40
+#               improved print-modules output fixed problem in include/exclude
41
+#               logic when using group_include (greger)
42
+#  2007-03-01  fail if a module or a required utility make fail unless 
43
+#              err_fail=0; don't try to make modules with no Makefiles (andrei)
42 44
 
43 45
 auto_gen=lex.yy.c cfg.tab.c #lexx, yacc etc
44 46
 auto_gen_others=cfg.tab.h  # auto generated, non-c
... ...
@@ -46,6 +48,10 @@ auto_gen_others=cfg.tab.h  # auto generated, non-c
46 46
 #include  source related defs
47 47
 include Makefile.sources
48 48
 
49
+# whether or not the entire build process should fail if building a module or
50
+#  an utility fails
51
+err_fail?=1
52
+
49 53
 # whether or not to install ser.cfg or just ser.cfg.default
50 54
 # (ser.cfg will never be overwritten by make install, this is usefull
51 55
 #  when creating packages)
... ...
@@ -62,32 +68,36 @@ doc_format?=html
62 62
 # Make backwards compatible, don't set group_include default...
63 63
 #group_include?="standard"
64 64
 
65
-# Modules in this group are considered a standard part of SER (due to widespread usage)
66
-# but they have no dependencies (note that some of these interplay with external systems.
67
-# However, they don't have compile or link dependencies)
68
-module_group_standard=acc_syslog auth avp avpops ctl dispatcher diversion enum \
65
+# Modules in this group are considered a standard part of SER (due to 
66
+# widespread usage) and have no external compile or link dependencies (note 
67
+# that some of these interplay with external systems).
68
+module_group_standard=acc_syslog auth avp avpops ctl dispatcher diversion enum\
69 69
 				eval exec fifo flatstore gflags maxfwd mediaproxy \
70 70
 				nathelper options pdt permissions pike print ratelimit \
71 71
 				registrar rr sanity sl textops timer tm uac unixsock uri \
72 72
 				usrloc xlog
73 73
 
74
-# Modules in this group are considered a standard part of SER (due to widespread usage)
75
-# but they have dependencies that most be satisfied for compilation
74
+# Modules in this group are considered a standard part of SER (due to 
75
+# widespread usage) but they have dependencies that must be satisfied for 
76
+# compilation.
76 77
 # acc_radius, auth_radius, avp_radius, uri_radius => radiusclient-ng
77
-# acc_db, auth_db, avp_db, db_ops, domain, lcr, msilo, mysql, dialog, postgres, speeddial
78
-# uri_db
79
-#      => mysql server, postgres server or other database back-end (ex. mysql-devel)
78
+# acc_db, auth_db, avp_db, db_ops, domain, lcr, msilo, dialog, speeddial,
79
+# uri_db => database module (mysql, postgres, dbtext)
80
+# mysql, postgres => mysql server and client libraries or postgres server and
81
+#  client libraries or other database back-end (ex. mysql-devel)
80 82
 # pa, xmlrpc => libxml2
81 83
 # rls => pa
82 84
 #
83
-# NOTE! All presence modules (dialog, pa, presence_b2b, rls, xcap) have been included in this
84
-# group due to interdependencies
85
-module_group_standard_dep=acc_db acc_radius auth_db auth_radius avp_db avp_radius \
85
+# NOTE! All presence modules (dialog, pa, presence_b2b, rls, xcap) have been
86
+# included in this group due to interdependencies
87
+module_group_standard_dep=acc_db acc_radius auth_db auth_radius avp_db \
88
+				avp_radius \
86 89
 				db_ops domain lcr msilo mysql dialog pa postgres \
87 90
 				presence_b2b rls speeddial uri_db xcap xmlrpc
88 91
 
89 92
 # For mysql
90
-module_group_mysql=acc_db auth_db avp_db db_ops uri_db domain lcr msilo mysql speeddial
93
+module_group_mysql=acc_db auth_db avp_db db_ops uri_db domain lcr msilo mysql\
94
+				speeddial
91 95
 
92 96
 # For radius
93 97
 module_group_radius=acc_radius auth_radius avp_radius
... ...
@@ -95,21 +105,23 @@ module_group_radius=acc_radius auth_radius avp_radius
95 95
 # For presence
96 96
 module_group_presence=dialog pa presence_b2b rls xcap
97 97
 
98
-# Modules in this group satisfy specific or niche applications, but are considered
99
-# stable for production use. They may or may not have dependencies
98
+# Modules in this group satisfy specific or niche applications, but are 
99
+# considered stable for production use. They may or may not have dependencies
100 100
 # cpl-c => libxml2
101 101
 # jabber => expat (library)
102 102
 # osp => OSP Toolkit (sipfoundry)
103 103
 # sms => none (external modem)
104 104
 module_group_stable=cpl-c dbtext jabber osp sms
105 105
 
106
-# Modules in this group are either not complete, untested, or without enough reports
107
-# of usage to allow the module into the stable group. They may or may not have dependencies
106
+# Modules in this group are either not complete, untested, or without enough
107
+# reports of usage to allow the module into the stable group. They may or may
108
+# not have dependencies
108 109
 module_group_experimental=tls oracle
109 110
 
110 111
 # if not set on the cmd. line or the env, exclude the below modules.
111 112
 ifneq ($(group_include),)
112
-	# For group_include, default all modules are excluded except those in include_modules
113
+	# For group_include, default all modules are excluded except those in 
114
+	# include_modules
113 115
 	exclude_modules?=
114 116
 else
115 117
 	# Old defaults for backwards compatibility
... ...
@@ -172,8 +184,10 @@ static_defs= $(foreach  mod, $(static_modules), \
172 172
 override extra_defs+=$(static_defs) $(EXTRA_DEFS)
173 173
 export extra_defs
174 174
 
175
-# Historically, the resultant set of modules is: modules/* - exclude_modules + include_modules
176
-# When group_include is used, we want: include_modules (based on group_include) - exclude_modules
175
+# Historically, the resultant set of modules is: modules/* - exclude_modules +
176
+# include_modules
177
+# When group_include is used, we want: include_modules (based on group_include)
178
+# - exclude_modules
177 179
 ifneq ($(group_include),)
178 180
 	modules=$(filter-out $(addprefix modules/, \
179 181
 			$(exclude_modules) $(static_modules)), \
... ...
@@ -213,7 +227,8 @@ include Makefile.defs
213 213
 NAME=$(MAIN_NAME)
214 214
 
215 215
 #export relevant variables to the sub-makes
216
-export DEFS PROFILE CC LD MKDEP MKTAGS CFLAGS LDFLAGS INCLUDES MOD_CFLAGS MOD_LDFLAGS 
216
+export DEFS PROFILE CC LD MKDEP MKTAGS CFLAGS LDFLAGS INCLUDES MOD_CFLAGS \
217
+		MOD_LDFLAGS 
217 218
 export LIBS
218 219
 export LEX YACC YACC_FLAGS
219 220
 export PREFIX LOCALBASE
... ...
@@ -274,33 +289,39 @@ print-modules:
274 274
 
275 275
 .PHONY: modules
276 276
 modules:
277
-	-@for r in $(modules) "" ; do \
278
-		if [ -n "$$r" ]; then \
277
+	@for r in $(modules) "" ; do \
278
+		if [ -n "$$r" -a -r "$$r/Makefile" ]; then \
279 279
 			echo  "" ; \
280 280
 			echo  "" ; \
281
-			$(MAKE) -C $$r ; \
281
+			if ! $(MAKE) -C $$r && [ ${err_fail} = 1 ] ; then \
282
+				exit 1; \
283
+			fi ; \
282 284
 		fi ; \
283
-	done 
285
+	done; true
284 286
 
285 287
 $(extra_objs):
286
-	-@echo "Extra objs: $(extra_objs)" 
287
-	-@for r in $(static_modules_path) "" ; do \
288
-		if [ -n "$$r" ]; then \
288
+	@echo "Extra objs: $(extra_objs)" 
289
+	@for r in $(static_modules_path) "" ; do \
290
+		if [ -n "$$r" -a -r "$$r/Makefile"  ]; then \
289 291
 			echo  "" ; \
290 292
 			echo  "Making static module $r" ; \
291
-			$(MAKE) -C $$r static ; \
293
+			if ! $(MAKE) -C $$r static ; then  \
294
+				exit 1; \
295
+			fi ;  \
292 296
 		fi ; \
293
-	done 
297
+	done
294 298
 
295 299
 .PHONY: utils
296 300
 utils:
297
-	-@for r in $(utils_compile) "" ; do \
301
+	@for r in $(utils_compile) "" ; do \
298 302
 		if [ -n "$$r" ]; then \
299 303
 			echo  "" ; \
300 304
 			echo  "" ; \
301
-			$(MAKE) -C $$r ; \
305
+			if ! $(MAKE) -C $$r && [ ${err_fail} = 1 ] ; then \
306
+				exit 1; \
307
+			fi ; \
302 308
 		fi ; \
303
-	done 
309
+	done; true
304 310
 
305 311
 
306 312
 dbg: ser
... ...
@@ -440,7 +461,7 @@ install-bin: $(bin-prefix)/$(bin-dir)
440 440
 		$(INSTALL-BIN) ser $(bin-prefix)/$(bin-dir)
441 441
 
442 442
 install-modules: modules $(modules-prefix)/$(modules-dir)
443
-	-@for r in $(modules_full_path) "" ; do \
443
+	@for r in $(modules_full_path) "" ; do \
444 444
 		if [ -n "$$r" ]; then \
445 445
 			if [ -f "$$r" ]; then \
446 446
 				$(INSTALL-TOUCH) \
... ...
@@ -448,12 +469,15 @@ install-modules: modules $(modules-prefix)/$(modules-dir)
448 448
 				$(INSTALL-MODULES)  "$$r"  $(modules-prefix)/$(modules-dir) ; \
449 449
 			else \
450 450
 				echo "ERROR: module $$r not compiled" ; \
451
+				if [ ${err_fail} = 1 ] ; then \
452
+					exit 1; \
453
+				fi ; \
451 454
 			fi ;\
452 455
 		fi ; \
453
-	done 
456
+	done; true
454 457
 
455 458
 install-utils: utils $(bin-prefix)/$(bin-dir)
456
-	-@for r in $(utils_install) "" ; do \
459
+	@for r in $(utils_install) "" ; do \
457 460
 		if [ -n "$$r" ]; then \
458 461
 			if [ -f "$$r" ]; then \
459 462
 				$(INSTALL-TOUCH) \
... ...
@@ -461,9 +485,12 @@ install-utils: utils $(bin-prefix)/$(bin-dir)
461 461
 				$(INSTALL-BIN)  "$$r"  $(bin-prefix)/$(bin-dir) ; \
462 462
 			else \
463 463
 				echo "ERROR: $$r not compiled" ; \
464
+				if [ ${err_fail} = 1 ] ; then \
465
+					exit 1; \
466
+				fi ; \
464 467
 			fi ;\
465 468
 		fi ; \
466
-	done 
469
+	done; true
467 470
 
468 471
 
469 472
 
... ...
@@ -484,7 +511,7 @@ install-doc: $(doc-prefix)/$(doc-dir) install-modules-doc
484 484
 
485 485
 
486 486
 install-modules-doc: $(doc-prefix)/$(doc-dir)
487
-	-@for r in $(modules_basenames) "" ; do \
487
+	@for r in $(modules_basenames) "" ; do \
488 488
 		if [ -n "$$r" ]; then \
489 489
 			if [ -f modules/"$$r"/README ]; then \
490 490
 				$(INSTALL-TOUCH)  $(doc-prefix)/$(doc-dir)/README ; \
... ...
@@ -532,7 +559,8 @@ export INSTALL-TOUCH
532 532
 dep_mods = $(filter $(addprefix modules/, $(lib_dependent_modules)), $(modules))
533 533
 dep_mods += $(filter $(lib_dependent_modules), $(static_modules))
534 534
 
535
-# make 'modules' dependent on libraries if there are modules which need them (experimental)
535
+# make 'modules' dependent on libraries if there are modules which need them 
536
+# (experimental)
536 537
 ifneq ($(strip $(dep_mods)),)
537 538
 modules:	libs
538 539