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
deleted file mode 100644
... ...
@@ -1,41 +0,0 @@
1
-# Kamailio build system
2
-
3
-# Makefile targets that should be treated specially, 
4
-# e.g.:  non obj/executable affecting targets => don't build dependencies for
5
-#  them or don't try any action that would be useful only for generating
6
-#  actual code
7
-#
8
-
9
-ifeq (,$(strip $(modules_dirs)))
10
-include $(COREPATH)/Makefile.dirs
11
-endif
12
-
13
-clean_targets:=	clean proper distclean-old realclean maintainer-clean local-clean \
14
-				clean-all proper-all distclean-all realclean-all \
15
-				clean_cfg clean-cfg clean_modules_cfg clean-modules-cfg \
16
-				clean-modules proper-modules realclean-modules \
17
-				distclean-modules maintainer-clean-modules \
18
-				clean-utils proper-utils realclean-utils distclean-utils \
19
-				maintaner-clean-utils \
20
-				clean-libs proper-libs realclean-libs distclean-libs \
21
-				maintainer-clean-libs \
22
-				clean-tmp clean_doxygen clean-extra-names \
23
-				pure distclean
24
-doc_targets:=	README man install-doc install-man install-ser-man \
25
-		install-every-module-doc install-every-module-man \
26
-		$(foreach m,$(modules_dirs),$(m)-doc $(m)-readme $(m)-man) \
27
-		$(foreach m,$(modules_dirs),install-$(m)-doc install-$(m)-man)
28
-
29
-# auxiliary: maintance, debugging, etc. (don't affect code/objects)
30
-aux_targets:=	TAGS tar dist cfg-defs cfg config config.mak print-modules \
31
-		dbg dbinstall librpath.lst makecfg.lst modules.lst modules-cfg \
32
-		modules-list modules-lst mk-install_dirs autover.h deb
33
-# other targets that don't produce code in the current directory ("external")
34
-ext_targets:=	every-module modules-all $(modules_dirs) libs utils \
35
-		install-cfg install-utils  install-modules-all install-every-module\
36
-		$(foreach m,$(modules_dirs),install-$(m)) \
37
-		install-share
38
-
39
-# all the targets that don't require code dependecies in the current dir.
40
-nodep_targets:=	$(clean_targets) $(doc_targets) $(aux_targets) $(ext_targets)
41
-
Browse code

Makefile: use distclean as shortcut of maintainer-clean

Fixes: #167
Nowadays people expect distclean to be the rule to do the cleaning

Victor Seva authored on 22/05/2015 11:50:44
Showing 1 changed files
... ...
@@ -10,7 +10,7 @@ ifeq (,$(strip $(modules_dirs)))
10 10
 include $(COREPATH)/Makefile.dirs
11 11
 endif
12 12
 
13
-clean_targets:=	clean proper distclean realclean maintainer-clean local-clean \
13
+clean_targets:=	clean proper distclean-old realclean maintainer-clean local-clean \
14 14
 				clean-all proper-all distclean-all realclean-all \
15 15
 				clean_cfg clean-cfg clean_modules_cfg clean-modules-cfg \
16 16
 				clean-modules proper-modules realclean-modules \
... ...
@@ -19,7 +19,8 @@ clean_targets:=	clean proper distclean realclean maintainer-clean local-clean \
19 19
 				maintaner-clean-utils \
20 20
 				clean-libs proper-libs realclean-libs distclean-libs \
21 21
 				maintainer-clean-libs \
22
-				clean-tmp clean_doxygen clean-extra-names
22
+				clean-tmp clean_doxygen clean-extra-names \
23
+				pure distclean
23 24
 doc_targets:=	README man install-doc install-man install-ser-man \
24 25
 		install-every-module-doc install-every-module-man \
25 26
 		$(foreach m,$(modules_dirs),$(m)-doc $(m)-readme $(m)-man) \
Browse code

build system: Remove SVN ID and history

Olle E. Johansson authored on 10/01/2015 07:57:18
Showing 1 changed files
... ...
@@ -1,17 +1,10 @@
1
+# Kamailio build system
1 2
 
2
-#
3
-# $Id$
4
-#
5
-#
6 3
 # Makefile targets that should be treated specially, 
