Browse code

makefile: more modules groups and make modules-all

- added more module groups (db, mysql_driver, postgres_driver)
- cleaned up module groups usage (replaced a lot of ifs with a
foreach)
- modules-all is now a synonym for every-module

Andrei Pelinescu-Onciul authored on 08/07/2009 16:41:38
Showing 3 changed files
... ...
@@ -171,7 +171,11 @@ Compile SIP Router core only:
171 171
 make   #builds only sip-router core, equivalent to make sip-router
172 172
 
173 173
 Compile modules except some explicitly excepted (see below)
174
-make modules  
174
+make modules  - all modules in the modules/ directory (common modules)
175
+make modules_s - all modules in the modules_s/ directory (ser modules)
176
+make modules_k - all modules in the modules_k/ directory (kamailio modules)
177
+make modules-all or make every-module  - all the modules (modules, modules_s
178
+                                         and module_k)
175 179
 
176 180
 Compile all:
177 181
 make all
... ...
@@ -189,7 +193,12 @@ standard - Modules in this group are considered a standard part of SIP Router (d
189 189
     but they have no dependencies (note that some of these interplay with external systems.
190 190
     However, they don't have compile or link dependencies).
191 191
 
192
-standard-dep -  Modules in this group are considered a standard part of SIP Router (due to widespread usage)
192
+db - Modules in this group use databases and need a database driver to run.
193
+     Included are drivers for the text mode db (dbtext) and for dumping
194
+     large ammount of data to files (db_flatstore). See also the mysql or
195
+     postgres groups.
196
+
197
+standard_dep -  Modules in this group are considered a standard part of SIP Router (due to widespread usage)
193 198
     but they have dependencies that most be satisfied for compilation.
194 199
     NOTE! All presence modules (dialog, pa, presence_b2b, rls, xcap) have been included in this
195 200
     group due to interdependencies
... ...
@@ -208,7 +217,9 @@ make group_include="standard standard-dep stable experimental" all
208 208
 
209 209
 There are also in addition some "convenience" groups:
210 210
 
211
-mysql - Include all modules dependent on mysql
211
+mysql - Include all the db modules dependent and the mysql db driver
212
+
213
+postgres - Include all the db modules and the postgres db driver
212 214
 
213 215
 radius - Include all modules on radiusclient
214 216
 
... ...
@@ -155,9 +155,17 @@ module_group_standard_dep=acc_db acc_radius auth_db auth_radius avp_db \
155 155
 				db_ops domain lcr msilo mysql dialog pa postgres \
156 156
 				presence_b2b rls speeddial uri_db xcap xmlrpc
157 157
 
158
+# For db use (db modules, excluding drivers)
159
+module_group_db=acc_db auth_db avp_db db_ops db_flatstore dbtext db_text \
160
+				uri_db domain lcr msilo speeddial
161
+
158 162
 # For mysql
159
-module_group_mysql=acc_db auth_db avp_db db_ops db_mysql uri_db domain lcr \
160
-					msilo speeddial
163
+module_group_mysql_driver=db_mysql
164
+module_group_mysql=$(module_group_mysql_driver) $(module_group_db)
165
+
166
+# For postgress
167
+module_group_postgres_driver=db_postgres
168
+module_group_postgres=$(module_group_postgres_driver) $(module_group_db)
161 169
 
162 170
 # For radius
163 171
 module_group_radius=acc_radius auth_radius avp_radius misc_radius peering
... ...
@@ -212,32 +220,9 @@ endif
212 212
 override exclude_modules+= CVS $(skip_modules)
213 213
 
214 214
 # Test for the groups and add to include_modules
215
-ifneq (,$(findstring standard,$(group_include)))
216
-	override include_modules+= $(module_group_standard)
217
-endif
218
-
219
-ifneq (,$(findstring standard-dep,$(group_include)))
220
-	override include_modules+= $(module_group_standard_dep)
221
-endif
222
-
223
-ifneq (,$(findstring mysql,$(group_include)))
224
-	override include_modules+= $(module_group_mysql)
225
-endif
226
-
227
-ifneq (,$(findstring radius,$(group_include)))
228
-	override include_modules+= $(module_group_radius)
229
-endif
230
-
231
-ifneq (,$(findstring presence,$(group_include)))
232
-	override include_modules+= $(module_group_presence)
233
-endif
234
-
235
-ifneq (,$(findstring stable,$(group_include)))
236
-	override include_modules+= $(module_group_stable)
237
-endif
238
-
239
-ifneq (,$(findstring experimental,$(group_include)))
240
-	override include_modules+= $(module_group_experimental)
215
+ifneq (,$(group_include))
216
+override include_modules+=$(foreach grp, $(group_include), \
217
+								$(module_group_$(grp)) )
241 218
 endif
242 219
 
243 220
 # first 2 lines are excluded because of the experimental or incomplete
... ...
@@ -627,7 +612,7 @@ $(foreach mods,$(modules_dirs),$(eval $(call MODULES_RULES_template,$(mods))))
627 627
 #$(foreach mods,$(modules_dirs),$(eval  $(info DUMP: $(call MODULES_RULES_template,$(mods)))))
628 628
 
629 629
 # build all the modules
630
-every-module: $(modules_dirs)
630
+modules-all every-module: $(modules_dirs)
631 631
 
632 632
 $(extra_objs):
633 633
 	@echo "Extra objs: $(extra_objs)" 
... ...
@@ -37,7 +37,7 @@ aux_targets:=	TAGS tar dist cfg-defs cfg config config.mak print-modules \
37 37
 		dbg dbinstall librpath.lst makecfg.lst modules.lst modules-cfg \
38 38
 		modules-list modules-lst mk-install_dirs autover.h deb
39 39
 # other targets that don't produce code in the current directory ("external")
40
-ext_targets:=	every-module $(modules_dirs) libs utils \
40
+ext_targets:=	every-module modules-all $(modules_dirs) libs utils \
41 41
 		install-cfg install-utils  install-modules-all install-every-module\
42 42
 		$(foreach m,$(modules_dirs),install-$(m)) \
43 43
 		install-share