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
... ...
@@ -117,16 +117,17 @@ endif
117 117
 
118 118
 #man page build rules
119 119
 ifneq (,$(wildcard $(UTIL_NAME).xml))
120
-
120
+ifneq ($(DOCBOOKMAN),)
121 121
 $(UTIL_NAME).7: $(UTIL_NAME).xml
122
-	$(DOCBOOK) -s ../../doc/stylesheets/serdoc2man.xsl $<
122
+	$(DOCBOOKMAN) -s ../../doc/stylesheets/serdoc2man.xsl $<
123 123
 
124 124
 man: $(UTIL_NAME).7
125
-
126 125
 else
127
-
128 126
 man:
129
-
127
+	@echo "info - no docbook to man tool to convert $(UTIL_NAME).xml"
128
+endif
129
+else
130
+man:
130 131
 endif
131 132
 
132 133
 $(man_prefix)/$(man_dir)/man8:
Browse code

Makefile.utils: updated the path to core folder

Daniel-Constantin Mierla authored on 08/12/2016 17:34:17
Showing 1 changed files
... ...
@@ -25,7 +25,7 @@
25 25
 UTIL_NAME=$(NAME)
26 26
 
27 27
 # default path to the core makefiles
28
-COREPATH ?=../..
28
+COREPATH ?=../../src
29 29
 
30 30
 ALLDEP=Makefile $(COREPATH)/Makefile.sources $(COREPATH)/Makefile.rules \
31 31
  $(COREPATH)/Makefile.utils $(COREPATH)/Makefile.dirs $(COREPATH)/config.mak
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,152 @@
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