7 4
 # e.g.:  non obj/executable affecting targets => don't build dependencies for
8 5
 #  them or don't try any action that would be useful only for generating
9 6
 #  actual code
10 7
 #
11
-# History:
12
-# --------
13
-#  2008-06-26  initial version (andrei) 
14
-#
15 8
 
16 9
 ifeq (,$(strip $(modules_dirs)))
17 10
 include $(COREPATH)/Makefile.dirs
Browse code

makefile: FLAVOUR support

Basic support for sip-router, ser and kamailio flavours and
install flavours, e.g.:
make config FLAVOUR=sip-router
make config INSTALL_FLAVOUR=kamailio; make install (will install
only kamailio specific tools, but won't change the main name)
make config FLAVOUR=ser; make install (will install ser tools and
change the name to ser).

Note that FLAVOUR does not influence the module list (one should
use modules_dirs, group_include and/or modules, modules_s,
modules_k) and that for now choosing kamailio will only change the
name.

Andrei Pelinescu-Onciul authored on 09/10/2009 22:38:34
Showing 1 changed files
... ...
@@ -26,7 +26,7 @@ clean_targets:=	clean proper distclean realclean maintainer-clean local-clean \
26 26
 				maintaner-clean-utils \
27 27
 				clean-libs proper-libs realclean-libs distclean-libs \
28 28
 				maintainer-clean-libs \
29
-				clean-tmp clean_doxygen
29
+				clean-tmp clean_doxygen clean-extra-names
30 30
 doc_targets:=	README man install-doc install-man install-ser-man \
31 31
 		install-every-module-doc install-every-module-man \
32 32
 		$(foreach m,$(modules_dirs),$(m)-doc $(m)-readme $(m)-man) \
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 1 changed files
... ...
@@ -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
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 1 changed files
... ...
@@ -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\
Browse code

makefile: auto-generate autover.h based on the git sha

Automatically re-generate autover.h each time some change in the
repository happens. The file will contain a macro (REPO_VER) set
to the first 6 letters of the git sha. This allows unique
identification for the git branch and commits from which the code
was generated.
If the code is not compiled from a git repository, use "unknown"
for the REPO_VER.

Andrei Pelinescu-Onciul authored on 24/06/2009 19:11:24
Showing 1 changed files
... ...
@@ -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
38
+		modules-list modules-lst mk-install_dirs autover.h
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\
Browse code

Merge commit 'origin/ser_core_cvs'

* commit 'origin/ser_core_cvs':
tcp: added missing blacklist on write pollerr
makefiles: minor fix (use COREPATH in Makefile.targets)
makefile: config and modules.lst minor fixes
makefile.doc: support all targets and dep. fixes
doc (INSTALL): minor make update
makefiles: fixes and speed-ups
makefiles: typo fixed

Conflicts:
Makefile.doc
Makefile.rules
Makefile.targets

Andrei Pelinescu-Onciul authored on 23/04/2009 12:33:37
Showing 0 changed files
Browse code

makefile: config and modules.lst minor fixes

- don't build the config on clean (even if not present)
- don't build the modules.lst unless needed (don't build it on
clean, core only make a.s.o)

Andrei Pelinescu-Onciul authored on 22/04/2009 15:09:13
Showing 1 changed files
... ...
@@ -15,7 +15,7 @@
15 15
 
16 16
 clean_targets:=	clean proper distclean realclean maintainer-clean local-clean \
17 17
 				clean-all proper-all distclean-all realclean-all \
18
-				clean_cfg clean_modules_cfg clean-modules-cfg \
18
+				clean_cfg clean-cfg clean_modules_cfg clean-modules-cfg \
19 19
 				clean-modules proper-modules realclean-modules \
20 20
 				distclean-modules maintainer-clean-modules \
21 21
 				clean-utils proper-utils realclean-utils distclean-utils \
... ...
@@ -28,7 +28,8 @@ doc_targets:=	modules-doc modules-readme README modules-man man \
28 28
 		install-modules-man
29 29
 # auxiliary: maintance, debugging, etc. (don't affect code/objects)
30 30
 aux_targets:=	TAGS tar dist cfg-defs cfg config config.mak print-modules \
