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,152 +0,0 @@
1
-# Kamailio build system
2
-#
3
-# utils Makefile
4
-#(to be included from each util/ subdirectory)
5
-#
6
-
7
-#
8
-# Variables that should be defined in the util Makefiles, prior to including
9
-# this makefile:
10
-#
11
-# NAME - util binary name, with no path (MUST).
12
-#
13
-# COREPATH - path to the main/core directory (OPTIONAL, default ../..)
14
-#
15
-# DEFS - local extra defines (OPTIONAL)
16
-#
17
-# LIBS - local extra libs (OPTIONAL)
18
-#
19
-# SER_LIBS - ser/sr libs that should be compiled, linked against and installed
20
-#           along the binary. The format is: <path>/<shortname>, e.g.
21
-#           SER_LIBS=../../lib/srdb2/srdb2 for libsrdb2 with the sources
22
-#            in ../../lib/srdb2. (OPTIONAL)
23
-#
24
-
25
-UTIL_NAME=$(NAME)
26
-
27
-# default path to the core makefiles
28
-COREPATH ?=../..
29
-
30
-ALLDEP=Makefile $(COREPATH)/Makefile.sources $(COREPATH)/Makefile.rules \
31
- $(COREPATH)/Makefile.utils $(COREPATH)/Makefile.dirs $(COREPATH)/config.mak
32
-
33
-#override modules value, an util cannot have submodules
34
-override modules=
35
-override static_modules=
36
-override static_modules_path=
37
-
38
-# temporary def (visible only in the util makefile, not exported)
39
-DEFS += -DMOD_NAME="utils/$(UTIL_NAME)"
40
-
41
-ifneq ($(makefile_defs_included),1)
42
-$(error "the local makefile does not include Makefile.defs!")
43
-endif
44
-
45
-ifeq ($(MAKELEVEL), 0)
46
-# make called directly in the module dir!
47
-
48
-else
49
-# called by the main Makefile
50
-
51
-ALLDEP+=$(COREPATH)/Makefile
52
-
53
-endif
54
-
55
-include $(COREPATH)/Makefile.sources
56
-
57
-
58
-# if config was not loaded (makefile_defs!=1) ignore
59
-# the rest of makefile and try only to remake the config
60
-ifeq ($(makefile_defs),1)
61
-
62
-# set CFLAGS & LDFLAGS
63
-CFLAGS:=$(UTILS_CFLAGS)
64
-LDFLAGS:=$(UTILS_LDFLAGS)
65
-
66
-err_fail?=1
67
-
68
-include $(COREPATH)/Makefile.dirs
69
-include $(COREPATH)/Makefile.targets
70
-include $(COREPATH)/Makefile.rules
71
-include $(COREPATH)/Makefile.shared
72
-
73
-# default: if not overwritten by the main Makefile, install in bin_dir
74
-util_dst=$(bin_prefix)/$(bin_dir)
75
-
76
-$(util_dst):
77
-		mkdir -p $(util_dst)
78
-
79
-modules:
80
-
81
-.PHONY: install
82
-.PHONY: install-libs
83
-install: $(NAME) $(util_dst) install-libs install-util-man
84
-	$(INSTALL_TOUCH) $(util_dst)/$(NAME)
85
-	$(INSTALL_BIN)  $(NAME)  $(util_dst)
86
-
87
-ifneq (,$(SER_LIBS))
88
-install-libs:
89
-	@for lib in $(dir $(SER_LIBS)); do \
90
-		$(call try_err, $(MAKE) -C "$${lib}" install-if-newer ) ;\
91
-	done; true
92
-
93
-else
94
-install-libs:
95
-
96
-endif # $(SER_LIBS)
97
-
98
-.PHONY: install-if-newer
99
-install-if-newer: $(util_dst)/$(NAME)
100
-
101
-$(util_dst)/$(NAME): $(NAME)
102
-	@$(MAKE) install
103
-
104
-# README build rules
105
-ifneq (,$(wildcard doc/Makefile))
106
-#doc/Makefile present => we can generate README
107
-
108
-README: doc/*.xml
109
-	$(MAKE) -C doc $(UTIL_NAME).txt
110
-	mv doc/$(UTIL_NAME).txt $@
111
-
112
-else
113
-# do nothing
114
-
115
-README:
116
-endif
117
-
118
-#man page build rules
119
-ifneq (,$(wildcard $(UTIL_NAME).xml))
120
-
121
-$(UTIL_NAME).7: $(UTIL_NAME).xml
122
-	$(DOCBOOK) -s ../../doc/stylesheets/serdoc2man.xsl $<
123
-
124
-man: $(UTIL_NAME).7
125
-
126
-else
127
-
128
-man:
129
-
130
-endif
131
-
132
-$(man_prefix)/$(man_dir)/man8:
133
-	mkdir -p $(man_prefix)/$(man_dir)/man8
134
-
135
-.PHONY: install-util-man
136
-#src-name man page install rules
137
-ifneq (,$(wildcard $(UTIL_SRC_NAME).8))
138
-install-util-man: $(man_prefix)/$(man_dir)/man8
139
-	sed -e "s#$(UTIL_SRC_NAME)#$(UTIL_NAME)#g" \
140
-			-e "s#$(SRC_NAME)#$(MAIN_NAME)#g" \
141
-			< $(UTIL_SRC_NAME).8 > $(man_prefix)/$(man_dir)/man8/$(UTIL_NAME).8
142
-	chmod 644  $(man_prefix)/$(man_dir)/man8/$(UTIL_NAME).8
143
-
144
-else
145
-
146
-install-util-man:
147
-
148
-endif
149
-
150
-endif # ifeq($(makefile_defs),1)
151
-
152
-include $(COREPATH)/Makefile.cfg
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,12 +1,8 @@
1
-#
2
-# $Id$
1
+# Kamailio build system
3 2
 #
4 3
 # utils Makefile
5 4
 #(to be included from each util/ subdirectory)
6 5
 #
7
-# History:
8
-# --------
9
-#  2009-04-23  initial version derived from Makefile.modules (andrei)
10 6
 
11 7
 #
12 8
 # Variables that should be defined in the util Makefiles, prior to including
Browse code

Makefile.utils: add rule to create man page dir

- reported by Peter Dunkley

Daniel-Constantin Mierla authored on 25/10/2012 19:16:26
Showing 1 changed files
... ...
@@ -133,14 +133,17 @@ man:
133 133
 
134 134
 endif
135 135
 
136
+$(man_prefix)/$(man_dir)/man8:
137
+	mkdir -p $(man_prefix)/$(man_dir)/man8
138
+
136 139
 .PHONY: install-util-man
137 140
 #src-name man page install rules
138 141
 ifneq (,$(wildcard $(UTIL_SRC_NAME).8))
139 142
 install-util-man: $(man_prefix)/$(man_dir)/man8
140
-		sed -e "s#$(UTIL_SRC_NAME)#$(UTIL_NAME)#g" \
143
+	sed -e "s#$(UTIL_SRC_NAME)#$(UTIL_NAME)#g" \
141 144
 			-e "s#$(SRC_NAME)#$(MAIN_NAME)#g" \
142 145
 			< $(UTIL_SRC_NAME).8 > $(man_prefix)/$(man_dir)/man8/$(UTIL_NAME).8
143
-		chmod 644  $(man_prefix)/$(man_dir)/man8/$(UTIL_NAME).8
146
+	chmod 644  $(man_prefix)/$(man_dir)/man8/$(UTIL_NAME).8
144 147
 
145 148
 else
146 149
 
Browse code

Makefile.utils: new target to install manpage for util tools

Daniel-Constantin Mierla authored on 23/10/2012 22:04:11
Showing 1 changed files
... ...
@@ -84,7 +84,7 @@ modules:
84 84
 
85 85
 .PHONY: install
86 86
 .PHONY: install-libs
87
-install: $(NAME) $(util_dst) install-libs
87
+install: $(NAME) $(util_dst) install-libs install-util-man
88 88
 	$(INSTALL_TOUCH) $(util_dst)/$(NAME)
89 89
 	$(INSTALL_BIN)  $(NAME)  $(util_dst)
90 90
 
... ...
@@ -133,6 +133,21 @@ man:
133 133
 
134 134
 endif
135 135
 
136
+.PHONY: install-util-man
137
+#src-name man page install rules
138
+ifneq (,$(wildcard $(UTIL_SRC_NAME).8))
139
+install-util-man: $(man_prefix)/$(man_dir)/man8
140
+		sed -e "s#$(UTIL_SRC_NAME)#$(UTIL_NAME)#g" \
141
+			-e "s#$(SRC_NAME)#$(MAIN_NAME)#g" \
142
+			< $(UTIL_SRC_NAME).8 > $(man_prefix)/$(man_dir)/man8/$(UTIL_NAME).8
143
+		chmod 644  $(man_prefix)/$(man_dir)/man8/$(UTIL_NAME).8
144
+
145
+else
146
+
147
+install-util-man:
148
+
149
+endif
150
+
136 151
 endif # ifeq($(makefile_defs),1)
137 152
 
138 153
 include $(COREPATH)/Makefile.cfg
Browse code

Makefiles: Updated Makefiles to use db2x_docbook2man when docbook2x-man is not installed

- db2x_docbook2man is what Fedora contains

Peter Dunkley authored on 20/10/2012 00:23:51
Showing 1 changed files
... ...
@@ -123,7 +123,7 @@ endif
123 123
 ifneq (,$(wildcard $(UTIL_NAME).xml))
124 124
 
125 125
 $(UTIL_NAME).7: $(UTIL_NAME).xml
126
-	docbook2x-man -s ../../doc/stylesheets/serdoc2man.xsl $<
126
+	$(DOCBOOK) -s ../../doc/stylesheets/serdoc2man.xsl $<
127 127
 
128 128
 man: $(UTIL_NAME).7
129 129
 
Browse code

makefile: use separate CFLAGS & LDFLAGS for utils

- added UTILS_CFLAGS and UTILS_LDFLAGS (Makefile.defs and saved in
the config)
- use UTILS_CFLAGS and UTILS_LDFLAGS when compiling the utils
(fixes a bug when an util compiled by a module will be compiled
with the module flags)

Andrei Pelinescu-Onciul authored on 08/10/2009 15:45:44
Showing 1 changed files
... ...
@@ -40,7 +40,7 @@ override static_modules=
40 40
 override static_modules_path=
41 41
 
42 42
 # temporary def (visible only in the util makefile, not exported)
43
-DEFS +=
43
+DEFS += -DMOD_NAME="utils/$(UTIL_NAME)"
44 44
 
45 45
 ifneq ($(makefile_defs_included),1)
46 46
 $(error "the local makefile does not include Makefile.defs!")
... ...
@@ -63,6 +63,10 @@ include $(COREPATH)/Makefile.sources
63 63
 # the rest of makefile and try only to remake the config
64 64
 ifeq ($(makefile_defs),1)
65 65
 
66
+# set CFLAGS & LDFLAGS
67
+CFLAGS:=$(UTILS_CFLAGS)
68
+LDFLAGS:=$(UTILS_LDFLAGS)
69
+
66 70
 err_fail?=1
67 71
 
68 72
 include $(COREPATH)/Makefile.dirs
Browse code

makefile: doc update for Makefile.utils

Andrei Pelinescu-Onciul authored on 01/10/2009 14:05:02
Showing 1 changed files
... ...
@@ -8,6 +8,24 @@
8 8
 # --------
9 9
 #  2009-04-23  initial version derived from Makefile.modules (andrei)
10 10
 
11
+#
12
+# Variables that should be defined in the util Makefiles, prior to including
13
+# this makefile:
14
+#
15
+# NAME - util binary name, with no path (MUST).
16
+#
17
+# COREPATH - path to the main/core directory (OPTIONAL, default ../..)
18
+#
19
+# DEFS - local extra defines (OPTIONAL)
20
+#
21
+# LIBS - local extra libs (OPTIONAL)
22
+#
23
+# SER_LIBS - ser/sr libs that should be compiled, linked against and installed
24
+#           along the binary. The format is: <path>/<shortname>, e.g.
25
+#           SER_LIBS=../../lib/srdb2/srdb2 for libsrdb2 with the sources
26
+#            in ../../lib/srdb2. (OPTIONAL)
27
+#
28
+
11 29
 UTIL_NAME=$(NAME)
12 30
 
13 31
 # default path to the core makefiles
... ...
@@ -66,10 +84,16 @@ install: $(NAME) $(util_dst) install-libs
66 84
 	$(INSTALL_TOUCH) $(util_dst)/$(NAME)
67 85
 	$(INSTALL_BIN)  $(NAME)  $(util_dst)
68 86
 
87
+ifneq (,$(SER_LIBS))
69 88
 install-libs:
70 89
 	@for lib in $(dir $(SER_LIBS)); do \
71 90
 		$(call try_err, $(MAKE) -C "$${lib}" install-if-newer ) ;\
72
-	done
91
+	done; true
92
+
93
+else
94
+install-libs:
95
+
96
+endif # $(SER_LIBS)
73 97
 
74 98
 .PHONY: install-if-newer
75 99
 install-if-newer: $(util_dst)/$(NAME)
Browse code

makefile: make install for utils

- make install for utils
- various small Makefile.utils fixes

Andrei Pelinescu-Onciul authored on 01/10/2009 11:42:36
Showing 1 changed files
... ...
@@ -8,6 +8,7 @@
8 8
 # --------
9 9
 #  2009-04-23  initial version derived from Makefile.modules (andrei)
10 10
 
11
+UTIL_NAME=$(NAME)
11 12
 
12 13
 # default path to the core makefiles
13 14
 COREPATH ?=../..
... ...
@@ -20,6 +21,9 @@ override modules=
20 21
 override static_modules=
21 22
 override static_modules_path=
22 23
 
24
+# temporary def (visible only in the util makefile, not exported)
25
+DEFS +=
26
+
23 27
 ifneq ($(makefile_defs_included),1)
24 28
 $(error "the local makefile does not include Makefile.defs!")
25 29
 endif
... ...
@@ -41,20 +45,45 @@ include $(COREPATH)/Makefile.sources
41 45
 # the rest of makefile and try only to remake the config
42 46
 ifeq ($(makefile_defs),1)
43 47
 
48
+err_fail?=1
44 49
 
45 50
 include $(COREPATH)/Makefile.dirs
46 51
 include $(COREPATH)/Makefile.targets
47 52
 include $(COREPATH)/Makefile.rules
53
+include $(COREPATH)/Makefile.shared
54
+
55
+# default: if not overwritten by the main Makefile, install in bin_dir
56
+util_dst=$(bin_prefix)/$(bin_dir)
57
+
58
+$(util_dst):
59
+		mkdir -p $(util_dst)
48 60
 
49 61
 modules:
50 62
 
63
+.PHONY: install
64
+.PHONY: install-libs
65
+install: $(NAME) $(util_dst) install-libs
66
+	$(INSTALL_TOUCH) $(util_dst)/$(NAME)
67
+	$(INSTALL_BIN)  $(NAME)  $(util_dst)
68
+
69
+install-libs:
70
+	@for lib in $(dir $(SER_LIBS)); do \
71
+		$(call try_err, $(MAKE) -C "$${lib}" install-if-newer ) ;\
72
+	done
73
+
74
+.PHONY: install-if-newer
75
+install-if-newer: $(util_dst)/$(NAME)
76
+
77
+$(util_dst)/$(NAME): $(NAME)
78
+	@$(MAKE) install
79
+
51 80
 # README build rules
52 81
 ifneq (,$(wildcard doc/Makefile))
53 82
 #doc/Makefile present => we can generate README
54 83
 
55 84
 README: doc/*.xml
56
-	$(MAKE) -C doc $(MOD_NAME).txt
57
-	mv doc/$(MOD_NAME).txt $@
85
+	$(MAKE) -C doc $(UTIL_NAME).txt
86
+	mv doc/$(UTIL_NAME).txt $@
58 87
 
59 88
 else
60 89
 # do nothing
... ...
@@ -63,12 +92,12 @@ README:
63 92
 endif
64 93
 
65 94
 #man page build rules
66
-ifneq (,$(wildcard $(MOD_NAME).xml))
95
+ifneq (,$(wildcard $(UTIL_NAME).xml))
67 96
 
68
-$(MOD_NAME).7: $(MOD_NAME).xml
97
+$(UTIL_NAME).7: $(UTIL_NAME).xml
69 98
 	docbook2x-man -s ../../doc/stylesheets/serdoc2man.xsl $<
70 99
 
71
-man: $(MOD_NAME).7
100
+man: $(UTIL_NAME).7
72 101
 
73 102
 else
74 103
 
Browse code

makefiles: added Makefile.utils

- added Makefile.utils
- updated utils/{gen_ha1,sercmd} to use it

Andrei Pelinescu-Onciul authored on 23/04/2009 13:44:41
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,81 @@
1
+#
2
+# $Id$
3
+#
4
+# utils Makefile
5
+#(to be included from each util/ subdirectory)
6
+#
7
+# History:
8
+# --------
9
+#  2009-04-23  initial version derived from Makefile.modules (andrei)
10
+
11
+
12
+# default path to the core makefiles
13
+COREPATH ?=../..
14
+
15
+ALLDEP=Makefile $(COREPATH)/Makefile.sources $(COREPATH)/Makefile.rules \
16
+ $(COREPATH)/Makefile.utils $(COREPATH)/Makefile.dirs $(COREPATH)/config.mak
17
+
18
+#override modules value, an util cannot have submodules
19
+override modules=
20
+override static_modules=
21
+override static_modules_path=
22
+
23
+ifneq ($(makefile_defs_included),1)
24
+$(error "the local makefile does not include Makefile.defs!")
25
+endif
26
+
27
+ifeq ($(MAKELEVEL), 0)
28
+# make called directly in the module dir!
29
+
30
+else
31
+# called by the main Makefile
32
+
33
+ALLDEP+=$(COREPATH)/Makefile
34
+
35
+endif
36
+
37
+include $(COREPATH)/Makefile.sources
38
+
39
+
40
+# if config was not loaded (makefile_defs!=1) ignore
41
+# the rest of makefile and try only to remake the config
42
+ifeq ($(makefile_defs),1)
43
+
44
+
45
+include $(COREPATH)/Makefile.dirs
46
+include $(COREPATH)/Makefile.targets
47
+include $(COREPATH)/Makefile.rules
48
+
49
+modules:
50
+
51
+# README build rules
52
+ifneq (,$(wildcard doc/Makefile))
53
+#doc/Makefile present => we can generate README
54
+
55
+README: doc/*.xml
56
+	$(MAKE) -C doc $(MOD_NAME).txt
57
+	mv doc/$(MOD_NAME).txt $@
58
+
59
+else
60
+# do nothing
61
+
62
+README:
63
+endif
64
+
65
+#man page build rules
66
+ifneq (,$(wildcard $(MOD_NAME).xml))
67
+
68
+$(MOD_NAME).7: $(MOD_NAME).xml
69
+	docbook2x-man -s ../../doc/stylesheets/serdoc2man.xsl $<
70
+
71
+man: $(MOD_NAME).7
72
+
73
+else
74
+
75
+man:
76
+
77
+endif
78
+
79
+endif # ifeq($(makefile_defs),1)
80
+
81
+include $(COREPATH)/Makefile.cfg