-# $Id$
-#
-# sip_router makefile
+# Kamailio makefile
#
# WARNING: requires gmake (GNU Make)
# Arch supported: Linux, FreeBSD, SunOS (tested on Solaris 8), OpenBSD (3.2),
-# NetBSD (1.6).
-#
-# History:
-# --------
-# created by andrei
-# 2003-02-24 make install no longer overwrites ser.cfg - patch provided
-# by Maxim Sobolev <sobomax@FreeBSD.org> and
-# Tomas Björklund <tomas@webservices.se>
-# 2003-03-11 PREFIX & LOCALBASE must also be exported (andrei)
-# 2003-04-07 hacked to work with solaris install (andrei)
-# 2003-04-17 exclude modules overwritable from env. or cmd. line,
-# added include_modules and skip_modules (andrei)
-# 2003-05-30 added extra_defs & EXTRA_DEFS
-# Makefile.defs force-included to allow recursive make
-# calls -- see comment (andrei)
-# 2003-06-02 make tar changes -- unpacks in $NAME-$RELEASE (andrei)
-# 2003-06-03 make install-cfg will properly replace the module path
-# in the cfg (re: /usr/.*lib/ser/modules)
-# ser.cfg.default is installed only if there is a previous
-# cfg. -- fixes packages containing ser.cfg.default (andrei)
-# 2003-08-29 install-modules-doc split from install-doc, added
-# install-modules-all, removed README.cfg (andrei)
-# added skip_cfg_install (andrei)
-# 2004-09-02 install-man will automatically "fix" the path of the files
-# referred in the man pages
-# 2006-02-14 added utils & install-utils (andrei)
-# 2006-03-15 added nodeb parameter for make tar (andrei)
-# 2006-09-29 added modules-doc as target and doc_format= as make option (greger)
-# 2006-12-09 added new group_include as make option and defined groups
-# defining which modules to include. Also added new target
-# print-modules that you can use to check which modules will be
-# compiled (greger)
-# 2007-01-10 added new group_include targets mysql, radius, and presence
-# improved print-modules output fixed problem in include/exclude
-# logic when using group_include (greger)
-# 2007-03-01 fail if a module or a required utility make fail unless
-# err_fail=0; don't try to make modules with no Makefiles (andrei)
-# 2007-03-16 moved the exports to Makefile.defs (andrei)
-# 2007-03-29 install-modules changed to use make -C modpath install (andrei)
-# 2007-05-04 "if ! foo" not supported in standard sh, switched to
-# "if foo; then :; else ... ; fi" (andrei)
-# 2008-06-23 added 2 new targets: README and man (re-generate the README
-# or manpages for all the modules) (andrei)
-# 2008-06-25 make cfg support (use a pre-built cfg.: config.mak) (andrei)
-# 2008-06-28 added clean-all, proper-all, install-modules-man and error
-# checks for install-utils & doc (andrei)
-# 2008-07-01 split module list from config.mak into modules.lst so that
-# the modules list can be changed without rebuilding the whole
-# ser (andrei)
-# added cfg-defs, new target that only rebuilds config.mak
-# 2009-03-10 replaced DEFS with C_DEFS (DEFS are now used only for
-# "temporary" defines inside modules or libs) (andrei)
-# 2009-03-27 multiple modules directory support, see modules_dirs (andrei)
-# 2009-04-02 workaround for export not supported in gnu make 3.80
-# target specific variables: use mk_params for each
-# $(MAKE) invocation (andrei)
-# 2009-04-22 don't rebuild config.mak or modules.lst if not needed
-# (e.g. on clean) (andrei)
-# 2009-06-24 auto-generate autover.h, containing the REPO_VER macro, defined
-# to the top git commit sha (if git is found) (andrei)
+# NetBSD (1.6), OS/X
#
# check make version
-#
-# $Id$
+# Kamailio build system
#
# remake cfg defs (include)
#
# depends on COREPATH being defined
#
-# History:
-# --------
-# 2008-06-27 initial version (andrei)
#
+# Kamailio build system
#
# makefile defs (CC, LD,a.s.o)
# exclude_modules, skip_modules, include_modules
# extra_defs
#
-# History:
-# --------
-# created by andrei
-# 2003-02-24 added LOCALBASE, fixed doc_dir for freebsd - patch provided
-# by Maxim Sobolev <sobomax@FreeBSD.org>
-# 2003-02-25 added -DDISABLE_NAGLE (andrei)
-# 2003-03-02 added -DDIGEST_DOMAIN (janakj)
-# 2003-03-10 added -xcode=pic32 for module compilation w/ sun cc
-# (too many symbols for pic13) (andrei)
-# 2003-04-16 added CC_EXTRA_OPTS, s/march/mcpu, added CPU (cpu to optimize
-# for, used only with gcc-3.x) (andrei)
-# 2003-05-23 check if this makefile was already included (andrei)
-# removed -DDIGEST_DOMAIN (andrei)
-# 2003-05-30 added extra_defs (andrei)
-# 2003-06-06 moved compiler detection before DEFS (andrei)
-# 2003-06-10 removed -m32 for gcc 3.x/sparc64 -- it will use
-# arch. default: -m32 on solaris, -m64 on *bsd (andrei)
-# 2003-09-25 added -pthread into LIBS when compiling on FreeBSD/alpha
-# and other FreeBSD arches for which no fast locking assembly
-# code exists (sobomax)
-# 2003-11-08 mips1 support introduced (andrei)
-# 2003-11-24 openbsd 3.4 (elf) fixes (andrei)
-# 2004-07-27 darwin (mac os x) port (andrei)
-# 2004-09-12 mips2 & cobalt support introduced (andrei)
-# 2004-09-28 x86_64 support introduced (andrei)
-# 2004-12-14 gcc-3.4 special case added (andrei)
-# 2004-12-15 HAVE_ALLOCA_H added (andrei)
-# 2004-12-19 amd64 transformed in x86_64 (andrei)
-# 2005-04-27 alpha support added (andrei)
-# 2005-06-01 use $(LOCALBASE) instead of /usr/{local,pkg} (andrei)
-# 2005-06-26 numeric OSREL & HAVE_KQUEUE added to the *BSD (andrei)
-# 2005-07-04 HAVE_DEVPOLL added to solaris (andrei)
-# 2005-07-06 gcc 4.0 optimizations support (andrei)
-# 2005-07-25 better solaris arch detection (andrei)
-# 2005-09-12 -mallign-double removed (too many problems) (andrei)
-# 2005-10-02 distcc get gcc version hack (andrei)
-# 2006-03-30 64 bit mode compile by default on sparc64 (-m64), added
-# CC_GCC_LIKE_ASM and SPARC64_MODE (andrei)
-# sparc <= v8 support (andrei)
-# 2006-03-31 armv6 & mips64 support added
-# mips and arm set to NOSMP by default (andrei)
-# 2006-07-10 added -DPROFILING (hscholz)
-# 2007-02-09 added TLS_HOOKS and CORE_TLS support, obsoleted TLS=1
-# added TLS_EXTRA_LIBS (andrei)
-# 2007-03-16 added LIB building options: LIB_LDFLAGS, LIB_SONAME, LIB_RPATH,
-# INSTALL_LIB, libraries install paths (andrei)
-# 2007-05-14 futex support if linux 2.5.70+ and
-# use_futex=yes (default) (andrei)
-# 2007-05-26 changed darwin module link flags (instead of -bundle_loader ser
-# -flat_namespace -undefined suppress) (andrei)
-# 2007-07-07 use isainfo -n to detect cpu type on solaris (andrei)
-# 2007-07-07 added HAVE_SCHED_SETSCHEDULER for linux (andrei)
-# 2007-07-18 added DNS_WATCHDOG_SUPPORT (Miklos)
-# 2007-07-30 added USE_DNS_CACHE_STATS and USE_DST_BLACKLIST_STATS (Gergo)
-# 2008-06-26 support for make cfg / config.mak and hack to load
-# automatically config.mak when included from a module, lib
-# a.s.o (not from the main Makefile) (andrei)
-# 2009-03-10 replaced DEFS with C_DEFS and INCLUDES with C_INCLUDES (DEFS
-# and INCLUDES are now used only for "temporary" defines/includes
-# inside modules or libs) (andrei)
-# 2009-09-29 for gcc 4.2+ use -fno-strict-overflow (andrei)
-# 2009-09-30 find the target architecture from the compiler and not
-# from the host (andrei)
-# 2009-10-01 use -fsigned-char for gcc on ppc, ppc64, arm and arm6
-# (on those archs char is unsigned by default) (andrei)
-# 2010-03-10 added CC_MKDEP_OPTS, which contains to the list of options
-# needed to generate dependencies on-the-fly while compiling
-# or is empty if the compiler doesn't support it (andrei)
-
# default silent, unless Q= 0|no|off|verbose|noisy
quiet?=$(if $(filter 0 no off verbose noisy,$(Q)),verbose,silent)
-# $Id$
-#
+# Kamailio build system
# path config makefile
#
-# History:
-# --------
-# 2009-03-27 initial version (andrei)
-
ifneq ($(makefile_dirs_included),1)
override makefile_dirs_included:=1
+# Kamailio build system
# Module groups definitions
#
-#
-# $Id$
+# Kamailio build system
#
# module Makefile
#(to be included from each library makefile)
#
-# History:
-# --------
-# 2007-03-16 created by andrei
-# 2007-05-19 rebuild on changed install name on darwin (andrei)
-# 2008-06-27 make cfg / config.mak support (andrei)
-
# NAME, MAJOR_VER and MINOR_VER should be pre-defined in the library
# makefile
#
-#
-# $Id$
+# Kamailio build system
#
# module Makefile
#(to be included from each module)
#
-# History:
-# --------
-# 2007-03-29 if a module depends on SER_LIBS, it will be rebuilt on install
-# with the proper rpath; libraries will be automatically
-# installed if needed (andrei)
-# 2008-06-23 added the README & man targets (andrei)
-# 2008-06-27 make cfg / config.mak support (andrei)
-# 2009-03-10 replaced DEFS with C_DEFS and INCLUDES with C_INCLUDES (DEFS
-# and INCLUDES are now used only for "temporary" defines/includes
-# inside modules or libs) (andrei)
-# 2009-10-01 added support for automatically installing extra utils,
-# scripts and cfg files (andrei)
-# 2010-03-04 don't overwrite already installed .cfgs, save the .cfg as
-# .sample in this case (andrei)
#
#
-#
-# $Id$
-#
+# Kamailio build system
#
# Radiusclient library detection comes here
#
-#
-# $Id$
-#
+# Kamailio build system
#
# common Makefile rules, included by main Makefile & the modules
#
# built if necessary. Format: path/shortname, where shortname is the
# name passed to -l (e.g. for libprint.so the shortname is print)
#
-# History:
-# --------
-# 2007-03-29 set rpath differently for make install
-# automatically build listed SER_LIBS if needed (andrei)
-# 2008-06-23 automatically rebuild if make time defines or includes
-# changed (via makecfg.lst)
-# 2009-03-10 support for C_DEFS and C_INCLUDES (DEFS and INCLUDES are now
-# used only for "temporary" defines/includes inside modules or
-# libs, C_DEFS and C_INCLUDES are used for the common stuff)
-# (andrei)
-# 2010-03-09 generate dependencies when compiling .o instead of on
-# include .d and fix build errors when a .h is moved
-# support for using MKDEP="makedepend-f-" (andrei)
-# 2010-03-10 support for on the-fly dependency generation (while compiling,
-# see CC_MKDEP_OPTS) (andrei)
# check if the saved cfg corresponds with the current one
-#
-# $Id$
+# Kamailio build system
#
# shared functions
#
#
-# History:
-# --------
-# 2008-06-27 initial version (andrei)
#
escape_values=$(subst $$,\$$,$(subst ",\", $(1)))
-#
-# $Id$
+# Kamailio build system
#
# common Makefile variables
# (source files, objs, etc)
+# Kamailio build system
-#
-# $Id$
-#
-#
# Makefile targets that should be treated specially,
# e.g.: non obj/executable affecting targets => don't build dependencies for
# them or don't try any action that would be useful only for generating
# actual code
#
-# History:
-# --------
-# 2008-06-26 initial version (andrei)
-#
ifeq (,$(strip $(modules_dirs)))
include $(COREPATH)/Makefile.dirs
-#
-# $Id$
+# Kamailio build system
#
# utils Makefile
#(to be included from each util/ subdirectory)
#
-# History:
-# --------
-# 2009-04-23 initial version derived from Makefile.modules (andrei)
#
# Variables that should be defined in the util Makefiles, prior to including