Browse code

Makefile.modules: SER_MOD_INTERFACE/KAMAILIO_MOD_INTERFACE cleanup after commit #1f70d062b0b9cf1e

Henning Westerholt authored on 07/10/2018 07:27:30
Showing 1 changed files
... ...
@@ -61,13 +61,6 @@ override static_modules_path=
61 61
 DEFS += -DMOD_NAME='"$(MOD_NAME)"'
62 62
 
63 63
 
64
-ifeq (,$(findstring -DSER_MOD_INTERFACE, $(DEFS)))
65
-	MODIFACE=-DKAMAILIO_MOD_INTERFACE
66
-else
67
-	MODIFACE=-DSER_MOD_INTERFACE
68
-endif
69
-
70
-
71 64
 ifneq ($(makefile_defs_included),1)
72 65
 $(error "the local makefile does not include Makefile.defs!")
73 66
 endif
Browse code

core: Makefiles - catch unavailbility of docbook2man tool

- print an info message instead of ending up in execution error of
Makefile rule trying to generate man pages from xml files
- DOCBOOK var renamed to DOCBOOKMAN to be more suggestive for its
purpose
- related to GH #1624

Daniel-Constantin Mierla authored on 31/08/2018 10:43:44
Showing 1 changed files
... ...
@@ -278,16 +278,17 @@ endif
278 278
 
279 279
 #man page build rules
280 280
 ifneq (,$(wildcard $(MOD_NAME).xml))
281
-
281
+ifneq ($(DOCBOOKMAN),)
282 282
 $(MOD_NAME).7: $(MOD_NAME).xml
283
-	$(DOCBOOK) -s ../../../doc/stylesheets/serdoc2man.xsl $<
283
+	$(DOCBOOKMAN) -s ../../../doc/stylesheets/serdoc2man.xsl $<
284 284
 
285 285
 man: $(MOD_NAME).7
286
-
287 286
 else
288
-
289 287
 man:
290
-
288
+	@echo "info - no docbook to man tool to convert $(MOD_NAME).xml"
289
+endif
290
+else
291
+man:
291 292
 endif
292 293
 
293 294
 
Browse code

Revert "Makefile.modules: add cfg files in module docs also to Makefile, to re-create README on changes"

- This reverts commit 91c36a1a9251bdd775370878437fcc1293b85ea9.
- needs more testing, will not work for some modules

Henning Westerholt authored on 13/04/2018 15:57:07
Showing 1 changed files
... ...
@@ -266,7 +266,7 @@ $(share_prefix)/$(share_dir):
266 266
 ifneq (,$(wildcard doc/Makefile))
267 267
 #doc/Makefile present => we can generate README
268 268
 
