Browse code

src/Makefile: Also stop compiling kamcmd from here

Adrian Bunk authored on 08/02/2022 15:03:57 • Daniel-Constantin Mierla committed on 09/02/2022 07:10:15
Showing 1 changed files
... ...
@@ -202,7 +202,7 @@ cmodules=$(foreach mods,$(modules_dirs), $($(mods)))
202 202
 
203 203
 
204 204
 # list of utils directories that should be compiled by make utils
205
-C_COMPILE_UTILS=	../utils/kamcmd
205
+C_COMPILE_UTILS= # kamcmd is now installed by ctl
206 206
 # list of binaries that should be installed alongside
207 207
 # (they should be created after make utils, see C_COMPILE_UTILS)
208 208
 C_INSTALL_BIN=	# kamcmd is now installed by ctl
Browse code

src/Makefile: update deb rules

* deb-stable rule should use buster nowadays
* deb rule should point to sid

pkg/kamailio/deb/debian is not suppose to be used directly is just
a base for creating all the different flavors

fixes #2432

Victor Seva authored on 24/08/2020 13:18:52
Showing 1 changed files
... ...
@@ -614,7 +614,7 @@ deb:
614 614
 		dpkg-buildpackage -rfakeroot -tc -uc -us; \
615 615
 		rm debian; \
616 616
 	else \
617
-		ln -s pkg/$(MAIN_NAME)/deb/debian debian; \
617
+		ln -s pkg/$(MAIN_NAME)/deb/sid debian; \
618 618
 		dpkg-buildpackage -rfakeroot -tc -uc -us; \
619 619
 		rm debian; \
620 620
 	fi)
... ...
@@ -626,7 +626,7 @@ deb-stable:
626 626
 		dpkg-buildpackage -rfakeroot -tc -uc -us; \
627 627
 		rm debian; \
628 628
 	else \
629
-		ln -s pkg/$(MAIN_NAME)/deb/jessie debian; \
629
+		ln -s pkg/$(MAIN_NAME)/deb/buster debian; \
630 630
 		dpkg-buildpackage -rfakeroot -tc -uc -us; \
631 631
 		rm debian; \
632 632
 	fi)
Browse code

src/Makefile: switch from deprecated /var/run to /run

The FHS 3.0 [F] has deprecated /var/run in favor of /run. Current
distributions have done so for a long time (for example in Debian
since 6.0 “squeeze”), even though they provide a compatibility
symlink from /var/run to /run. But software like systemd have
started emitting warnings when using /var/run, for example for
its PIDFile directive, which pollutes the logs.

Guillem Jover authored on 25/10/2019 09:54:44 • Daniel-Constantin Mierla committed on 25/10/2019 10:00:46
Showing 1 changed files
... ...
@@ -982,7 +982,7 @@ install_initd_debian install-initd-debian:
982 982
 	sed -e "s#DAEMON=/usr/sbin/kamailio#DAEMON=$(bin_prefix)/$(bin_dir)$(NAME)#g" \
983 983
 		-e "s#NAME=kamailio#NAME=$(NAME)#g" \
984 984
 		-e "s#DESC=Kamailio#DESC=$(NAME)#g" \
985
-		-e "s#HOMEDIR=/var/run/kamailio#HOMEDIR=/var/run/$(NAME)#g" \
985
+		-e "s#HOMEDIR=/run/kamailio#HOMEDIR=/run/$(NAME)#g" \
986 986
 		-e "s#DEFAULTS=/etc/default/kamailio#DEFAULTS=/etc/default/$(NAME)#g" \
987 987
 		-e "s#CFGFILE=/etc/kamailio/kamailio.cfg#CFGFILE=$(cfg_prefix)/$(cfg_dir)$(NAME).cfg#g" \
988 988
 		< pkg/kamailio/deb/debian/kamailio.init \
... ...
@@ -991,18 +991,18 @@ install_initd_debian install-initd-debian:
991 991
 	sed -e "s#RUN_KAMAILIO=no#RUN_KAMAILIO=yes#g" \
992 992
 		< pkg/kamailio/deb/debian/kamailio.default \
993 993
 		> /etc/default/$(NAME)
994
-	mkdir -p /var/run/$(NAME)
994
+	mkdir -p /run/$(NAME)
995 995
 	adduser --quiet --system --group --disabled-password \
996 996
         --shell /bin/false --gecos "$(NAME)" \
997
-        --home /var/run/$(NAME) $(NAME)
998
-	chown $(NAME):$(NAME) /var/run/$(NAME)
997
+        --home /run/$(NAME) $(NAME)
998
+	chown $(NAME):$(NAME) /run/$(NAME)
999 999
 
1000 1000
 .PHONY: install_initd_centos install-initd-centos
1001 1001
 install_initd_centos install-initd-centos:
1002 1002
 	sed -e "s#KAM=/usr/sbin/kamailio#KAM=$(bin_prefix)/$(bin_dir)$(NAME)#g" \
1003 1003
 		-e "s#PROG=kamailio#PROG=$(NAME)#g" \
1004 1004
 		-e "s#DEFAULTS=/etc/default/kamailio#DEFAULTS=/etc/default/$(NAME)#g" \
1005
-		-e "s#PID_FILE=/var/run/kamailio.pid#PID_FILE=/var/run/$(NAME).pid#g" \
1005
+		-e "s#PID_FILE=/run/kamailio.pid#PID_FILE=/run/$(NAME).pid#g" \
1006 1006
 		-e "s#LOCK_FILE=/var/lock/subsys/kamailio#LOCK_FILE=/var/lock/subsys/$(NAME)#g" \
1007 1007
 		-e "s#KAMCFG=/etc/kamailio/kamailio.cfg#KAMCFG=$(cfg_prefix)/$(cfg_dir)$(NAME).cfg#g" \
1008 1008
 		< pkg/kamailio/rpm/kamailio.init \
... ...
@@ -1013,17 +1013,17 @@ install_initd_centos install-initd-centos:
1013 1013
 		-e "s#GROUP=kamailio#GROUP=$(NAME)#g" \
1014 1014
 		< pkg/kamailio/rpm/kamailio.default \
1015 1015
 		> /etc/default/$(NAME)
1016
-	mkdir -p /var/run/$(NAME)
1016
+	mkdir -p /run/$(NAME)
1017 1017
 	/usr/sbin/groupadd -r $(NAME)
1018 1018
 	/usr/sbin/useradd -r -g $(NAME) -s /bin/false -c "Kamailio Daemon" \
1019
-                  -d /var/run/$(NAME) $(NAME)
1020
-	chown $(NAME):$(NAME) /var/run/$(NAME)
1019
+                  -d /run/$(NAME) $(NAME)
1020
+	chown $(NAME):$(NAME) /run/$(NAME)
1021 1021
 
1022 1022
 .PHONY: install_systemd_debian install-systemd-debian
1023 1023
 install_systemd_debian install-systemd-debian:
1024 1024
 	sed -e "s#ExecStart=/usr/sbin/kamailio#ExecStart=$(bin_prefix)/$(bin_dir)$(NAME)#g" \
1025 1025
 		-e "s#Description=Kamailio#Description=$(NAME)#g" \
