e60a9728 |
# $Id$
#
# sip_router makefile
#
|
1b1b19d8 |
# WARNING: requires gmake (GNU Make)
|
aee4712e |
# Arch supported: Linux, FreeBSD, SunOS (tested on Solaris 8), OpenBSD (3.2),
|
0762e9d5 |
# NetBSD (1.6).
|
a2786e3e |
#
# History:
# --------
# created by andrei
# 2003-02-24 make install no longer overwrites ser.cfg - patch provided
# by Maxim Sobolev <sobomax@FreeBSD.org> and
|
cbd93cf4 |
# Tomas Björklund <tomas@webservices.se>
|
56c2dabd |
# 2003-03-11 PREFIX & LOCALBASE must also be exported (andrei)
|
90907c3f |
# 2003-04-07 hacked to work with solaris install (andrei)
|
fc50bc47 |
# 2003-04-17 exclude modules overwritable from env. or cmd. line,
# added include_modules and skip_modules (andrei)
|
3dae72a3 |
# 2003-05-30 added extra_defs & EXTRA_DEFS
# Makefile.defs force-included to allow recursive make
# calls -- see comment (andrei)
|
f742de6a |
# 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)
|
d48f0d9b |
# 2003-08-29 install-modules-doc split from install-doc, added
# install-modules-all, removed README.cfg (andrei)
# added skip_cfg_install (andrei)
|
c3e5dd3e |
# 2004-09-02 install-man will automatically "fix" the path of the files
# referred in the man pages
|
eddda8ce |
# 2006-02-14 added utils & install-utils (andrei)
|
6309eded |
# 2006-03-15 added nodeb parameter for make tar (andrei)
|
cbd93cf4 |
# 2006-09-29 added modules-doc as target and doc_format= as make option (greger)
|
3f93b05e |
# 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)
|
3922c022 |
# 2007-03-16 moved the exports to Makefile.defs (andrei)
# 2007-03-29 install-modules changed to use make -C modpath install (andrei)
|
1bd1a2ef |
# 2007-05-04 "if ! foo" not supported in standard sh, switched to
# "if foo; then :; else ... ; fi" (andrei)
|
7742b1d2 |
# 2008-06-23 added 2 new targets: README and man (re-generate the README
|
617ced39 |
# or manpages for all the modules) (andrei)
|
7742b1d2 |
# 2008-06-25 make cfg support (use a pre-built cfg.: config.mak) (andrei)
|
299781b1 |
# 2008-06-28 added clean-all, proper-all, install-modules-man and error
# checks for install-utils & doc (andrei)
|
0bd6adc6 |
# 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
#
|
e60a9728 |
|
9de818a2 |
auto_gen=lex.yy.c cfg.tab.c #lexx, yacc etc
auto_gen_others=cfg.tab.h # auto generated, non-c
|
247c2b65 |
#include source related defs
include Makefile.sources
|
3f93b05e |
# whether or not the entire build process should fail if building a module or
# an utility fails
err_fail?=1
|
d48f0d9b |
# whether or not to install ser.cfg or just ser.cfg.default
# (ser.cfg will never be overwritten by make install, this is usefull
# when creating packages)
skip_cfg_install?=
|
fc50bc47 |
#extra modules to exclude
skip_modules?=
|
cbd93cf4 |
# Set document format
# Alternatives are txt, html, xhtml, and pdf (see Makefile.doc)
doc_format?=html
|
898376a7 |
include modules.lst
#if called with group_include, ignore the modules from modules.lst
ifneq ($(group_include),)
include_modules=
exclude_modules=
modules_configured:=0
endif
|
1ec7aeb1 |
# Module group definitions, default only include the standard group
# Make backwards compatible, don't set group_include default...
#group_include?="standard"
|
3f93b05e |
# Modules in this group are considered a standard part of SER (due to
# widespread usage) and have no external compile or link dependencies (note
# that some of these interplay with external systems).
|
608888ec |
module_group_standard=acc_syslog auth avp ctl dispatcher diversion enum\
|
1ec7aeb1 |
eval exec fifo flatstore gflags maxfwd mediaproxy \
nathelper options pdt permissions pike print ratelimit \
registrar rr sanity sl textops timer tm uac unixsock uri \
|
c6c91622 |
usrloc xlog cfg_rpc
|
1ec7aeb1 |
|
3f93b05e |
# Modules in this group are considered a standard part of SER (due to
# widespread usage) but they have dependencies that must be satisfied for
# compilation.
|
1ec7aeb1 |
# acc_radius, auth_radius, avp_radius, uri_radius => radiusclient-ng
|
3f93b05e |
# acc_db, auth_db, avp_db, db_ops, domain, lcr, msilo, dialog, speeddial,
# uri_db => database module (mysql, postgres, dbtext)
# mysql, postgres => mysql server and client libraries or postgres server and
# client libraries or other database back-end (ex. mysql-devel)
|
1ec7aeb1 |
# pa, xmlrpc => libxml2
# rls => pa
#
|
3f93b05e |
# NOTE! All presence modules (dialog, pa, presence_b2b, rls, xcap) have been
# included in this group due to interdependencies
module_group_standard_dep=acc_db acc_radius auth_db auth_radius avp_db \
|
2a584f3c |
avp_radius auth_identity \
|
1ec7aeb1 |
db_ops domain lcr msilo mysql dialog pa postgres \
|
52bcc791 |
presence_b2b rls speeddial uri_db xcap xmlrpc
|
1ec7aeb1 |
|
fd564b72 |
# For mysql
|
3f93b05e |
module_group_mysql=acc_db auth_db avp_db db_ops uri_db domain lcr msilo mysql\
speeddial
|
fd564b72 |
# For radius
module_group_radius=acc_radius auth_radius avp_radius
# For presence
|
52bcc791 |
module_group_presence=dialog pa presence_b2b rls xcap
|
fd564b72 |
|
3f93b05e |
# Modules in this group satisfy specific or niche applications, but are
# considered stable for production use. They may or may not have dependencies
|
1ec7aeb1 |
# cpl-c => libxml2
# jabber => expat (library)
# osp => OSP Toolkit (sipfoundry)
# sms => none (external modem)
module_group_stable=cpl-c dbtext jabber osp sms
|
3f93b05e |
# Modules in this group are either not complete, untested, or without enough
# reports of usage to allow the module into the stable group. They may or may
# not have dependencies
|
12f28ced |
module_group_experimental=tls oracle iptrtpproxy
|
1ec7aeb1 |
|
898376a7 |
# if not set on the cmd. line, env or in the modules.lst (cfg_group_include)
# exclude the below modules.
ifneq ($(group_include)$(cfg_group_include),)
|
3f93b05e |
# For group_include, default all modules are excluded except those in
# include_modules
|
fd564b72 |
exclude_modules?=
|
1ec7aeb1 |
else
# Old defaults for backwards compatibility
|
ee9b2b68 |
exclude_modules?= cpl mangler postgres jabber mysql cpl-c \
auth_radius uri_radius avp_radius \
|
7d95baf3 |
acc_radius dialog pa rls presence_b2b xcap xmlrpc\
|
6aeed6db |
osp tls oracle \
|
7bf73884 |
unixsock dbg print_lib auth_identity ldap
|
7eec6c23 |
# excluded because they do not compile (remove them only after they are
# fixed) -- andrei
|
ee9b2b68 |
exclude_modules+= avpops bdb dbtext iptrtpproxy pa rls
|
1ec7aeb1 |
endif
|
fc50bc47 |
# always exclude the CVS dir
override exclude_modules+= CVS $(skip_modules)
|
1ec7aeb1 |
# Test for the groups and add to include_modules
ifneq (,$(findstring standard,$(group_include)))
override include_modules+= $(module_group_standard)
endif
ifneq (,$(findstring standard-dep,$(group_include)))
override include_modules+= $(module_group_standard_dep)
endif
|
fd564b72 |
ifneq (,$(findstring mysql,$(group_include)))
override include_modules+= $(module_group_mysql)
endif
ifneq (,$(findstring radius,$(group_include)))
override include_modules+= $(module_group_radius)
endif
ifneq (,$(findstring presence,$(group_include)))
override include_modules+= $(module_group_presence)
endif
|
1ec7aeb1 |
ifneq (,$(findstring stable,$(group_include)))
override include_modules+= $(module_group_stable)
endif
ifneq (,$(findstring experimental,$(group_include)))
override include_modules+= $(module_group_experimental)
endif
|
0762e9d5 |
# first 2 lines are excluded because of the experimental or incomplete
# status of the modules
# the rest is excluded because it depends on external libraries
#
|
c64e586d |
static_modules=
|
7742b1d2 |
ALLDEP=config.mak Makefile Makefile.sources Makefile.rules
#include general defs (like CC, CFLAGS a.s.o)
# hack to force makefile.defs re-inclusion (needed when make calls itself with
# other options -- e.g. make bin)
#makefile_defs=0
#DEFS:=
# try saved cfg, unless we are in the process of building it
|
0bd6adc6 |
ifeq (,$(filter config.mak config cfg cfg-defs,$(MAKECMDGOALS)))
|
7742b1d2 |
include config.mak
ifeq ($(makefile_defs),1)
$(info config.mak loaded)
# config_make valid & used
config_mak=1
endif
else
|
0bd6adc6 |
ifneq (,$(filter cfg config cfg-defs,$(word 1,$(MAKECMDGOALS))))
|
7742b1d2 |
# needed here to avoid starting a config submake
# (e.g. rm -f config.mak; make config.mak), which would either require
# double Makefile.defs defines execution (suboptimal), would loose
# $(value ...) expansion or would cause some warning (if Makefile.defs exec.
# is skipped in the "main" makefile invocation).
$(shell rm -rf config.mak)
endif
endif
|
0bd6adc6 |
|
7742b1d2 |
main_makefile=1
include Makefile.defs
|
404073d3 |
static_modules_path=$(addprefix modules/, $(static_modules))
extra_sources=$(wildcard $(addsuffix /*.c, $(static_modules_path)))
extra_objs=$(extra_sources:.c=.o)
static_defs= $(foreach mod, $(static_modules), \
|
af9d50fc |
-DSTATIC_$(shell echo $(mod) | tr [:lower:] [:upper:]) )
|
3dae72a3 |
override extra_defs+=$(static_defs) $(EXTRA_DEFS)
export extra_defs
|
3f93b05e |
# Historically, the resultant set of modules is: modules/* - exclude_modules +
# include_modules
# When group_include is used, we want: include_modules (based on group_include)
# - exclude_modules
|
7742b1d2 |
ifneq ($(modules_configured),1)
|
299781b1 |
modules_all=$(filter-out modules/CVS,$(wildcard modules/*))
|
fd564b72 |
ifneq ($(group_include),)
modules=$(filter-out $(addprefix modules/, \
$(exclude_modules) $(static_modules)), \
$(addprefix modules/, $(include_modules) ))
else
# Standard, old resultant set
|
7742b1d2 |
modules_noinc=$(filter-out $(addprefix modules/, \
$(exclude_modules) $(static_modules)), $(modules_all))
modules=$(filter-out $(modules_noinc), \
$(addprefix modules/, $(include_modules) )) $(modules_noinc)
endif # ifneq($(group_include),)
endif # ifneq($(modules_configured),1)
|
6ac71d10 |
modules_names=$(shell echo $(modules)| \
sed -e 's/modules\/\([^/ ]*\)\/*/\1.so/g' )
|
addb384d |
modules_basenames=$(shell echo $(modules)| \
sed -e 's/modules\/\([^/ ]*\)\/*/\1/g' )
|
6ac71d10 |
#modules_names=$(patsubst modules/%, %.so, $(modules))
|
7742b1d2 |
#modules_full_path=$(join $(modules), $(addprefix /, $(modules_names)))
|
e60a9728 |
|
eddda8ce |
# which utils need compilation (directory path) and which to install
# (full path including file name)
|
3df7e45b |
utils_compile= utils/gen_ha1 utils/sercmd
|
67a79433 |
utils_bin_install= utils/gen_ha1/gen_ha1 utils/sercmd/sercmd
|
ee03be75 |
utils_script_install=
# This is the list of files to be installed into the arch-independent
# shared directory (by default /usr/local/share/ser)
share_install= scripts/mysql/my_create.sql \
scripts/mysql/my_data.sql \
scripts/mysql/my_drop.sql
|
eddda8ce |
|
0ae4dfdc |
|
194b6a35 |
NAME=$(MAIN_NAME)
|
6309eded |
tar_name=$(NAME)-$(RELEASE)_src
|
9de818a2 |
tar_extra_args+=$(addprefix --exclude=$(notdir $(CURDIR))/, \
$(auto_gen) $(auto_gen_others))
|
6c53d41a |
ifeq ($(CORE_TLS), 1)
|
346c7dab |
tar_extra_args+=
else
|
895cb2af |
tar_extra_args+=--exclude=$(notdir $(CURDIR))/tls/*
|
346c7dab |
endif
|
6309eded |
ifneq ($(nodeb),)
tar_extra_args+=--exclude=$(notdir $(CURDIR))/debian
tar_name:=$(tar_name)_nodeb
endif
|
6c53d41a |
# sanity checks
ifneq ($(TLS),)
|
8ed78eb4 |
$(warning "make TLS option is obsoleted, try TLS_HOOKS or CORE_TLS")
|
6c53d41a |
endif
|
247c2b65 |
# include the common rules
|
7742b1d2 |
include Makefile.targets
|
247c2b65 |
include Makefile.rules
|
e60a9728 |
|
247c2b65 |
#extra targets
|
3e429f5c |
|
fa60aefe |
$(NAME): $(extra_objs) # static_modules
|
04bb7a49 |
|
aeb805d5 |
lex.yy.c: cfg.lex cfg.tab.h $(ALLDEP)
|
a15c363f |
$(LEX) $<
|
aeb805d5 |
cfg.tab.c cfg.tab.h: cfg.y $(ALLDEP)
|
a15c363f |
$(YACC) $(YACC_FLAGS) $<
|
bb31c7ad |
include Makefile.shared
|
7742b1d2 |
ifeq ($(config_mak),1)
COREPATH=.
include Makefile.cfg
else
config.mak: Makefile.defs
@echo making config...
@echo "# this file is autogenerated by make cfg" >$@
@$(call mapf2,cfg_save_var,saved_fixed_vars,$(@))
@$(call mapf2,cfg_save_var2,saved_chg_vars,$(@))
@echo "override makefile_defs:=1" >>$@
|
0bd6adc6 |
@echo "DEFS:=\$$(filter-out \$$(DEFS_RM) \$$(extra_defs),\$$(DEFS))" \
"\$$(extra_defs)" >>$@
@echo "CFLAGS:=\$$(filter-out \$$(CFLAGS_RM) \$$(CC_EXTRA_OPTS)," \
"\$$(CFLAGS)) \$$(CC_EXTRA_OPTS)" >>$@
endif # ifeq ($(config_mak),1)
modules.lst:
@echo saving modules list...
@echo "# this file is autogenerated by make modules-cfg" >$@
|
898376a7 |
@echo "cfg_group_include=$(group_include)" >>$@
|
7742b1d2 |
@$(call cfg_save_var2,include_modules,$@)
@$(call cfg_save_var2,static_modules,$@)
@$(call cfg_save_var2,skip_modules,$@)
@$(call cfg_save_var2,exclude_modules,$@)
@$(call cfg_save_var2,modules_all,$@)
@$(call cfg_save_var2,modules_noinc,$@)
@$(call cfg_save_var2,modules,$@)
@echo "modules_configured:=1" >>$@
|
0bd6adc6 |
.PHONY: cfg config cfg-defs
cfg-defs: config.mak
|
7742b1d2 |
|
0bd6adc6 |
cfg config: cfg-defs modules-cfg
|
7742b1d2 |
|
0bd6adc6 |
.PHONY: modules-cfg modules-list modules-lst
modules-cfg modules-list modules-lst:
|
ee9b2b68 |
rm -f modules.lst
|
0bd6adc6 |
$(MAKE) modules.lst
|
7742b1d2 |
|
e60a9728 |
.PHONY: all
|
96001c50 |
all: $(NAME) modules
|
e60a9728 |
|
1ec7aeb1 |
.PHONY: print-modules
print-modules:
|
7742b1d2 |
@echo The following modules were chosen to be included: \
$(include_modules) ; \
|
1ec7aeb1 |
echo ---------------------------------------------------------- ; \
echo The following modules will be excluded: $(exclude_modules) ; \
|
fd564b72 |
echo ---------------------------------------------------------- ; \
echo The following modules will be made: $(modules_basenames) ; \
|
96001c50 |
.PHONY: modules
|
0bd6adc6 |
modules: modules.lst
|
3f93b05e |
@for r in $(modules) "" ; do \
if [ -n "$$r" -a -r "$$r/Makefile" ]; then \
|
e7a9bd30 |
echo "" ; \
echo "" ; \
|
1bd1a2ef |
if $(MAKE) -C $$r || [ ${err_fail} != 1 ] ; then \
:; \
else \
|
3f93b05e |
exit 1; \
fi ; \
|
e7a9bd30 |
fi ; \
|
3f93b05e |
done; true
|
404073d3 |
|
fa60aefe |
$(extra_objs):
|
3f93b05e |
@echo "Extra objs: $(extra_objs)"
@for r in $(static_modules_path) "" ; do \
if [ -n "$$r" -a -r "$$r/Makefile" ]; then \
|
e7a9bd30 |
echo "" ; \
echo "Making static module $r" ; \
|
1bd1a2ef |
if $(MAKE) -C $$r static ; then \
:; \
else \
|
3f93b05e |
exit 1; \
fi ; \
|
e7a9bd30 |
fi ; \
|
3f93b05e |
done
|
404073d3 |
|
eddda8ce |
.PHONY: utils
utils:
|
3f93b05e |
@for r in $(utils_compile) "" ; do \
|
eddda8ce |
if [ -n "$$r" ]; then \
echo "" ; \
echo "" ; \
|
1bd1a2ef |
if $(MAKE) -C $$r || [ ${err_fail} != 1 ] ; then \
:; \
else \
|
3f93b05e |
exit 1; \
fi ; \
|
eddda8ce |
fi ; \
|
3f93b05e |
done; true
|
404073d3 |
|
cbd93cf4 |
|
f571aa35 |
dbg: ser
gdb -command debug.gdb
|
247c2b65 |
|
0bafb279 |
.PHONY: tar
|
31521f89 |
.PHONY: dist
dist: tar
tar:
|
054cb6cf |
$(TAR) -C .. \
|
3dae72a3 |
--exclude=$(notdir $(CURDIR))/test* \
--exclude=$(notdir $(CURDIR))/tmp* \
|
b5a32e1a |
--exclude=$(notdir $(CURDIR))/debian/ser \
--exclude=$(notdir $(CURDIR))/debian/ser-* \
|
e8f8146e |
--exclude=$(notdir $(CURDIR))/ser_tls* \
|
3dae72a3 |
--exclude=CVS* \
|
871a6a07 |
--exclude=.svn* \
|
346c7dab |
--exclude=.cvsignore \
|
3922c022 |
--exclude=librpath.lst \
|
5cace4ed |
--exclude=libiname.lst \
--exclude=makecfg.lst \
|
7742b1d2 |
--exclude=config.mak \
|
0bd6adc6 |
--exclude=modules.lst \
|
31521f89 |
--exclude=*.[do] \
--exclude=*.so \
--exclude=*.il \
--exclude=$(notdir $(CURDIR))/ser \
--exclude=*.gz \
--exclude=*.bz2 \
--exclude=*.tar \
|
346c7dab |
--exclude=*.patch \
--exclude=.\#* \
--exclude=*.swp \
${tar_extra_args} \
|
31521f89 |
-cf - $(notdir $(CURDIR)) | \
|
696ba02d |
(mkdir -p tmp/_tar1; mkdir -p tmp/_tar2 ; \
cd tmp/_tar1; $(TAR) -xf - ) && \
mv tmp/_tar1/$(notdir $(CURDIR)) \
tmp/_tar2/"$(NAME)-$(RELEASE)" && \
(cd tmp/_tar2 && $(TAR) \
|
6309eded |
-zcf ../../"$(tar_name)".tar.gz \
|
31521f89 |
"$(NAME)-$(RELEASE)" ) ; \
|
696ba02d |
rm -rf tmp/_tar1; rm -rf tmp/_tar2
|
0bafb279 |
# binary dist. tar.gz
.PHONY: bin
bin:
mkdir -p tmp/ser/usr/local
|
d1f2b785 |
$(MAKE) install basedir=tmp/ser
|
0bafb279 |
$(TAR) -C tmp/ser/ -zcf ../$(NAME)-$(RELEASE)_$(OS)_$(ARCH).tar.gz .
rm -rf tmp/ser
|
04bb7a49 |
|
5c6101da |
.PHONY: deb
deb:
|
df42e163 |
-@if [ -d debian ]; then \
dpkg-buildpackage -rfakeroot -tc; \
else \
ln -s pkg/debian debian; \
dpkg-buildpackage -rfakeroot -tc; \
rm debian; \
fi
|
5c6101da |
|
bc5cc4ec |
.PHONY: sunpkg
sunpkg:
mkdir -p tmp/ser
mkdir -p tmp/ser_sun_pkg
|
054cb6cf |
$(MAKE) install basedir=tmp/ser prefix=/usr/local
|
df42e163 |
(cd pkg/solaris; \
pkgmk -r ../../tmp/ser/usr/local -o -d ../../tmp/ser_sun_pkg/ -v "$(RELEASE)" ;\
cd ../..)
|
bc5cc4ec |
cat /dev/null > ../$(NAME)-$(RELEASE)-$(OS)-$(ARCH)-local
pkgtrans -s tmp/ser_sun_pkg/ ../$(NAME)-$(RELEASE)-$(OS)-$(ARCH)-local \
IPTELser
gzip -9 ../$(NAME)-$(RELEASE)-$(OS)-$(ARCH)-local
rm -rf tmp/ser
rm -rf tmp/ser_sun_pkg
|
cbd93cf4 |
.PHONY: modules-doc
|
0bd6adc6 |
modules-doc: modules.lst
|
cbd93cf4 |
-@for r in $(modules) "" ; do \
if [ -n "$$r" ]; then \
echo "" ; \
echo "" ; \
$(MAKE) -C $$r/doc $(doc_format) ; \
fi ; \
done
|
04bb7a49 |
|
617ced39 |
.PHONY: modules-readme
modules-readme: README
.PHONY: README
|
0bd6adc6 |
README: modules.lst
|
617ced39 |
-@for r in $(modules) "" ; do \
if [ -n "$$r" ]; then \
echo "" ; \
echo "" ; \
if $(MAKE) -C $$r README || [ ${err_fail} != 1 ] ; then \
:; \
else \
exit 1; \
fi ; \
fi ; \
done; true
.PHONY: modules-man
modules-man: man
.PHONY: man
|
0bd6adc6 |
man: modules.lst
|
617ced39 |
-@for r in $(modules) "" ; do \
if [ -n "$$r" ]; then \
echo "" ; \
echo "" ; \
if $(MAKE) -C $$r man || [ ${err_fail} != 1 ] ; then \
:; \
else \
exit 1; \
fi ; \
fi ; \
done; true
|
ecd11721 |
.PHONY: install
|
bac0e1e6 |
install:all install-bin install-modules install-cfg \
|
ee03be75 |
install-doc install-man install-utils install-share
|
db1b5017 |
|
e81ea6ce |
.PHONY: dbinstall
dbinstall:
-@echo "Initializing ser database"
|
5904f9fc |
scripts/mysql/ser_mysql.sh create
|
e81ea6ce |
-@echo "Done"
|
db1b5017 |
|
28b28d2c |
mk-install_dirs: $(cfg_prefix)/$(cfg_dir) $(bin_prefix)/$(bin_dir) \
$(modules_prefix)/$(modules_dir) $(doc_prefix)/$(doc_dir) \
|
ee03be75 |
$(man_prefix)/$(man_dir)/man8 $(man_prefix)/$(man_dir)/man5 \
$(share_prefix)/$(share_dir)
|
db1b5017 |
|
3543f7dc |
|
28b28d2c |
$(cfg_prefix)/$(cfg_dir):
mkdir -p $(cfg_prefix)/$(cfg_dir)
|
db1b5017 |
|
28b28d2c |
$(bin_prefix)/$(bin_dir):
mkdir -p $(bin_prefix)/$(bin_dir)
|
db1b5017 |
|
ee03be75 |
$(share_prefix)/$(share_dir):
mkdir -p $(share_prefix)/$(share_dir)
|
28b28d2c |
$(modules_prefix)/$(modules_dir):
mkdir -p $(modules_prefix)/$(modules_dir)
|
db1b5017 |
|
28b28d2c |
$(doc_prefix)/$(doc_dir):
mkdir -p $(doc_prefix)/$(doc_dir)
|
db1b5017 |
|
28b28d2c |
$(man_prefix)/$(man_dir)/man8:
mkdir -p $(man_prefix)/$(man_dir)/man8
|
6ac71d10 |
|
bb31c7ad |
$(man_prefix)/$(man_dir)/man7:
mkdir -p $(man_prefix)/$(man_dir)/man7
|
28b28d2c |
$(man_prefix)/$(man_dir)/man5:
mkdir -p $(man_prefix)/$(man_dir)/man5
|
befa138d |
|
eac2c677 |
# note: sed with POSIX.1 regex doesn't support |, + or ? (darwin, solaris ...)
|
28b28d2c |
install-cfg: $(cfg_prefix)/$(cfg_dir)
|
0e10bff2 |
sed -e "s#/usr/.*lib/ser/modules/#$(modules-target)#g" \
|
0421ab67 |
< etc/ser-basic.cfg > $(cfg_prefix)/$(cfg_dir)ser.cfg.sample
chmod 644 $(cfg_prefix)/$(cfg_dir)ser.cfg.sample
|
d48f0d9b |
if [ -z "${skip_cfg_install}" -a \
|
0421ab67 |
! -f $(cfg_prefix)/$(cfg_dir)ser.cfg ]; then \
mv -f $(cfg_prefix)/$(cfg_dir)ser.cfg.sample \
$(cfg_prefix)/$(cfg_dir)ser.cfg; \
|
a2786e3e |
fi
|
0e10bff2 |
sed -e "s#/usr/.*lib/ser/modules/#$(modules-target)#g" \
|
bb31c7ad |
< etc/ser-oob.cfg \
> $(cfg_prefix)/$(cfg_dir)ser-advanced.cfg.sample
|
0421ab67 |
chmod 644 $(cfg_prefix)/$(cfg_dir)ser-advanced.cfg.sample
|
a184875a |
if [ -z "${skip_cfg_install}" -a \
|
0421ab67 |
! -f $(cfg_prefix)/$(cfg_dir)ser-advanced.cfg ]; then \
mv -f $(cfg_prefix)/$(cfg_dir)ser-advanced.cfg.sample \
$(cfg_prefix)/$(cfg_dir)ser-advanced.cfg; \
|
a184875a |
fi
|
b5a32e1a |
# radius dictionary
|
bb31c7ad |
$(INSTALL_TOUCH) $(cfg_prefix)/$(cfg_dir)/dictionary.ser
|
0421ab67 |
$(INSTALL_CFG) etc/dictionary.ser $(cfg_prefix)/$(cfg_dir)
|
befa138d |
|
0e10bff2 |
# TLS configuration
|
0421ab67 |
$(INSTALL_TOUCH) $(cfg_prefix)/$(cfg_dir)/tls.cfg
$(INSTALL_CFG) modules/tls/tls.cfg $(cfg_prefix)/$(cfg_dir)
modules/tls/ser_cert.sh -d $(cfg_prefix)/$(cfg_dir)
|
db1b5017 |
|
28b28d2c |
install-bin: $(bin_prefix)/$(bin_dir) $(NAME)
$(INSTALL_TOUCH) $(bin_prefix)/$(bin_dir)/$(NAME)
$(INSTALL_BIN) $(NAME) $(bin_prefix)/$(bin_dir)
|
bbc882db |
|
28b28d2c |
|
ee03be75 |
install-share: $(share_prefix)/$(share_dir)
@for r in $(share_install) "" ; do \
if [ -n "$$r" ]; then \
if [ -f "$$r" ]; then \
|
bb31c7ad |
$(call try_err, $(INSTALL_TOUCH) \
$(share_prefix)/$(share_dir)/`basename "$$r"` ); \
$(call try_err, \
$(INSTALL_SHARE) "$$r" $(share_prefix)/$(share_dir) );\
|
ee03be75 |
else \
echo "ERROR: $$r not found" ; \
if [ ${err_fail} = 1 ] ; then \
exit 1; \
fi ; \
fi ;\
fi ; \
done; true
|
0bd6adc6 |
install-modules: modules.lst $(modules_prefix)/$(modules_dir)
|
3922c022 |
@for r in $(modules) "" ; do \
if [ -n "$$r" -a -r "$$r/Makefile" ]; then \
echo "" ; \
echo "" ; \
|
1bd1a2ef |
if $(MAKE) -C $$r install || [ ${err_fail} != 1 ] ; then \
:; \
else \
|
3922c022 |
exit 1; \
fi ; \
|
db1b5017 |
fi ; \
|
3f93b05e |
done; true
|
db1b5017 |
|
28b28d2c |
install-utils: utils $(bin_prefix)/$(bin_dir)
|
1c5f04ac |
@for r in $(utils_bin_install) "" ; do \
|
eddda8ce |
if [ -n "$$r" ]; then \
if [ -f "$$r" ]; then \
|
bb31c7ad |
$(call try_err, $(INSTALL_TOUCH) \
$(bin_prefix)/$(bin_dir)/`basename "$$r"` ); \
$(call try_err,\
$(INSTALL_BIN) "$$r" $(bin_prefix)/$(bin_dir) ); \
|
eddda8ce |
else \
echo "ERROR: $$r not compiled" ; \
|
3f93b05e |
if [ ${err_fail} = 1 ] ; then \
exit 1; \
fi ; \
|
eddda8ce |
fi ;\
fi ; \
|
3f93b05e |
done; true
|
1c5f04ac |
@for r in $(utils_script_install) "" ; do \
if [ -n "$$r" ]; then \
if [ -f "$$r" ]; then \
|
bb31c7ad |
$(call try_err, $(INSTALL_TOUCH) \
$(bin_prefix)/$(bin_dir)/`basename "$$r"` ); \
$(call try_err,\
$(INSTALL_SCRIPT) "$$r" $(bin_prefix)/$(bin_dir) ); \
|
1c5f04ac |
else \
echo "ERROR: $$r not compiled" ; \
if [ ${err_fail} = 1 ] ; then \
exit 1; \
fi ; \
fi ;\
fi ; \
done; true
|
ee03be75 |
# FIXME: This is a hack, this should be (and will be) done properly in
# per-module Makefiles
sed -e "s#^DEFAULT_SCRIPT_DIR.*#DEFAULT_SCRIPT_DIR=\"$(share_prefix)/$(share_dir)\"#g" \
< scripts/mysql/ser_mysql.sh > $(bin_prefix)/$(bin_dir)/ser_mysql.sh
chmod 755 $(bin_prefix)/$(bin_dir)/ser_mysql.sh
|
eddda8ce |
|
db1b5017 |
|
d48f0d9b |
install-modules-all: install-modules install-modules-doc
|
28b28d2c |
install-doc: $(doc_prefix)/$(doc_dir) install-modules-doc
$(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/INSTALL
$(INSTALL_DOC) INSTALL $(doc_prefix)/$(doc_dir)
|
08067fd5 |
$(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/README-MODULES
$(INSTALL_DOC) README-MODULES $(doc_prefix)/$(doc_dir)
|
28b28d2c |
$(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/AUTHORS
$(INSTALL_DOC) AUTHORS $(doc_prefix)/$(doc_dir)
$(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/NEWS
$(INSTALL_DOC) NEWS $(doc_prefix)/$(doc_dir)
$(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/README
$(INSTALL_DOC) README $(doc_prefix)/$(doc_dir)
|
d48f0d9b |
|
0bd6adc6 |
install-modules-doc: modules.lst $(doc_prefix)/$(doc_dir)
|
3f93b05e |
@for r in $(modules_basenames) "" ; do \
|
addb384d |
if [ -n "$$r" ]; then \
if [ -f modules/"$$r"/README ]; then \
|
bb31c7ad |
$(call try_err,\
$(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/README ); \
$(call try_err,\
$(INSTALL_DOC) modules/"$$r"/README \
$(doc_prefix)/$(doc_dir)/README ); \
$(call try_err,\
mv -f $(doc_prefix)/$(doc_dir)/README \
$(doc_prefix)/$(doc_dir)/README."$$r" ); \
|
addb384d |
fi ; \
fi ; \
|
bb31c7ad |
done; true
|
d48f0d9b |
|
db1b5017 |
|
bb31c7ad |
install-ser-man: $(man_prefix)/$(man_dir)/man8 $(man_prefix)/$(man_dir)/man5
|
28b28d2c |
sed -e "s#/etc/ser/ser\.cfg#$(cfg_target)ser.cfg#g" \
-e "s#/usr/sbin/#$(bin_target)#g" \
-e "s#/usr/lib/ser/modules/#$(modules_target)#g" \
-e "s#/usr/share/doc/ser/#$(doc_target)#g" \
< ser.8 > $(man_prefix)/$(man_dir)/man8/ser.8
chmod 644 $(man_prefix)/$(man_dir)/man8/ser.8
sed -e "s#/etc/ser/ser\.cfg#$(cfg_target)ser.cfg#g" \
-e "s#/usr/sbin/#$(bin_target)#g" \
-e "s#/usr/lib/ser/modules/#$(modules_target)#g" \
-e "s#/usr/share/doc/ser/#$(doc_target)#g" \
< ser.cfg.5 > $(man_prefix)/$(man_dir)/man5/ser.cfg.5
chmod 644 $(man_prefix)/$(man_dir)/man5/ser.cfg.5
|
52bcc791 |
|
bb31c7ad |
install-man: install-ser-man install-modules-man
install-modules-man: modules-man $(man_prefix)/$(man_dir)/man7
@for r in $(modules_basenames) "" ; do \
if [ -n "$$r" ]; then \
if [ -f modules/"$$r"/"$$r".7 ]; then \
$(call try_err,\
$(INSTALL_TOUCH) $(man_prefix)/$(man_dir)/man7/"$$r".7 );\
$(call try_err,\
$(INSTALL_MAN) modules/"$$r"/"$$r".7 \
$(man_prefix)/$(man_dir)/man7 ); \
fi ; \
fi ; \
done; true
|
52bcc791 |
|
a51f9e36 |
.PHONY: clean_libs
|
52bcc791 |
clean_libs:
|
e84c947e |
$(MAKE) -C lib proper
|
52bcc791 |
|
97915408 |
|
52bcc791 |
# cleaning in libs always when cleaning ser
clean: clean_libs
|
299781b1 |
#try to clean everything (including all the modules, even ones that are not
# configured/compiled normally
.PHONY: clean-all
clean-all: modules=$(modules_all)
clean-all: clean
|
0bd6adc6 |
# on make proper clean also the build config (w/o module list)
|
7742b1d2 |
proper realclean distclean: clean_cfg
|
0bd6adc6 |
# on maintainer clean, remove also the configured module list
maintainer-clean: clean_modules_cfg
|
299781b1 |
.PHONY: proper-all realclean-all distclean-all
proper-all realclean-all distclean-all: modules=$(modules_all)
proper-all realclean-all distclean-all: proper
|
7742b1d2 |
.PHONY: clean_cfg
clean_cfg:
rm -f config.mak
|
0bd6adc6 |
.PHONY: clean_modules_cfg clean-modules-cfg
clean_modules_cfg clean-modules-cfg:
rm -f modules.lst
|