269
-README: doc/*.xml doc/*.cfg ../../../doc/docbook/entities.xml
269
+README: doc/*.xml ../../../doc/docbook/entities.xml
270 270
 	$(MAKE) -C doc $(MOD_NAME).txt
271 271
 	mv doc/$(MOD_NAME).txt $@
272 272
 
Browse code

Makefile.modules: add cfg files in module docs also to Makefile, to re-create README on changes

Henning Westerholt authored on 13/04/2018 15:47:21
Showing 1 changed files
... ...
@@ -266,7 +266,7 @@ $(share_prefix)/$(share_dir):
266 266
 ifneq (,$(wildcard doc/Makefile))
267 267
 #doc/Makefile present => we can generate README
268 268
 
269
-README: doc/*.xml ../../../doc/docbook/entities.xml
269
+README: doc/*.xml doc/*.cfg ../../../doc/docbook/entities.xml
270 270
 	$(MAKE) -C doc $(MOD_NAME).txt
271 271
 	mv doc/$(MOD_NAME).txt $@
272 272
 
Browse code

doc, modules: updated the path to docbook entities and spec files

Daniel-Constantin Mierla authored on 07/12/2016 14:24:32
Showing 1 changed files
... ...
@@ -266,7 +266,7 @@ $(share_prefix)/$(share_dir):
266 266
 ifneq (,$(wildcard doc/Makefile))
267 267
 #doc/Makefile present => we can generate README
268 268
 
269
-README: doc/*.xml ../../../docbook/entities.xml
269
+README: doc/*.xml ../../../doc/docbook/entities.xml
270 270
 	$(MAKE) -C doc $(MOD_NAME).txt
271 271
 	mv doc/$(MOD_NAME).txt $@
272 272
 
Browse code

Makefile: updated paths for installing the tools

Daniel-Constantin Mierla authored on 07/12/2016 12:21:01
Showing 1 changed files
... ...
@@ -266,7 +266,7 @@ $(share_prefix)/$(share_dir):
266 266
 ifneq (,$(wildcard doc/Makefile))
267 267
 #doc/Makefile present => we can generate README
268 268
 
269
-README: doc/*.xml ../../docbook/entities.xml
269
+README: doc/*.xml ../../../docbook/entities.xml
270 270
 	$(MAKE) -C doc $(MOD_NAME).txt
271 271
 	mv doc/$(MOD_NAME).txt $@
272 272
 
... ...
@@ -280,7 +280,7 @@ endif
280 280
 ifneq (,$(wildcard $(MOD_NAME).xml))
281 281
 
282 282
 $(MOD_NAME).7: $(MOD_NAME).xml
283
-	$(DOCBOOK) -s ../../doc/stylesheets/serdoc2man.xsl $<
283
+	$(DOCBOOK) -s ../../../doc/stylesheets/serdoc2man.xsl $<
284 284
 
285 285
 man: $(MOD_NAME).7
286 286
 
Browse code

core, lib, modules: restructured source code tree

- new folder src/ to hold the source code for main project applications
- main.c is in src/
- all core files are subfolder are in src/core/
- modules are in src/modules/
- libs are in src/lib/
- application Makefiles are in src/
- application binary is built in src/ (src/kamailio)

Daniel-Constantin Mierla authored on 07/12/2016 11:03:51
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,299 @@
1
+# Kamailio build system
2
+#
3
+# module Makefile
4
+#(to be included from each module)
5
+#
6
+#
7
+
8
+#
9
+# Variables that should be defined in the modules, prior to including
10
+# this makefile:
11
+#
12
+# NAME - module binary name, complete with .so and no path (MUST).
13
+#
14
+# COREPATH - path to the main/core directory (OPTIONAL, default ../..)
15
+#
16
+# DEFS - per module extra defines (OPTIONAL)
17
+#
18
+# LIBS - per module extra libs (OPTIONAL)
19
+#
20
+# SER_LIBS - ser/sr libs that should be compiled, linked against and installed
21
+#           along the module. The format is: <path>/<shortname>, e.g.
22
+#           SER_LIBS=../../lib/srdb2/srdb2 for libsrdb2 with the sources
23
+#            in ../../lib/srdb2. (OPTIONAL)
24
+#
25
+# MOD_INSTALL_UTILS - list of utils directories that should be compiled and
26
+#                     installed along the module. The utils must know how to
27
+#                     install themselves (make install).
28
+#                     E.g.: MOD_INSTALL_UTILS=../../utils/sercmd
29
+#                     (OPTIONAL)
30
+#
31
+# MOD_INSTALL_SCRIPTS - list of scripts (complete path including the file name)
32
+#                       that should be installed along the module.
33
+#                       E.g.: MOD_INSTALL_SCRIPTS=../../scripts/foo/foo.sh
34
+#                       (OPTIONAL)
35
+#
36
+# MOD_INSTALL_CFGS - list of extra config files that should be installed in
37
+#                    the main config directory, along the module (OPTIONAL).
38
+#
39
+# MOD_INSTALL_SHARE - list of files to install into the arch-independent
40
+#                     shared directory (by default
41
+#                     /usr/local/share/$(MAIN_NAME))
42
+#
43
+
44
+MOD_NAME=$(NAME:.so=)
45
+
46
+# allow placing modules in separate directory apart from ser core
47
+COREPATH ?=../..
48
+
49
+ALLDEP=Makefile $(COREPATH)/Makefile.sources $(COREPATH)/Makefile.rules \
50
+ $(COREPATH)/Makefile.modules $(COREPATH)/Makefile.dirs $(COREPATH)/config.mak
51
+
52
+#override modules value, a module cannot have submodules
53
+override modules=
54
+override static_modules=
55
+override static_modules_path=
56
+
57
+# should be set in the Makefile of each module
58
+# INCLUDES += -I$(COREPATH)
59
+
60
+# temporary def (visible only in the module, not exported)
61
+DEFS += -DMOD_NAME='"$(MOD_NAME)"'
62
+
63
+
64
+ifeq (,$(findstring -DSER_MOD_INTERFACE, $(DEFS)))
65
+	MODIFACE=-DKAMAILIO_MOD_INTERFACE
66
+else
67
+	MODIFACE=-DSER_MOD_INTERFACE
68
+endif
69
+
70
+
71
+ifneq ($(makefile_defs_included),1)
72
+$(error "the local makefile does not include Makefile.defs!")
73
+endif
74
+
75
+ifeq ($(MAKELEVEL), 0)
76
+# make called directly in the module dir!
77
+
78
+#$(warning "you should run make from the main ser directory")
79
+
80
+else
81
+# called by the main Makefile
82
+
83
+ALLDEP+=$(COREPATH)/Makefile
84
+
85
+endif
86
+
87
+include $(COREPATH)/Makefile.sources
88
+
89
+
90
+# if config was not loaded (makefile_defs!=1) ignore
91
+# the rest of makefile and try only to remake the config
92
+ifeq ($(makefile_defs),1)
93
+
94
+ifeq (,$(filter $(MOD_NAME), $(static_modules)))
95
+CFLAGS:=$(MOD_CFLAGS)
96
+LDFLAGS:=$(MOD_LDFLAGS)
97
+endif
98
+
99
+
100
+err_fail?=1
101
+
102
+include $(COREPATH)/Makefile.dirs
103
+include $(COREPATH)/Makefile.targets
104
+include $(COREPATH)/Makefile.rules
105
+include $(COREPATH)/Makefile.shared
106
+
107
+# default: if not overwritten by the main Makefile, install in modules
108
+mods_dst=$(modules_prefix)/$(modules_dir)/modules
109
+
110
+$(mods_dst):
111
+		mkdir -p $(mods_dst)
112
+
113
+LIBS:=$(filter-out -ldl -lresolv, $(LIBS))
114
+
115
+
116
+.PHONY: install
117
+.PHONY: install-libs
118
+.PHONY: install-utils
119
+.PHONY: install-scripts
120
+.PHONY: install-cfgs
121
+install: $(NAME) $(mods_dst) install-libs install-utils install-scripts \
122
+		install-cfg install-share
123
+	$(INSTALL_TOUCH) $(mods_dst)/$(NAME)
124
+	$(INSTALL_MODULES)  $(NAME)  $(mods_dst)
125
+
126
+ifneq (,$(SER_LIBS))
127
+install-libs:
128
+	@for lib in $(dir $(SER_LIBS)) ; do \
129
+		$(call try_err, $(MAKE) -C "$${lib}" install-if-newer ) ;\
130
+	done; true
131
+
132
+else
133
+install-libs:
134
+
135
+endif # $(SER_LIBS)
136
+
137
+.PHONY: utils
138
+.PHONY: clean-utils
139
+.PHONY: proper-utils
140
+.PHONY: distclean-utils
141
+.PHONY: realclean-utils
142
+.PHONY: maintainer-clean-utils
143
+ifneq (,$(MOD_INSTALL_UTILS))
144
+install-utils:
145
+	@for ut in $(MOD_INSTALL_UTILS) ; do \
146
+		$(call try_err, $(MAKE) -C "$${ut}" install-if-newer ) ;\
147
+	done; true
148
+
149
+utils:
150
+	@for r in $(MOD_INSTALL_UTILS) ; do \
151
+		$(call try_err, $(MAKE) -C "$$r" ) ;\
152
+	done; true
153
+
154
+clean-utils:
155
+	@for r in $(MOD_INSTALL_UTILS) ; do \
156
+		if [ -d "$$r" ]; then \
157
+			 $(MAKE) -C "$$r" clean ; \
158
+		fi ; \
159
+	done
160
+
161
+proper-utils realclean-utils distclean-utils maintainer-clean-utils: \
162
+ clean_target=$(patsubst %-utils,%,$@)
163
+proper-utils realclean-utils distclean-utils maintainer-clean-utils:
164
+	@for r in $(MOD_INSTALL_UTILS) ; do \
165
+		if [ -d "$$r" ]; then \
166
+			 $(MAKE) -C "$$r" $(clean_target); \
167
+		fi ; \
168
+	done
169
+
170
+else
171
+# ! MOD_INSTALL_UTILS
172
+install-utils:
173
+utils:
174
+clean-utils:
175
+proper-utils realclean-utils distclean-utils maintainer-clean-utils:
176
+
177
+endif # $(MOD_INSTALL_UTILS)
178
+
179
+ifneq (,$(MOD_INSTALL_SCRIPTS))
180
+install-scripts: $(bin_prefix)/$(bin_dir)
181
+	@for r in $(MOD_INSTALL_SCRIPTS) ; do \
182
+		if [ -n "$$r" ]; then \
183
+			if [ -f "$$r" ]; then \
184
+				$(call try_err, $(INSTALL_TOUCH) \
185
+					$(bin_prefix)/$(bin_dir)/`basename "$$r"` ); \
186
+				$(call try_err,\
187
+					$(INSTALL_SCRIPT)  "$$r"  $(bin_prefix)/$(bin_dir) ); \
188
+			else \
189
+				echo "ERROR: $$r not found" ; \
190
+				if [ ${err_fail} = 1 ] ; then \
191
+					exit 1; \
192
+				fi ; \
193
+			fi ; \
194
+		fi ; \
195
+	done; true
196
+
197
+else
198
+install-scripts:
199
+
200
+endif # $(MOD_INSTALL_SCRIPTS)
201
+
202
+ifneq (,$(MOD_INSTALL_CFGS))
203
+install-cfg: $(cfg_prefix)/$(cfg_dir)
204
+	@for r in $(MOD_INSTALL_CFGS) ; do \
205
+		if [ -n "$$r" ]; then \
206
+			if [ -f "$$r" ]; then \
207
+				n=`basename "$$r"` ; \
208
+				$(call try_err, $(INSTALL_TOUCH) \
209
+					"$(cfg_prefix)/$(cfg_dir)/$$n.sample" ); \
210
+				$(call try_err,\
211
+					$(INSTALL_CFG)  "$$r"  \
212
+						"$(cfg_prefix)/$(cfg_dir)/$$n.sample"); \
213
+				if [ -z "${skip_cfg_install}" -a \
214
+						! -f "$(cfg_prefix)/$(cfg_dir)$$n" ]; then \
215
+					mv -f $(cfg_prefix)/$(cfg_dir)$$n.sample \
216
+						$(cfg_prefix)/$(cfg_dir)$$n; \
217
+				fi ; \
218
+			else \
219
+				echo "ERROR: $$r not found" ; \
220
+				if [ ${err_fail} = 1 ] ; then \
221
+					exit 1; \
222
+				fi ; \
223
+			fi ; \
224
+		fi ; \
225
+	done; true
226
+
227
+else
228
+install-cfg:
229
+
230
+endif # $(MOD_INSTALL_CFGS)
231
+
232
+ifneq (,$(MOD_INSTALL_SHARE))
233
+install-share: $(share_prefix)/$(share_dir)
234
+	@for r in $(MOD_INSTALL_SHARE) ; do \
235
+		if [ -n "$$r" ]; then \
236
+			if [ -f "$$r" ]; then \
237
+				$(call try_err, $(INSTALL_TOUCH) \
238
+					$(share_prefix)/$(share_dir)/`basename "$$r"` ); \
239
+				$(call try_err,\
240
+					$(INSTALL_SHARE)  "$$r"  $(share_prefix)/$(share_dir) ); \
241
+			else \
242
+				echo "ERROR: $$r not found" ; \
243
+				if [ ${err_fail} = 1 ] ; then \
244
+					exit 1; \
245
+				fi ; \
246
+			fi ; \
247
+		fi ; \
248
+	done; true
249
+
250
+else
251
+install-share:
252
+
253
+endif # $(MOD_INSTALL_SHARE)
254
+
255
+
256
+$(bin_prefix)/$(bin_dir):
257
+	mkdir -p $@
258
+
259
+$(cfg_prefix)/$(cfg_dir):
260
+	mkdir -p $@
261
+
262
+$(share_prefix)/$(share_dir):
263
+	mkdir -p $@
264
+
265
+# README build rules
266
+ifneq (,$(wildcard doc/Makefile))
267
+#doc/Makefile present => we can generate README
268
+
269
+README: doc/*.xml ../../docbook/entities.xml
270
+	$(MAKE) -C doc $(MOD_NAME).txt
271
+	mv doc/$(MOD_NAME).txt $@
272
+
273
+else
274
+# do nothing
275
+
276
+README:
277
+endif
278
+
279
+#man page build rules
280
+ifneq (,$(wildcard $(MOD_NAME).xml))
281
+
282
+$(MOD_NAME).7: $(MOD_NAME).xml
283
+	$(DOCBOOK) -s ../../doc/stylesheets/serdoc2man.xsl $<
284
+
285
+man: $(MOD_NAME).7
286
+
287
+else
288
+
289
+man:
290
+
291
+endif
292
+
293
+
294
+printmiface:
295
+	@echo -n $(MODIFACE)
296
+
297
+endif # ifeq($(makefile_defs),1)
298
+
299
+include $(COREPATH)/Makefile.cfg