1026
-		-e "s#/var/run/kamailio/kamailio.pid#/var/run/$(NAME)/$(NAME).pid#g" \
1026
+		-e "s#/run/kamailio/kamailio.pid#/run/$(NAME)/$(NAME).pid#g" \
1027 1027
 		-e "s#EnvironmentFile=-/etc/default/kamailio#EnvironmentFile=-/etc/default/$(NAME)#g" \
1028 1028
 		-e "s#CFGFILE=/etc/kamailio/kamailio.cfg#CFGFILE=$(cfg_prefix)/$(cfg_dir)$(NAME).cfg#g" \
1029 1029
 		< ../pkg/kamailio/deb/debian/kamailio.service \
... ...
@@ -1031,11 +1031,11 @@ install_systemd_debian install-systemd-debian:
1031 1031
 	sed -e "s#RUN_KAMAILIO=no#RUN_KAMAILIO=yes#g" \
1032 1032
 		< ../pkg/kamailio/deb/debian/kamailio.default \
1033 1033
 		> /etc/default/$(NAME)
1034
-	mkdir -p /var/run/$(NAME)
1034
+	mkdir -p /run/$(NAME)
1035 1035
 	adduser --quiet --system --group --disabled-password \
1036 1036
         --shell /bin/false --gecos "$(NAME)" \
1037
-        --home /var/run/$(NAME) $(NAME)
1038
-	chown $(NAME):$(NAME) /var/run/$(NAME)
1037
+        --home /run/$(NAME) $(NAME)
1038
+	chown $(NAME):$(NAME) /run/$(NAME)
1039 1039
 	echo "D /run/$(NAME) 0700 $(NAME) $(NAME) -" > /etc/tmpfiles.d/$(NAME).conf
1040 1040
 	@echo
1041 1041
 	@echo "* to enable kamailio service run:"
... ...
@@ -1045,18 +1045,18 @@ install_systemd_debian install-systemd-debian:
1045 1045
 install_systemd_centos install-systemd-centos:
1046 1046
 	sed -e "s#ExecStart=/usr/sbin/kamailio#ExecStart=$(bin_prefix)/$(bin_dir)$(NAME)#g" \
1047 1047
 		-e "s#Description=Kamailio#Description=$(NAME)#g" \
1048
-		-e "s#/var/run/kamailio/kamailio.pid#/var/run/$(NAME)/$(NAME).pid#g" \
1048
+		-e "s#/run/kamailio/kamailio.pid#/run/$(NAME)/$(NAME).pid#g" \
1049 1049
 		-e "s#EnvironmentFile=-/etc/sysconfig/kamailio#EnvironmentFile=-/etc/sysconfig/$(NAME)#g" \
1050 1050
 		-e "s#CFGFILE=/etc/kamailio/kamailio.cfg#CFGFILE=$(cfg_prefix)/$(cfg_dir)$(NAME).cfg#g" \
1051 1051
 		< ../pkg/kamailio/obs/kamailio.service \
1052 1052
 		> /etc/systemd/system/$(NAME).service
1053 1053
 	cp ../pkg/kamailio/obs/kamailio.sysconfig \
1054 1054
 		/etc/sysconfig/$(NAME)
1055
-	mkdir -p /var/run/$(NAME)
1056
-	chmod 0700 /var/run/$(NAME)
1055
+	mkdir -p /run/$(NAME)
1056
+	chmod 0700 /run/$(NAME)
1057 1057
 	groupadd --system $(NAME)
1058
-	useradd $(NAME) --system --shell /sbin/nologin -g $(NAME) --home /var/run/$(NAME)
1059
-	chown $(NAME):$(NAME) /var/run/$(NAME)
1058
+	useradd $(NAME) --system --shell /sbin/nologin -g $(NAME) --home /run/$(NAME)
1059
+	chown $(NAME):$(NAME) /run/$(NAME)
1060 1060
 	echo "D /run/$(NAME) 0700 $(NAME) $(NAME) -" > /etc/tmpfiles.d/$(NAME).conf
1061 1061
 	@echo
1062 1062
 	@echo "* to enable kamailio service run:"
Browse code

