Browse code

makefile: fix make cfg when the cfg vars are already exported

- when make cfg was called with the cfg vars already exported it
failed to generate a proper config.mak (e.g. called from
make deb)
- extra config sanity check
- s/mysql/db_mysql in the mysql module group
- added "deb" to the list of targets that don't need dependencies
(minor optimization)

Andrei Pelinescu-Onciul authored on 08/07/2009 15:31:56
Showing 3 changed files
... ...
@@ -156,8 +156,8 @@ module_group_standard_dep=acc_db acc_radius auth_db auth_radius avp_db \
156 156
 				presence_b2b rls speeddial uri_db xcap xmlrpc
157 157
 
158 158
 # For mysql
159
-module_group_mysql=acc_db auth_db avp_db db_ops uri_db domain lcr msilo mysql\
160
-				speeddial
159
+module_group_mysql=acc_db auth_db avp_db db_ops db_mysql uri_db domain lcr \
160
+					msilo speeddial
161 161
 
162 162
 # For radius
163 163
 module_group_radius=acc_radius auth_radius avp_radius misc_radius peering
... ...
@@ -264,6 +264,9 @@ ifeq ($(makefile_defs),1)
264 264
 $(info config.mak loaded)
265 265
 # config_make valid & used
266 266
 config_mak=1
267
+ifeq ($(MAIN_NAME),)
268
+$(error "bad config.mak, try re-running make cfg")
269
+endif
267 270
 endif
268 271
 else # config.mak doesn't need to be used
269 272
 ifneq (,$(filter cfg config cfg-defs,$(word 1,$(MAKECMDGOALS))))
... ...
@@ -273,6 +276,9 @@ ifneq (,$(filter cfg config cfg-defs,$(word 1,$(MAKECMDGOALS))))
273 273
 # $(value ...) expansion or would cause some warning (if Makefile.defs exec. 
274 274
 # is skipped in the "main" makefile invocation).
275 275
 $(shell rm -rf config.mak)
276
+config_mak=0
277
+makefile_defs=0
278
+exported_vars=0
276 279
 endif
277 280
 endif
278 281
 
... ...
@@ -14,6 +14,7 @@
14 14
 #create config if needed
15 15
 $(COREPATH)/config.mak: makefile_defs=0
16 16
 $(COREPATH)/config.mak: exported_vars=0
17
+$(COREPATH)/config.mak: config_mak=0
17 18
 
18 19
 $(COREPATH)/config.mak: $(COREPATH)/Makefile.defs
19 20
 	$(MAKE) -wC $(COREPATH) cfg-defs
... ...
@@ -35,7 +35,7 @@ doc_targets:=	README man install-doc install-man install-ser-man \
35 35
 # auxiliary: maintance, debugging, etc. (don't affect code/objects)
36 36
 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
-		modules-list modules-lst mk-install_dirs autover.h
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 40
 ext_targets:=	every-module $(modules_dirs) libs utils \
41 41
 		install-cfg install-utils  install-modules-all install-every-module\