Browse code

better modules handling; fixed debian packaging

Stefan Sayer authored on 19/06/2010 19:21:56
Showing 2 changed files
... ...
@@ -1,21 +1,46 @@
1 1
 COREPATH ?= ../core
2 2
 .DEFAULT_GOAL := all
3 3
 
4
+local_exclude_app_modules=$(exclude_app_modules)
5
+
4 6
 include $(COREPATH)/../Makefile.defs
5 7
 
6
-exclude_app_modules += mp3 examples py_sems xmlrpc2di gateway jsonrpc
7 8
 
8
-ifneq ($(USE_MONITORING), yes)
9
-exclude_app_modules += monitoring
10
-endif
9
+# modules...
10
+
11
+# if app_modules is set 
12
+#   make $(app_modules)
13
+# else 
14
+#   if exclude_app_modules is set
15
+#     make * - $(exclude_app_modules)
16
+#   else
17
+#     make * - Makefile.defs:exclude_app_modules +  local excludes
18
+#   
19
+
20
+ifneq ($(app_modules),)
21
+ app_modules = $(app_modules)
22
+else
23
+ ifneq ($(local_exclude_app_modules),)
24
+   exclude_app_modules = $(local_exclude_app_modules)
25
+ else
26
+   exclude_app_modules += mp3 examples py_sems xmlrpc2di gateway jsonrpc
27
+
28
+   ifneq ($(USE_MONITORING), yes)
29
+   exclude_app_modules += monitoring
30
+   endif
31
+
32
+ endif
11 33
 
12
-$(info exclude_app_modules: $(exclude_app_modules))
13
-app_modules = $(filter-out $(subst ;, ,$(exclude_app_modules))\
34
+ $(info local_exclude_app_modules: $(local_exclude_app_modules))
35
+ $(info exclude_app_modules: $(exclude_app_modules))
36
+ app_modules = $(filter-out $(subst ;, ,$(exclude_app_modules))\
14 37
 		$(wildcard Makefile*) CVS CMakeLists.txt, \
15 38
 		$(wildcard *) examples/tutorial/cc_acc )
16
-$(info app_modules: $(app_modules))
17 39
 
18
-#modules = wav gsm ilbc bot echo announcement recorder voicemail dtmf_demo ivr
40
+endif
41
+
42
+
43
+$(info app_modules: $(app_modules))
19 44
 
20 45
 .PHONY: all
21 46
 all: modules
... ...
@@ -17,13 +17,9 @@ export DH_VERBOSE=1
17 17
 #  force no striping (always include debug symbols for now)
18 18
 export DEB_BUILD_OPTIONS:="$(DEB_BUILD_OPTIONS) nostrip"
19 19
 
20
-
21
-
22
-
23
-
24 20
 PYTHON_MODULES=ivr py_sems conf_auth mailbox pin_collect
25 21
 
26
-EXCLUDED_MODULES=mp3 examples gateway
22
+EXTRA_APP_MODULES=xmlrpc2di jsonrpc
27 23
 
28 24
 CPPFLAGS += -DHAVE_XMLRPCPP_SSL 
29 25
 # for older than lenny add:
... ...
@@ -49,7 +45,8 @@ build-stamp: configure-stamp
49 45
 	dh_testdir
50 46
 
51 47
 # Add here commands to compile the package.
52
-	USE_SPANDSP=yes CPPFLAGS="$(CPPFLAGS)" $(MAKE) cfg-target=/etc/sems/ prefix=/usr exclude_modules="$(EXCLUDED_MODULES)" DESTDIR=$(CURDIR)/debian/sems 
48
+	USE_SPANDSP=yes CPPFLAGS="$(CPPFLAGS)" $(MAKE) \
49
+	cfg-target=/etc/sems/ prefix=/usr exclude_app_modules="$(EXCLUDED_MODULES)" DESTDIR=$(CURDIR)/debian/sems
53 50
 #/usr/bin/docbook-to-man debian/ser.sgml > ser.1
54 51
 
55 52
 	touch build-stamp
... ...
@@ -70,13 +67,13 @@ install: build
70 67
 	dh_installdirs
71 68
 
72 69
 # Add here commands to install the package into debian/sems
73
-	$(MAKE) -C core/ exclude_modules="$(EXCLUDED_MODULES)" install \
70
+	$(MAKE) -C core/ install \
74 71
 		DESTDIR=$(CURDIR)/debian/sems \
75 72
 		prefix=/usr \
76 73
 		cfg-target=/etc/sems/
77 74
 
78 75
 
79
-	$(MAKE) -C apps/ install exclude_modules="$(EXCLUDED_MODULES) $(PYTHON_MODULES)" \
76
+	$(MAKE) -C apps/ install exclude_app_modules="$(EXCLUDED_MODULES) $(PYTHON_MODULES)" \
80 77
 		DESTDIR=$(CURDIR)/debian/sems \
81 78
 		prefix=/usr \
82 79
 		cfg-target=/etc/sems/