src/Makefile: added target to install files for systemd on Centos 7 (#1831)

* src/Makefile: added target to install files for systemd on Centos 7

added target to install systemd and sysconfig files for systemd service
installation method : make install-systemd-centos

* src/makefile : add --system parameter for user

src/makefile : add --system parameter for user
after rebooting , /run/kamailio folder is survived.

Yasin CANER authored on 01/02/2019 18:23:56 • Daniel-Constantin Mierla committed on 01/02/2019 18:23:56
Showing 1 changed files
... ...
@@ -1041,6 +1041,28 @@ install_systemd_debian install-systemd-debian:
1041 1041
 	@echo "* to enable kamailio service run:"
1042 1042
 	@echo "    systemctl enable kamailio"
1043 1043
 	@echo "    systemctl daemon-reload"
1044
+.PHONY: install_systemd_centos install-systemd-centos
1045
+install_systemd_centos install-systemd-centos:
1046
+	sed -e "s#ExecStart=/usr/sbin/kamailio#ExecStart=$(bin_prefix)/$(bin_dir)$(NAME)#g" \
1047
+		-e "s#Description=Kamailio#Description=$(NAME)#g" \
1048
+		-e "s#/var/run/kamailio/kamailio.pid#/var/run/$(NAME)/$(NAME).pid#g" \
1049
+		-e "s#EnvironmentFile=-/etc/sysconfig/kamailio#EnvironmentFile=-/etc/sysconfig/$(NAME)#g" \
1050
+		-e "s#CFGFILE=/etc/kamailio/kamailio.cfg#CFGFILE=$(cfg_prefix)/$(cfg_dir)$(NAME).cfg#g" \
1051
+		< ../pkg/kamailio/obs/kamailio.service \
1052
+		> /etc/systemd/system/$(NAME).service
1053
+	cp ../pkg/kamailio/obs/kamailio.sysconfig \
1054
+		/etc/sysconfig/$(NAME)
1055
+	mkdir -p /var/run/$(NAME)
1056
+	chmod 0700 /var/run/$(NAME)
1057
+	groupadd --system $(NAME)
1058
+	useradd $(NAME) --system --shell /sbin/nologin -g $(NAME) --home /var/run/$(NAME)
1059
+	chown $(NAME):$(NAME) /var/run/$(NAME)
1060
+	echo "D /run/$(NAME) 0700 $(NAME) $(NAME) -" > /etc/tmpfiles.d/$(NAME).conf
1061
+	@echo
1062
+	@echo "* to enable kamailio service run:"
1063
+	@echo "    systemctl daemon-reload"
1064
+	@echo "    systemctl enable kamailio"
1065
+	@echo "    systemctl start kamailio"
1044 1066
 
1045 1067
 .PHONY: dbschema
1046 1068
 dbschema:
Browse code

src/Makefile: added target to install files for systemd on debian

* make install-systemd-debian

Daniel-Constantin Mierla authored on 31/01/2019 19:01:28
Showing 1 changed files
... ...
@@ -1019,6 +1019,29 @@ install_initd_centos install-initd-centos:
1019 1019
                   -d /var/run/$(NAME) $(NAME)
1020 1020
 	chown $(NAME):$(NAME) /var/run/$(NAME)
1021 1021
 
1022
+.PHONY: install_systemd_debian install-systemd-debian
1023
+install_systemd_debian install-systemd-debian:
1024
+	sed -e "s#ExecStart=/usr/sbin/kamailio#ExecStart=$(bin_prefix)/$(bin_dir)$(NAME)#g" \
1025
+		-e "s#Description=Kamailio#Description=$(NAME)#g" \
1026
+		-e "s#/var/run/kamailio/kamailio.pid#/var/run/$(NAME)/$(NAME).pid#g" \
1027
+		-e "s#EnvironmentFile=-/etc/default/kamailio#EnvironmentFile=-/etc/default/$(NAME)#g" \
1028
+		-e "s#CFGFILE=/etc/kamailio/kamailio.cfg#CFGFILE=$(cfg_prefix)/$(cfg_dir)$(NAME).cfg#g" \
1029
+		< ../pkg/kamailio/deb/debian/kamailio.service \
1030
+		> /etc/systemd/system/$(NAME).service
1031
+	sed -e "s#RUN_KAMAILIO=no#RUN_KAMAILIO=yes#g" \
1032
+		< ../pkg/kamailio/deb/debian/kamailio.default \
1033
+		> /etc/default/$(NAME)
1034
+	mkdir -p /var/run/$(NAME)
1035
+	adduser --quiet --system --group --disabled-password \
1036
+        --shell /bin/false --gecos "$(NAME)" \
1037
+        --home /var/run/$(NAME) $(NAME)
1038
+	chown $(NAME):$(NAME) /var/run/$(NAME)
1039
+	echo "D /run/$(NAME) 0700 $(NAME) $(NAME) -" > /etc/tmpfiles.d/$(NAME).conf
1040
+	@echo
1041
+	@echo "* to enable kamailio service run:"
1042
+	@echo "    systemctl enable kamailio"
1043
+	@echo "    systemctl daemon-reload"
1044
+
1022 1045
 .PHONY: dbschema
1023 1046
 dbschema:
1024 1047
 	-@echo "Build database schemas"
Browse code

src/Makefile: adjust Makefile to populate REPO_ variables in autover.h again

Mikko Lehto authored on 11/06/2018 16:04:20 • Henning Westerholt committed on 12/06/2018 06:19:23
Showing 1 changed files
... ...
@@ -348,7 +348,7 @@ modules-cfg modules-list modules-lst:
348 348
 	rm -f modules.lst
349 349
 	$(MAKE) modules.lst
350 350
 
351
-ifneq ($(wildcard .git),)
351
+ifneq ($(wildcard ../.git),)
352 352
 # if .git/ exists
353 353
 repo_ver=$(shell  RV=`git rev-parse --verify --short=6 HEAD 2>/dev/null`;\
354 354
 					[ -n "$$RV" ] && \
... ...
@@ -358,7 +358,7 @@ repo_ver=$(shell  RV=`git rev-parse --verify --short=6 HEAD 2>/dev/null`;\
358 358
 						RV="$$RV"-dirty; echo "$$RV")
359 359
 repo_hash=$(subst -dirty,,$(repo_ver))
360 360
 repo_state=$(subst %-dirty,dirty,$(findstring -dirty,$(repo_ver)))
361
-autover_h_dep=.git $(filter-out $(auto_gen), $(sources)) core/cfg.y core/cfg.lex Makefile
361
+autover_h_dep=../.git $(filter-out $(auto_gen), $(sources)) core/cfg.y core/cfg.lex Makefile
362 362
 else
363 363
 # else if .git/ does not exist
364 364
 repo_ver=
Browse code

core: etc - basic and advanced configs relocated to misc/examples/pkg

- they are not installed by default anymore
- use 'make install-cfg-extras' to get them installed in the target etc folder

Daniel-Constantin Mierla authored on 07/11/2017 14:33:37
Showing 1 changed files
... ...
@@ -702,6 +702,7 @@ $(man_prefix)/$(man_dir)/man5:
702 702
 
703 703
 # note: sed with POSIX.1 regex doesn't support |, + or ? (darwin, solaris ...)
704 704
 install-cfg: $(cfg_prefix)/$(cfg_dir)
705
+	@# main configuration file
705 706
 	@if [ -f ../etc/$(CFG_NAME).cfg ]; then \
706 707
 			sed $(foreach m,$(modules_dirs),\
707 708
 					-e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
... ...
@@ -715,34 +716,7 @@ install-cfg: $(cfg_prefix)/$(cfg_dir)
715 716
 					$(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg; \
716 717
 			fi; \
717 718
 		fi
718
-	@if [ -f ../etc/$(CFG_NAME)-basic.cfg ]; then \
719
-			sed $(foreach m,$(modules_dirs),\
720
-					-e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
721
-					-e "s#/usr/local/etc/$(CFG_NAME)/#$(cfg_target)#g" \
722
-				< ../etc/$(CFG_NAME)-basic.cfg \
723
-				> $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg.sample; \
724
-			chmod 644 $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg.sample; \
725
-			if [ -z "${skip_cfg_install}" -a \
726
-					! -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg ]; then \
727
-				mv -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg.sample \
728
-					$(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg; \
729
-			fi; \
730
-		fi
731
-	@if [ -f ../etc/$(CFG_NAME)-oob.cfg ]; then \
732
-			sed $(foreach m,$(modules_dirs),\
733
-					-e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
734
-					-e "s#/usr/local/etc/$(CFG_NAME)/#$(cfg_target)#g" \
735
-				< ../etc/$(CFG_NAME)-oob.cfg \
736
-				> $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample; \
737
-			chmod 644 $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample; \
738
-			if [ -z "${skip_cfg_install}" -a \
739
-					! -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg ]; \
740
-			then \
741
-				mv -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample \
742
-					$(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg; \
743
-			fi; \
744
-		fi
745
-	@# other configs
719
+	@# other configuration files
746 720
 	@for r in $(C_INSTALL_CFGS) ""; do \
747 721
 			if [ -n "$$r" ]; then \
748 722
 				if [ -f "$$r" ]; then \
... ...
@@ -768,6 +742,36 @@ install-cfg: $(cfg_prefix)/$(cfg_dir)
768 742
 			: ; done; true
769 743
 	@echo "config files installed"
770 744
 
745
+# additional examples of configuration files
746
+install-cfg-extras: $(cfg_prefix)/$(cfg_dir)
747
+	@if [ -f ../misc/examples/pkg/$(CFG_NAME)-basic.cfg ]; then \
748
+			sed $(foreach m,$(modules_dirs),\
749
+					-e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
750
+					-e "s#/usr/local/etc/$(CFG_NAME)/#$(cfg_target)#g" \
751
+				< ../misc/examples/pkg/$(CFG_NAME)-basic.cfg \
752
+				> $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg.sample; \
753
+			chmod 644 $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg.sample; \
754
+			if [ -z "${skip_cfg_install}" -a \
755
+					! -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg ]; then \
756
+				mv -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg.sample \
757
+					$(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg; \
758
+			fi; \
759
+		fi
760
+	@if [ -f ../misc/examples/pkg/$(CFG_NAME)-oob.cfg ]; then \
761
+			sed $(foreach m,$(modules_dirs),\
762
+					-e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
763
+					-e "s#/usr/local/etc/$(CFG_NAME)/#$(cfg_target)#g" \
764
+				< ../misc/examples/pkg/$(CFG_NAME)-oob.cfg \
765
+				> $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample; \
766
+			chmod 644 $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample; \
767
+			if [ -z "${skip_cfg_install}" -a \
768
+					! -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg ]; \
769
+			then \
770
+				mv -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample \
771
+					$(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg; \
772
+			fi; \
773
+		fi
774
+
771 775
 install-cfg-pkg: $(cfg_prefix)/$(cfg_dir)
772 776
 	@if [ -f ../misc/examples/pkg/sipcapture.cfg ]; then \
773 777
 			sed $(foreach m,$(modules_dirs),\
Browse code

core: moved radius dictionary files from etc to auth_radius module

Daniel-Constantin Mierla authored on 07/11/2017 12:15:57
Showing 1 changed files
... ...
@@ -766,9 +766,6 @@ install-cfg: $(cfg_prefix)/$(cfg_dir)
766 766
 				fi ; \
767 767
 			fi ; \
768 768
 			: ; done; true
769
-	@# radius dictionary
770
-	@$(INSTALL_TOUCH) $(cfg_prefix)/$(cfg_dir)/dictionary.$(CFG_NAME)
771
-	@$(INSTALL_CFG) ../etc/dictionary.$(CFG_NAME) $(cfg_prefix)/$(cfg_dir)
772 769
 	@echo "config files installed"
773 770
 
774 771
 install-cfg-pkg: $(cfg_prefix)/$(cfg_dir)
Browse code

pkg/kamailio/obs: added package for sipcapture daemon

- includes config and system files
- worked from PR #1106

Sergey Safarov authored on 07/11/2017 11:58:01 • Daniel-Constantin Mierla committed on 07/11/2017 11:58:01
Showing 1 changed files
... ...
@@ -700,7 +700,7 @@ $(man_prefix)/$(man_dir)/man7:
700 700
 $(man_prefix)/$(man_dir)/man5:
701 701
 		mkdir -p $(man_prefix)/$(man_dir)/man5
702 702
 
703
-# note: sed with POSIX.1 regex doesn't support |, + or ? (darwin, solaris ...) 
703
+# note: sed with POSIX.1 regex doesn't support |, + or ? (darwin, solaris ...)
704 704
 install-cfg: $(cfg_prefix)/$(cfg_dir)
705 705
 	@if [ -f ../etc/$(CFG_NAME).cfg ]; then \
706 706
 			sed $(foreach m,$(modules_dirs),\
... ...
@@ -771,6 +771,22 @@ install-cfg: $(cfg_prefix)/$(cfg_dir)
771 771
 	@$(INSTALL_CFG) ../etc/dictionary.$(CFG_NAME) $(cfg_prefix)/$(cfg_dir)
772 772
 	@echo "config files installed"
773 773
 
774
+install-cfg-pkg: $(cfg_prefix)/$(cfg_dir)
775
+	@if [ -f ../misc/examples/pkg/sipcapture.cfg ]; then \
776
+			sed $(foreach m,$(modules_dirs),\
777
+					-e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
778
+					-e "s#/usr/local/etc/$(CFG_NAME)/#$(cfg_target)#g" \
779
+				< ../misc/examples/pkg/sipcapture.cfg \
780
+				> $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-sipcapture.cfg.sample; \
781
+			chmod 644 $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-sipcapture.cfg.sample; \
782
+			if [ -z "${skip_cfg_install}" -a \
783
+					! -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-sipcapture.cfg ]; \
784
+			then \
785
+				mv -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-sipcapture.cfg.sample \
786
+					$(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-sipcapture.cfg; \
787
+			fi; \
788
+		fi
789
+
774 790
 install-bin: $(bin_prefix)/$(bin_dir) $(NAME)
775 791
 	$(INSTALL_TOUCH) $(bin_prefix)/$(bin_dir)/$(NAME)
776 792
 	$(INSTALL_BIN) $(NAME) $(bin_prefix)/$(bin_dir)
Browse code

Makefile: deb rule, remove --no-sign and use -us -uc

* --no-sign just works for stretch

Victor Seva authored on 13/06/2017 13:39:00
Showing 1 changed files
... ...
@@ -611,11 +611,11 @@ bin:
611 611
 deb:
612 612
 	(cd ..; \
613 613
 	if [ -d debian ]; then \
614
-		dpkg-buildpackage -rfakeroot -tc --no-sign; \
614
+		dpkg-buildpackage -rfakeroot -tc -uc -us; \
615 615
 		rm debian; \
616 616
 	else \
617 617
 		ln -s pkg/$(MAIN_NAME)/deb/debian debian; \
618
-		dpkg-buildpackage -rfakeroot -tc --no-sign; \
618
+		dpkg-buildpackage -rfakeroot -tc -uc -us; \
619 619
 		rm debian; \
620 620
 	fi)
621 621
 
... ...
@@ -623,11 +623,11 @@ deb:
623 623
 deb-stable:
624 624
 	(cd ..; \
625 625
 	if [ -d debian ]; then \
626
-		dpkg-buildpackage -rfakeroot -tc --no-sign; \
626
+		dpkg-buildpackage -rfakeroot -tc -uc -us; \
627 627
 		rm debian; \
628 628
 	else \
629 629
 		ln -s pkg/$(MAIN_NAME)/deb/jessie debian; \
630
-		dpkg-buildpackage -rfakeroot -tc --no-sign; \
630
+		dpkg-buildpackage -rfakeroot -tc -uc -us; \
631 631
 		rm debian; \
632 632
 	fi)
633 633
 
Browse code

src/Makefile: fix make deb rules

* dpkg-buildpackage needs to be executed from the root of the project
* don't sign any file

Victor Seva authored on 02/06/2017 08:14:46
Showing 1 changed files
... ...
@@ -609,25 +609,27 @@ bin:
609 609
 
610 610
 .PHONY: deb
611 611
 deb:
612
-	-@if [ -d debian ]; then \
613
-		dpkg-buildpackage -rfakeroot -tc; \
612
+	(cd ..; \
613
+	if [ -d debian ]; then \
614
+		dpkg-buildpackage -rfakeroot -tc --no-sign; \
614 615
 		rm debian; \
615 616
 	else \
616
-		ln -s ../pkg/$(MAIN_NAME)/deb/debian debian; \
617
-		dpkg-buildpackage -rfakeroot -tc; \
617
+		ln -s pkg/$(MAIN_NAME)/deb/debian debian; \
618
+		dpkg-buildpackage -rfakeroot -tc --no-sign; \
618 619
 		rm debian; \
619
-	fi
620
+	fi)
620 621
 
621 622
 .PHONY: deb-stable
622 623
 deb-stable:
623
-	-@if [ -d debian ]; then \
624
-		dpkg-buildpackage -rfakeroot -tc; \
624
+	(cd ..; \
625
+	if [ -d debian ]; then \
626
+		dpkg-buildpackage -rfakeroot -tc --no-sign; \
625 627
 		rm debian; \
626 628
 	else \
627
-		ln -s ../pkg/$(MAIN_NAME)/deb/jessie debian; \
628
-		dpkg-buildpackage -rfakeroot -tc; \
629
+		ln -s pkg/$(MAIN_NAME)/deb/jessie debian; \
630
+		dpkg-buildpackage -rfakeroot -tc --no-sign; \
629 631
 		rm debian; \
630
-	fi
632
+	fi)
631 633
 
632 634
 .PHONY: sunpkg
633 635
 sunpkg:
Browse code

Makefile: make tar updated to skip obsolete folder

- paths updated to run with src folder

Daniel-Constantin Mierla authored on 28/02/2017 10:46:09
Showing 1 changed files
... ...
@@ -558,17 +558,19 @@ makefile_vars makefile-vars:
558 558
 dist: tar
559 559
 
560 560
 tar: makefile_vars $(auto_gen_keep)
561
-	$(TAR) -C .. \
562
-		--exclude=$(notdir $(CURDIR))/test* \
563
-		--exclude=$(notdir $(CURDIR))/tmp* \
564
-		--exclude=$(notdir $(CURDIR))/debian \
565
-		--exclude=$(notdir $(CURDIR))/debian/$(MAIN_NAME) \
566
-		--exclude=$(notdir $(CURDIR))/debian/$(MAIN_NAME)-* \
567
-		--exclude=$(notdir $(CURDIR))/$(MAIN_NAME)_tls* \
561
+	$(TAR) -C ../.. \
562
+		--exclude=$(notdir $(realpath $(shell pwd)/..))/test* \
563
+		--exclude=$(notdir $(realpath $(shell pwd)/..))/tmp* \
564
+		--exclude=$(notdir $(realpath $(shell pwd)/..))/debian \
565
+		--exclude=$(notdir $(realpath $(shell pwd)/..))/debian/$(MAIN_NAME) \
566
+		--exclude=$(notdir $(realpath $(shell pwd)/..))/debian/$(MAIN_NAME)-* \
567
+		--exclude=$(notdir $(realpath $(shell pwd)/..))/$(MAIN_NAME)_tls* \
568
+		--exclude=$(notdir $(realpath $(shell pwd)/..))/misc/obsolete \
568 569
 		--exclude=.git* \
569 570
 		--exclude=CVS* \
570 571
 		--exclude=.svn* \
571 572
 		--exclude=.cvsignore \
573
+		--exclude=tags \
572 574
 		--exclude=librpath.lst \
573 575
 		--exclude=libiname.lst \
574 576
 		--exclude=makecfg.lst \
... ...
@@ -577,7 +579,8 @@ tar: makefile_vars $(auto_gen_keep)
577 579
 		--exclude=*.[do] \
578 580
 		--exclude=*.so \
579 581
 		--exclude=*.il \
580
-		--exclude=$(notdir $(CURDIR))/$(MAIN_NAME) \
582
+		--exclude=$(notdir $(realpath $(shell pwd)/..))/$(MAIN_NAME) \
583
+		--exclude=$(notdir $(realpath $(shell pwd)/..))/src/$(MAIN_NAME) \
581 584
 		--exclude=*.gz \
582 585
 		--exclude=*.bz2 \
583 586
 		--exclude=*.tar \
... ...
@@ -586,15 +589,15 @@ tar: makefile_vars $(auto_gen_keep)
586 589
 		--exclude=*.swp \
587 590
 		--exclude=*.swo \
588 591
 		${tar_extra_args} \
589
-		-cf - $(notdir $(CURDIR)) | \
590
-			(mkdir -p tmp/_tar1; mkdir -p tmp/_tar2 ; \
591
-			    cd tmp/_tar1; $(TAR) -xf - ) && \
592
-			    mv tmp/_tar1/$(notdir $(CURDIR)) \
593
-			       tmp/_tar2/"$(NAME)-$(RELEASE)" && \
594
-			    (cd tmp/_tar2 && $(TAR) \
592
+		-cf - $(notdir $(realpath $(shell pwd)/..)) | \
593
+			(mkdir -p ../tmp/_tar1; mkdir -p ../tmp/_tar2 ; \
594
+			    cd ../tmp/_tar1; $(TAR) -xf - ) && \
595
+			    mv ../tmp/_tar1/$(notdir $(realpath $(shell pwd)/..)) \
596
+			       ../tmp/_tar2/"$(NAME)-$(RELEASE)" && \
597
+			    (cd ../tmp/_tar2 && $(TAR) \
595 598
 			                    -zcf ../../"$(tar_name)".tar.gz \
596 599
 			                               "$(NAME)-$(RELEASE)" ) ; \
597
-			    rm -rf tmp/_tar1; rm -rf tmp/_tar2
600
+			    rm -rf ../tmp/_tar1; rm -rf ../tmp/_tar2; rm -rf ../tmp
598 601
 
599 602
 # binary dist. tar.gz
600 603
 .PHONY: bin
Browse code

Makefile: updated paths for make deb

Daniel-Constantin Mierla authored on 07/12/2016 18:19:55
Showing 1 changed files
... ...
@@ -610,7 +610,7 @@ deb:
610 610
 		dpkg-buildpackage -rfakeroot -tc; \
611 611
 		rm debian; \
612 612
 	else \
613
-		ln -s pkg/$(MAIN_NAME)/deb/debian debian; \
613
+		ln -s ../pkg/$(MAIN_NAME)/deb/debian debian; \
614 614
 		dpkg-buildpackage -rfakeroot -tc; \
615 615
 		rm debian; \
616 616
 	fi
... ...
@@ -621,7 +621,7 @@ deb-stable:
621 621
 		dpkg-buildpackage -rfakeroot -tc; \
622 622
 		rm debian; \
623 623
 	else \
624
-		ln -s pkg/$(MAIN_NAME)/deb/wheezy debian; \
624
+		ln -s ../pkg/$(MAIN_NAME)/deb/jessie debian; \
625 625
 		dpkg-buildpackage -rfakeroot -tc; \
626 626
 		rm debian; \
627 627
 	fi
Browse code

Makefile: do not install old unmaintained doc-related files

Daniel-Constantin Mierla authored on 07/12/2016 16:42:07
Showing 1 changed files
... ...
@@ -841,12 +841,6 @@ install-modules-all: install-every-module install-every-module-doc
841 841
 install-doc: $(doc_prefix)/$(doc_dir) install-every-module-doc
842 842
 	$(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/INSTALL
843 843
 	$(INSTALL_DOC) ../INSTALL $(doc_prefix)/$(doc_dir)
844
-	$(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/README-MODULES
845
-	$(INSTALL_DOC) ../README-MODULES $(doc_prefix)/$(doc_dir)
846
-	$(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/AUTHORS
847
-	$(INSTALL_DOC) ../AUTHORS $(doc_prefix)/$(doc_dir)
848
-	$(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/NEWS
849
-	$(INSTALL_DOC) ../NEWS $(doc_prefix)/$(doc_dir)
850 844
 	$(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/README
851 845
 	$(INSTALL_DOC) ../README $(doc_prefix)/$(doc_dir)
852 846
 
Browse code

Makefile: updated paths for installing the tools

Daniel-Constantin Mierla authored on 07/12/2016 12:21:01
Showing 1 changed files
... ...
@@ -202,7 +202,7 @@ cmodules=$(foreach mods,$(modules_dirs), $($(mods)))
202 202
 
203 203
 
204 204
 # list of utils directories that should be compiled by make utils
205
-C_COMPILE_UTILS=	utils/kamcmd
205
+C_COMPILE_UTILS=	../utils/kamcmd
206 206
 # list of binaries that should be installed alongside
207 207
 # (they should be created after make utils, see C_COMPILE_UTILS)
208 208
 C_INSTALL_BIN=	# kamcmd is now installed by ctl
... ...
@@ -210,7 +210,7 @@ C_INSTALL_BIN=	# kamcmd is now installed by ctl
210 210
 # which utils know to install themselves and should be installed
211 211
 # along the core (list of utils directories)
212 212
 ifeq ($(FLAVOUR),kamailio)
213
-C_INSTALL_UTILS= utils/kamctl
213
+C_INSTALL_UTILS= ../utils/kamctl
214 214
 else
215 215
 C_INSTALL_UTILS=
216 216
 endif
... ...
@@ -697,11 +697,11 @@ $(man_prefix)/$(man_dir)/man5:
697 697
 
698 698
 # note: sed with POSIX.1 regex doesn't support |, + or ? (darwin, solaris ...) 
699 699
 install-cfg: $(cfg_prefix)/$(cfg_dir)
700
-	@if [ -f etc/$(CFG_NAME).cfg ]; then \
700
+	@if [ -f ../etc/$(CFG_NAME).cfg ]; then \
701 701
 			sed $(foreach m,$(modules_dirs),\
702 702
 					-e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
703 703
 					-e "s#/usr/local/etc/$(CFG_NAME)/#$(cfg_target)#g" \
704
-				< etc/$(CFG_NAME).cfg \
704
+				< ../etc/$(CFG_NAME).cfg \
705 705
 				> $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg.sample; \
706 706
 			chmod 644 $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg.sample; \
707 707
 			if [ -z "${skip_cfg_install}" -a \
... ...
@@ -710,11 +710,11 @@ install-cfg: $(cfg_prefix)/$(cfg_dir)
710 710
 					$(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg; \
711 711
 			fi; \
712 712
 		fi
713
-	@if [ -f etc/$(CFG_NAME)-basic.cfg ]; then \
713
+	@if [ -f ../etc/$(CFG_NAME)-basic.cfg ]; then \
714 714
 			sed $(foreach m,$(modules_dirs),\
715 715
 					-e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
716 716
 					-e "s#/usr/local/etc/$(CFG_NAME)/#$(cfg_target)#g" \
717
-				< etc/$(CFG_NAME)-basic.cfg \
717
+				< ../etc/$(CFG_NAME)-basic.cfg \
718 718
 				> $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg.sample; \
719 719
 			chmod 644 $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg.sample; \
720 720
 			if [ -z "${skip_cfg_install}" -a \
... ...
@@ -723,11 +723,11 @@ install-cfg: $(cfg_prefix)/$(cfg_dir)
723 723
 					$(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg; \
724 724
 			fi; \
725 725
 		fi
726
-	@if [ -f etc/$(CFG_NAME)-oob.cfg ]; then \
726
+	@if [ -f ../etc/$(CFG_NAME)-oob.cfg ]; then \
727 727
 			sed $(foreach m,$(modules_dirs),\
728 728
 					-e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
729 729
 					-e "s#/usr/local/etc/$(CFG_NAME)/#$(cfg_target)#g" \
730
-				< etc/$(CFG_NAME)-oob.cfg \
730
+				< ../etc/$(CFG_NAME)-oob.cfg \
731 731
 				> $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample; \
732 732
 			chmod 644 $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample; \
733 733
 			if [ -z "${skip_cfg_install}" -a \
... ...
@@ -763,7 +763,7 @@ install-cfg: $(cfg_prefix)/$(cfg_dir)
763 763
 			: ; done; true
764 764
 	@# radius dictionary
765 765
 	@$(INSTALL_TOUCH) $(cfg_prefix)/$(cfg_dir)/dictionary.$(CFG_NAME)
766
-	@$(INSTALL_CFG) etc/dictionary.$(CFG_NAME) $(cfg_prefix)/$(cfg_dir)
766
+	@$(INSTALL_CFG) ../etc/dictionary.$(CFG_NAME) $(cfg_prefix)/$(cfg_dir)
767 767
 	@echo "config files installed"
768 768
 
769 769
 install-bin: $(bin_prefix)/$(bin_dir) $(NAME)
... ...
@@ -839,16 +839,16 @@ install-modules-all: install-every-module install-every-module-doc
839 839
 
840 840
 
841 841
 install-doc: $(doc_prefix)/$(doc_dir) install-every-module-doc
842
-	$(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/INSTALL 
843
-	$(INSTALL_DOC) INSTALL $(doc_prefix)/$(doc_dir)
844
-	$(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/README-MODULES 
845
-	$(INSTALL_DOC) README-MODULES $(doc_prefix)/$(doc_dir)
846
-	$(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/AUTHORS 
847
-	$(INSTALL_DOC) AUTHORS $(doc_prefix)/$(doc_dir)
842
+	$(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/INSTALL
843
+	$(INSTALL_DOC) ../INSTALL $(doc_prefix)/$(doc_dir)
844
+	$(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/README-MODULES
845
+	$(INSTALL_DOC) ../README-MODULES $(doc_prefix)/$(doc_dir)
846
+	$(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/AUTHORS
847
+	$(INSTALL_DOC) ../AUTHORS $(doc_prefix)/$(doc_dir)
848 848
 	$(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/NEWS
849
-	$(INSTALL_DOC) NEWS $(doc_prefix)/$(doc_dir)
850
-	$(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/README 
851
-	$(INSTALL_DOC) README $(doc_prefix)/$(doc_dir)
849
+	$(INSTALL_DOC) ../NEWS $(doc_prefix)/$(doc_dir)
850
+	$(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/README
851
+	$(INSTALL_DOC) ../README $(doc_prefix)/$(doc_dir)
852 852
 
853 853
 
854 854
 install-sr-man: $(man_prefix)/$(man_dir)/man8 $(man_prefix)/$(man_dir)/man5
... ...
@@ -858,7 +858,7 @@ install-sr-man: $(man_prefix)/$(man_dir)/man8 $(man_prefix)/$(man_dir)/man5
858 858
 				-e "s#/usr/lib/$(CFG_NAME)/$(m)\([^_]\)#$($(m)_target)\1#g") \
859 859
 			-e "s#/usr/share/doc/$(CFG_NAME)/#$(doc_target)#g" \
860 860
 			-e "s#$(SRC_NAME)#$(MAIN_NAME)#g" \
861
-			< doc/man/$(MAIN_NAME).8 >  \
861
+			< ../doc/man/$(MAIN_NAME).8 >  \
862 862
 							$(man_prefix)/$(man_dir)/man8/$(MAIN_NAME).8
863 863
 		@chmod 644  $(man_prefix)/$(man_dir)/man8/$(MAIN_NAME).8
864 864
 		@sed -e "s#/etc/$(CFG_NAME)/$(CFG_NAME)\.cfg#$(cfg_target)$(MAIN_NAME).cfg#g" \
... ...
@@ -867,7 +867,7 @@ install-sr-man: $(man_prefix)/$(man_dir)/man8 $(man_prefix)/$(man_dir)/man5
867 867
 				-e "s#/usr/lib/$(CFG_NAME)/$(m)\([^_]\)#$($(m)_target)\1#g") \
868 868
 			-e "s#/usr/share/doc/$(CFG_NAME)/#$(doc_target)#g" \
869 869
 			-e "s#$(SRC_NAME)#$(MAIN_NAME)#g" \
870
-			< doc/man/$(MAIN_NAME).cfg.5 >  \
870
+			< ../doc/man/$(MAIN_NAME).cfg.5 >  \
871 871
 			$(man_prefix)/$(man_dir)/man5/$(MAIN_NAME).cfg.5
872 872
 		@chmod 644  $(man_prefix)/$(man_dir)/man5/$(MAIN_NAME).cfg.5
873 873
 
Browse code

core: makefiles updated to use the new paths to source code files

Daniel-Constantin Mierla authored on 07/12/2016 11:08:54
Showing 1 changed files
... ...
@@ -17,9 +17,9 @@ $(error make version $(MAKE_VERSION) not supported, use at least $(req_ver))
17 17
 endif
18 18
 
19 19
 
20
-auto_gen=lex.yy.c cfg.tab.c #lexx, yacc etc
21
-auto_gen_others=cfg.tab.h # auto generated, non-c
22
-auto_gen_keep=autover.h # auto generated, should be included in archives
20
+auto_gen=core/lex.yy.c core/cfg.tab.c #lexx, yacc etc
21
+auto_gen_others=core/cfg.tab.h # auto generated, non-c
22
+auto_gen_keep=core/autover.h # auto generated, should be included in archives
23 23
 
24 24
 COREPATH=.
25 25
 #include  source related defs
... ...
@@ -253,14 +253,14 @@ endif
253 253
 # include the common rules
254 254
 include Makefile.rules
255 255
 
256
-#extra targets 
256
+#extra targets
257 257
 
258 258
 $(NAME): $(extra_objs) # static_modules
259 259
 
260
-lex.yy.c: cfg.lex cfg.tab.h $(ALLDEP)
261
-	$(LEX) $<
260
+core/lex.yy.c: core/cfg.lex core/cfg.tab.h $(ALLDEP)
261
+	$(LEX) -o core/lex.yy.c $<
262 262
 
263
-cfg.tab.c cfg.tab.h: cfg.y  $(ALLDEP)
263
+core/cfg.tab.c core/cfg.tab.h: core/cfg.y  $(ALLDEP)
264 264
 	$(YACC) $(YACC_FLAGS) $<
265 265
 
266 266
 nullstring=
... ...
@@ -275,7 +275,7 @@ main.o: DEFS+=-DMODS_DIR='"$(modules_search_path)"'
275 275
 
276 276
 
277 277
 #special depends for ver.c
278
-ver.d ver.o: autover.h
278
+core/ver.d core/ver.o: core/autover.h
279 279
 
280 280
 include Makefile.shared
281 281
 
... ...
@@ -358,7 +358,7 @@ repo_ver=$(shell  RV=`git rev-parse --verify --short=6 HEAD 2>/dev/null`;\
358 358
 						RV="$$RV"-dirty; echo "$$RV")
359 359
 repo_hash=$(subst -dirty,,$(repo_ver))
360 360
 repo_state=$(subst %-dirty,dirty,$(findstring -dirty,$(repo_ver)))
361
-autover_h_dep=.git $(filter-out $(auto_gen), $(sources)) cfg.y cfg.lex Makefile
361
+autover_h_dep=.git $(filter-out $(auto_gen), $(sources)) core/cfg.y core/cfg.lex Makefile
362 362
 else
363 363
 # else if .git/ does not exist
364 364
 repo_ver=
... ...
@@ -368,9 +368,9 @@ autover_h_dep=
368 368
 endif
369 369
 
370 370
 
371
-autover.h: $(autover_h_dep)
372
-	@echo  "generating autover.h ..."
373
-	@echo "/* this file is autogenerated by make autover.h" >$@
371
+core/autover.h: $(autover_h_dep)
372
+	@echo  "generating core/autover.h ..."
373
+	@echo "/* this file is autogenerated by make core/autover.h" >$@
374 374
 	@echo " * DO NOT EDIT IT" >>$@
375 375
 	@echo " */" >>$@
376 376
 	@echo "" >>$@
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,1067 @@
1
+# Kamailio makefile
2
+#
3
+# WARNING: requires gmake (GNU Make)
4
+#  Arch supported: Linux, FreeBSD, SunOS (tested on Solaris 8), OpenBSD (3.2),
5
+#  NetBSD (1.6), OS/X
6
+#
7
+
8
+# check make version
9
+# everything works with 3.80, except evals inside ifeq/endif
10
+# (see https://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=1516).
11
+# recommended 3.81
12
+req_ver=3.81
13
+# the check below works for version number of the type x.yy or x.yy.z*
14
+# (from the GNU Make Cookbook)
15
+ifeq (,$(filter $(req_ver),$(firstword $(sort $(MAKE_VERSION) $(req_ver)))))
16
+$(error make version $(MAKE_VERSION) not supported, use at least $(req_ver))
17
+endif
18
+
19
+
20
+auto_gen=lex.yy.c cfg.tab.c #lexx, yacc etc
21
+auto_gen_others=cfg.tab.h # auto generated, non-c
22
+auto_gen_keep=autover.h # auto generated, should be included in archives
23
+
24
+COREPATH=.
25
+#include  source related defs
26
+include Makefile.sources
27
+#include special targets lists
28
+include Makefile.targets
29
+
30
+# whether or not the entire build process should fail if building a module or
31
+#  an utility fails
32
+err_fail?=1
33
+
34
+# whether or not to install $(MAIN_NAME).cfg or just $(MAIN_NAME).cfg.default
35
+# ($(MAIN_NAME).cfg will never be overwritten by make install, this is usefull
36
+#  when creating packages)
37
+skip_cfg_install?=
38
+
39
+#extra modules to exclude
40
+skip_modules?=
41
+
42
+# see Makefile.dirs for the directories used for the modules
43
+include Makefile.dirs
44
+
45
+# Set document format
46
+# Alternatives are txt, html, xhtml, and pdf (see Makefile.doc)
47
+doc_format?=html
48
+
49
+# don't force modules.lst generation if the makefile goals do not
50
+# require it (but if present use it)
51
+ifeq (,$(strip $(filter-out $(clean_targets) $(aux_targets),$(MAKECMDGOALS))))
52
+ifneq (,$(strip $(wildcard modules.lst)))
53
+-include modules.lst
54
+endif
55
+else
56
+include modules.lst
57
+endif # ifneq (,$(strip $(filter-out ...,$(MAKECMDGOALS))))
58
+
59
+#if called with group_include, ignore the modules from modules.lst
60
+ifneq ($(group_include),)
61
+	include_modules=
62
+	exclude_modules=
63
+	modules_configured:=0
64
+endif
65
+
66
+# get the groups of modules to compile
67
+include Makefile.groups
68
+
69
+# - automatically build the list of excluded modules
70
+# if not set on the cmd. line, env or in the modules.lst (cfg_group_include)
71
+# exclude the below modules.
72
+ifneq ($(group_include)$(cfg_group_include),)
73
+	# For group_include, default all modules are excluded except those in
74
+	# include_modules
75
+	exclude_modules?=
76
+else
77
+	# Old defaults for backwards compatibility
78
+	# excluded because they depend on external libraries
79
+ifeq ($(origin exclude_modules), undefined)
80
+	exclude_modules:= $(sort \
81
+				$(filter-out $(module_group_default), $(mod_list_all)))
82
+endif
83
+endif
84
+
85
+# always add skip_modules list - it is done now in modules.lst (dcm)
86
+# override exclude_modules+= $(skip_modules)
87
+
88
+# Test for the groups and add to include_modules
89
+ifneq (,$(group_include))
90
+$(eval override include_modules+= $(foreach grp, $(group_include), \
91
+										$(module_group_$(grp)) ))
92
+endif
93
+
94
+ALLDEP=config.mak Makefile Makefile.dirs Makefile.sources Makefile.rules
95
+
96
+#include general defs (like CC, CFLAGS  a.s.o)
97
+# hack to force makefile.defs re-inclusion (needed when make calls itself with
98
+# other options -- e.g. make bin)
99
+#makefile_defs=0
100
+#C_DEFS:=
101
+
102
+
103
+# try saved cfg, unless we are in the process of building it or if we're doing
104
+# a clean
105
+ifeq (,$(strip \
106
+	$(filter config.mak config cfg cfg-defs $(clean_targets),$(MAKECMDGOALS))))
107
+include config.mak
108
+ifeq ($(makefile_defs),1)
109
+ifeq ($(quiet),verbose)
110
+$(info config.mak loaded)
111
+endif # verbose
112
+export makefile_defs
113
+# config_make valid & used
114
+config_mak=1
115
+ifeq ($(MAIN_NAME),)
116
+$(error "bad config.mak, try re-running make cfg")
117
+endif
118
+endif
119
+else # config.mak doesn't need to be used
120
+ifneq (,$(filter cfg config cfg-defs,$(word 1,$(MAKECMDGOALS))))
121
+# needed here to avoid starting a config submake 
122
+# (e.g. rm -f config.mak; make config.mak), which would either require 
123
+# double Makefile.defs defines execution (suboptimal), would loose
124
+# $(value ...) expansion or would cause some warning (if Makefile.defs exec. 
125
+# is skipped in the "main" makefile invocation).
126
+$(shell rm -rf config.mak)
127
+config_mak=0
128
+makefile_defs=0
129
+exported_vars=0
130
+else
131
+# config.mak not strictly needed, but try to load it if exists for $(Q)
132
+config_mak=skip
133
+-include config.mak
134
+export makefile_defs
135
+endif
136
+endif
137
+
138
+
139
+main_makefile=1
140
+include Makefile.defs
141
+
142
+static_modules_path=$(addprefix modules/, $(static_modules))
143
+extra_sources=$(wildcard $(addsuffix /*.c, $(static_modules_path)))
144
+extra_objs=$(extra_sources:.c=.o)
145
+
146
+static_defs:= $(foreach  mod, $(static_modules), \
147
+		-DSTATIC_$(shell echo $(mod) | tr [:lower:] [:upper:]) )
148
+
149
+override extra_defs+=$(static_defs) $(EXTRA_DEFS)
150
+export extra_defs
151
+
152
+# Historically, the resultant set of modules is: modules/* - exclude_modules +
153
+# include_modules
154
+# When group_include is used, we want: include_modules (based on group_include)
155
+# - exclude_modules
156
+
157
+ifneq ($(modules_configured),1) 
158
+#modules_all=$(filter-out modules/CVS,$(wildcard modules/*))
159
+
160
+# create modules*_all vars
161
+$(foreach mods,$(modules_dirs),$(eval \
162
+	$(mods)_all=$$(filter-out $(mods)/CVS,$$(wildcard $(mods)/*))))
163
+#debugging
164
+#$(foreach mods,$(modules_dirs),$(info "$(mods)_all=$($(mods)_all)"))
165
+
166
+ifneq ($(group_include),)
167
+$(foreach mods,$(modules_dirs),$(eval \
168
+	$(mods)=$$(filter-out $$(addprefix $(mods)/, \
169
+			$$(exclude_modules) $$(static_modules)), \
170
+			$$(addprefix $(mods)/, $$(include_modules) )) ))
171
+else	
172
+	# Standard, old resultant set
173
+$(foreach mods,$(modules_dirs),$(eval \
174
+	$(mods)_noinc=$$(filter-out $$(addprefix $(mods)/, \
175
+			$$(exclude_modules) $$(static_modules)), $$($(mods)_all)) \
176
+))
177
+$(foreach mods,$(modules_dirs),$(eval \
178
+	$(mods)=$$(filter-out $$(modules_noinc), \
179
+			$$(addprefix $(mods)/, $$(include_modules) )) $$($(mods)_noinc) \
180
+))
181
+endif # ifneq($(group_include),)
182
+endif # ifneq($(modules_configured),1)
183
+
184
+$(foreach mods,$(modules_dirs),$(eval \
185
+	$(mods)_names=$$(shell echo $$($(mods))| \
186
+				sed -e "s/$(mods)"'\/\([^/ ]*\)\/*/\1.so/g' ) \
187
+))
188
+$(foreach mods,$(modules_dirs),$(eval \
189
+	$(mods)_basenames:=$$(shell echo $$($(mods))| \
190
+				sed -e "s/$(mods)"'\/\([^/ ]*\)\/*/\1/g' ) \
191
+))
192
+
193
+# all modules from all the $(modules_dirs)
194
+all_modules_lst=$(foreach mods,$(modules_dirs), $($(mods)_all))
195
+
196
+# compile modules list (all the compiled mods from  $(modules_dirs))
197
+cmodules=$(foreach mods,$(modules_dirs), $($(mods)))
198
+
199
+#modules_names=$(patsubst modules/%, %.so, $(modules))
200
+#modules_full_path=$(join  $(modules), $(addprefix /, $(modules_names)))
201
+
202
+
203
+
204
+# list of utils directories that should be compiled by make utils
205
+C_COMPILE_UTILS=	utils/kamcmd
206
+# list of binaries that should be installed alongside
207
+# (they should be created after make utils, see C_COMPILE_UTILS)
208
+C_INSTALL_BIN=	# kamcmd is now installed by ctl
209
+
210
+# which utils know to install themselves and should be installed
211
+# along the core (list of utils directories)
212
+ifeq ($(FLAVOUR),kamailio)
213
+C_INSTALL_UTILS= utils/kamctl
214
+else
215
+C_INSTALL_UTILS=
216
+endif
217
+# list of scripts that should be installed along the core 
218
+# (here a script is something that doesn't have a Makefile)
219
+C_INSTALL_SCRIPTS=
220
+# list of extra configs that should be installed along the core
221
+# Note: all the paths of the form /usr/*lib/$(CFG_NAME)/<module_dir>
222
+# will be updated to the directory where the modules will be installed.
223
+C_INSTALL_CFGS=
224
+# list of files that should be installed in the arch-independent 
225
+# directory (by default /usr/local/share/$(MAIN_NAME)))
226
+C_INSTALL_SHARE=
227
+
228
+
229
+
230
+
231
+NAME=$(MAIN_NAME)
232
+
233
+tar_name=$(NAME)-$(RELEASE)_src
234
+
235
+tar_extra_args+=$(addprefix --exclude=$(notdir $(CURDIR))/, \