[sr-dev] command name sercmd hardwired in Makefile

Juha Heinanen jh at tutpro.com
Wed Jul 1 09:35:26 CEST 2009


i changed

NAME=srcmd

in utils/sercmd/Makefile

but that alone didn't make it, because main Makefile has

# which utils need compilation (directory path) and which to install
# (full path including file name)
utils_compile=	utils/gen_ha1 utils/sercmd
utils_bin_install=	utils/gen_ha1/gen_ha1 utils/sercmd/sercmd

and make results in error:

make[2]: Entering directory `/usr/src/trunk-src/sip-router/utils/sercmd'
gcc -Wall -g -O2     -DNAME='"srcmd"' -DVERSION='"0.2"'  -DUSE_READLINE -c parse_listen_id.c -o parse_listen_id.o
gcc -Wall -g -O2     -DNAME='"srcmd"' -DVERSION='"0.2"'  -DUSE_READLINE -c sercmd.c -o sercmd.o
gcc -Wl,-O2 -Wl,-E   parse_listen_id.o sercmd.o  -lresolv -lsctp -lreadline -lncurses   -o srcmd
make[2]: Leaving directory `/usr/src/trunk-src/sip-router/utils/sercmd'
ERROR: utils/sercmd/sercmd not compiled

what is the proper fix?

my suggestion is to add to Makefile.defs a new variable SHORT_NAME,
which could default to ser:

SHORT_NAME=ser

and then use that Makefile:

utils_bin_install=	utils/gen_ha1/gen_ha1 utils/sercmd/$(SHORTNAME)cmd

and also in utils/sercmd/Makefile:

NAME=$(SHORT_NAME)cmd

and also in modules_s/ctl/ctl_defaults.h instead of ser:

#define DEFAULT_CTL_SOCKET  "unixs:/tmp/ser_ctl"

-- juha



More information about the sr-dev mailing list