31
-		dbg dbinstall librpath.lst makecfg.lst modules.lst
31
+		dbg dbinstall librpath.lst makecfg.lst modules.lst modules-cfg \
32
+		modules-list modules-lst
32 33
 # other targets that don't produce code in the current directory ("external")
33 34
 ext_targets:=	modules libs utils \
34 35
 		install-cfg install-modules install-utils  install-modules-all \
Browse code

makefiles: fixes and speed-ups

- make clean, proper, realclean, distclean and maintainer-clean
will work on all the libs in the lib/ directory.
- clean, proper, realclean, distclean and maintainer-clean targets
split into more specific targets: local-clean, clean-modules,
clean-libs, clean-utils (and the same for the others) => make
proper & friends depend now only on the really needed parts =>
much faster.
- doc directories are entered only if a Makefile is present.
- make maintainer-clean properly deletes the config and the
modules list at the end (it doesn't recreate it).

Andrei Pelinescu-Onciul authored on 22/04/2009 13:46:30
Showing 1 changed files
... ...
@@ -13,9 +13,16 @@
13 13
 #  2008-06-26  initial version (andrei) 
14 14
 #
15 15
 
16
-clean_targets:=	clean proper distclean realclean maintainer-clean clean_libs \
16
+clean_targets:=	clean proper distclean realclean maintainer-clean local-clean \
17 17
 				clean-all proper-all distclean-all realclean-all \
18
-				clean_cfg clean_modules_cfg clean-modules-cfg
18
+				clean_cfg clean_modules_cfg clean-modules-cfg \
19
+				clean-modules proper-modules realclean-modules \
20
+				distclean-modules maintainer-clean-modules \
21
+				clean-utils proper-utils realclean-utils distclean-utils \
22
+				maintaner-clean-utils \
23
+				clean-libs proper-libs realclean-libs distclean-libs \
24
+				maintainer-clean-libs \
25
+				clean-tmp clean_doxygen
19 26
 doc_targets:=	modules-doc modules-readme README modules-man man \
20 27
 		install-doc install-modules-doc install-man install-ser-man \
21 28
 		install-modules-man
Browse code

makefiles: typo fixed

s/mantainer/maintainer/

Andrei Pelinescu-Onciul authored on 22/04/2009 09:00:37
Showing 1 changed files
... ...
@@ -13,7 +13,7 @@
13 13
 #  2008-06-26  initial version (andrei) 
14 14
 #
15 15
 
16
-clean_targets:=	clean proper distclean realclean mantainer-clean clean_libs \
16
+clean_targets:=	clean proper distclean realclean maintainer-clean clean_libs \
17 17
 				clean-all proper-all distclean-all realclean-all \
18 18
 				clean_cfg clean_modules_cfg clean-modules-cfg
19 19
 doc_targets:=	modules-doc modules-readme README modules-man man \
Browse code

build system: support for multiple modules dirs

Multiple modules directories are now supported.
The list of the modules directories is in Makefile.dirs in
$(modules_dirs).
Name restrictions: the names must not match any makefile variable name
and they shouldn't contain any '-' char.

The modules and modules doc/READMEs will be installed in separate dirs
(e.g. for modules_dirs="modules modules_s modules_k" , the modules
will be installed in .../lib/ser/modules , ...lib/ser/modules_s
and ...lib/ser/modules_k).
The module man pages will all be installed in the same man dir
(but so far only some ser modules have man pages so we should be
safe).

New make targets:
every-module - make all the modules in all the module dirs
install-every-module - like above, but install
install-every-module-doc
install-every-module-man

Targets dependent on $(modules_dirs) content:
$(m), $(m)-doc, $(m)-readme, $(m)-man, install-$(m),
install-$(m)-doc, install-$(m)-man.

E.g.: for modules_dirs=modules modules_k modules_s
make modules - make all modules in the directory "modules".
make modules_k - make all the modules in the directory modules_k.
make every-module - make all the modules in the directories
modules, modules_k and modules_s.
make install-modules_s - install all the modules in the directory
modules_s.

Andrei Pelinescu-Onciul authored on 27/03/2009 19:44:36
Showing 1 changed files
... ...
@@ -13,19 +13,27 @@
13 13
 #  2008-06-26  initial version (andrei) 
14 14
 #
15 15
 
16
+ifeq (,$(strip $(modules_dirs)))
17
+include $(COREPATH)/Makefile.dirs
18
+endif
19
+
16 20
 clean_targets:=	clean proper distclean realclean mantainer-clean clean_libs \
17 21
 				clean-all proper-all distclean-all realclean-all \
18 22
 				clean_cfg clean_modules_cfg clean-modules-cfg
19
-doc_targets:=	modules-doc modules-readme README modules-man man \
20
-		install-doc install-modules-doc install-man install-ser-man \
21
-		install-modules-man
23
+doc_targets:=	README man install-doc install-man install-ser-man \
24
+		install-every-module-doc install-every-module-man \
25
+		$(foreach m,$(modules_dirs),$(m)-doc $(m)-readme $(m)-man) \
26
+		$(foreach m,$(modules_dirs),install-$(m)-doc install-$(m)-man)
27
+
22 28
 # auxiliary: maintance, debugging, etc. (don't affect code/objects)
23 29
 aux_targets:=	TAGS tar dist cfg-defs cfg config config.mak print-modules \
24
-		dbg dbinstall librpath.lst makecfg.lst modules.lst
30
+		dbg dbinstall librpath.lst makecfg.lst \
31
+		modules-cfg modules-list modules-lst modules.lst mk-install_dirs
25 32
 # other targets that don't produce code in the current directory ("external")
26
-ext_targets:=	modules libs utils \
27
-		install-cfg install-modules install-utils  install-modules-all \
28
-		install-share 
33
+ext_targets:=	every-module $(modules_dirs) libs utils \
34
+		install-cfg install-utils  install-modules-all install-every-module\
35
+		$(foreach m,$(modules_dirs),install-$(m)) \
36
+		install-share
29 37
 
30 38
 # all the targets that don't require code dependecies in the current dir.
31 39
 nodep_targets:=	$(clean_targets) $(doc_targets) $(aux_targets) $(ext_targets)
Browse code

- moved modules list from config.mak to modules.lst and added modules list reconfigure targets: make modules-cfg ... (this allows changing the modules list without triggering a complete recompile) - added make cfg-defs which would change only the build options, without modifying the modules list

Andrei Pelinescu-Onciul authored on 01/07/2008 20:31:55
Showing 1 changed files
... ...
@@ -14,13 +14,14 @@
14 14
 #
15 15
 
16 16
 clean_targets:=	clean proper distclean realclean mantainer-clean clean_libs \
17
-				clean-all proper-all distclean-all realclean-all
17
+				clean-all proper-all distclean-all realclean-all \
18
+				clean_cfg clean_modules_cfg clean-modules-cfg
18 19
 doc_targets:=	modules-doc modules-readme README modules-man man \
19 20
 		install-doc install-modules-doc install-man install-ser-man \
20 21
 		install-modules-man
21 22
 # auxiliary: maintance, debugging, etc. (don't affect code/objects)
22
-aux_targets:=	TAGS tar dist cfg config config.mak print-modules dbg \
23
-		dbinstall librpath.lst makecfg.lst
23
+aux_targets:=	TAGS tar dist cfg-defs cfg config config.mak print-modules \
24
+		dbg dbinstall librpath.lst makecfg.lst modules.lst
24 25
 # other targets that don't produce code in the current directory ("external")
25 26
 ext_targets:=	modules libs utils \
26 27
 		install-cfg install-modules install-utils  install-modules-all \
Browse code

- added clean-all and proper-all (like clean and proper but work on all the modules, not only the one currently configured)

Andrei Pelinescu-Onciul authored on 28/06/2008 20:45:10
Showing 1 changed files
... ...
@@ -13,7 +13,8 @@
13 13
 #  2008-06-26  initial version (andrei) 
14 14
 #
15 15
 
16
-clean_targets:=	clean proper distclean realclean mantainer-clean clean_libs
16
+clean_targets:=	clean proper distclean realclean mantainer-clean clean_libs \
17
+				clean-all proper-all distclean-all realclean-all
17 18
 doc_targets:=	modules-doc modules-readme README modules-man man \
18 19
 		install-doc install-modules-doc install-man install-ser-man \
19 20
 		install-modules-man
Browse code

- added install-modules-man and made make install also imake & install the modules man pages (if present)

- added try_err function to Makefile.shared, for checking and reporting if
a shell command failed (if err_fail is 1 it will also force an error return
from the current makefile subshell)

- install-share, install-utils, install-modules-doc, install-modules-man will
now fail if err_fail=1 (default) and one of the individual file install
fails. Closes SER-389.

Andrei Pelinescu-Onciul authored on 28/06/2008 20:16:36
Showing 1 changed files
... ...
@@ -15,7 +15,8 @@
15 15
 
16 16
 clean_targets:=	clean proper distclean realclean mantainer-clean clean_libs
17 17
 doc_targets:=	modules-doc modules-readme README modules-man man \
18
-		install-doc install-modules-doc install-man
18
+		install-doc install-modules-doc install-man install-ser-man \
19
+		install-modules-man
19 20
 # auxiliary: maintance, debugging, etc. (don't affect code/objects)
20 21
 aux_targets:=	TAGS tar dist cfg config config.mak print-modules dbg \
21 22
 		dbinstall librpath.lst makecfg.lst
Browse code

- experimental make cfg /config support: make cfg fore regeneration of the "build" config, saved in config.mak. This config is used instead of including Makefile.defs each time. The config is also automatically generated if missing. The speed improvements are dramatic in most cases: make proper 15 times faster, make clean 8 times, make with generated config 2.6 times faster then before, make rebuilding only one file 9 times faster. E.g.: make cfg include_modules=mysql CPU=pentium-m BASEDIR=/tmp/ser make install # builds default ser + mysql, optimized for pentium-m # and installs in /tmp/ser/usr/local/* make clean # cleans default modules + mysql

Andrei Pelinescu-Onciul authored on 28/06/2008 00:35:25
Showing 1 changed files
... ...
@@ -17,8 +17,8 @@ clean_targets:=	clean proper distclean realclean mantainer-clean clean_libs
17 17
 doc_targets:=	modules-doc modules-readme README modules-man man \
18 18
 		install-doc install-modules-doc install-man
19 19
 # auxiliary: maintance, debugging, etc. (don't affect code/objects)
20
-aux_targets:=	TAGS tar dist print-modules dbg dbinstall \
21
-		librpath.lst makecfg.lst
20
+aux_targets:=	TAGS tar dist cfg config config.mak print-modules dbg \
21
+		dbinstall librpath.lst makecfg.lst
22 22
 # other targets that don't produce code in the current directory ("external")
23 23
 ext_targets:=	modules libs utils \
24 24
 		install-cfg install-modules install-utils  install-modules-all \
Browse code

- don't try to build dependencies or lex/yacc stuff unless it's really necessary (makefile target != clean,doc,modules, a.s.o ; for the complete long list see Makefile.targets)

Andrei Pelinescu-Onciul authored on 26/06/2008 09:07:35
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,29 @@
1
+
2
+#
3
+# $Id$
4
+#
5
+#
6
+# Makefile targets that should be treated specially, 
7
+# e.g.:  non obj/executable affecting targets => don't build dependencies for
8
+#  them or don't try any action that would be useful only for generating
9
+#  actual code
10
+#
11
+# History:
12
+# --------
13
+#  2008-06-26  initial version (andrei) 
14
+#
15
+
16
+clean_targets:=	clean proper distclean realclean mantainer-clean clean_libs
17
+doc_targets:=	modules-doc modules-readme README modules-man man \
18
+		install-doc install-modules-doc install-man
19
+# auxiliary: maintance, debugging, etc. (don't affect code/objects)
20
+aux_targets:=	TAGS tar dist print-modules dbg dbinstall \
21
+		librpath.lst makecfg.lst
22
+# other targets that don't produce code in the current directory ("external")
23
+ext_targets:=	modules libs utils \
24
+		install-cfg install-modules install-utils  install-modules-all \
25
+		install-share 
26
+
27
+# all the targets that don't require code dependecies in the current dir.
28
+nodep_targets:=	$(clean_targets) $(doc_targets) $(aux_targets) $(ext_targets)
29
+