[sr-dev] Makefile troubles
Andrei Pelinescu-Onciul
andrei at iptel.org
Wed Jul 21 12:44:00 CEST 2010
On Jul 19, 2010 at 18:21, Olle E. Johansson <oej at edvina.net> wrote:
> Friends,
> I feel like an idiot. I've been trying to compile Kamailio 3.0.2 with presence for hours. I have edited make files, read the INSTALL and tried many things...
> I just can't get it.
>
> I run "make" to compile everything, then "make modules" and then "make install" - when running make install it still compiles a lot of files, which feels wrong. They should have been compiled in "make".
When running make install, the libraries are re-linked. That might be
what you see.
Another possibility is that you use different options for install (in
which case everything compiled with different options will be
automatically re-compiled).
>
> In some cases running "make" twice without changing anything else than one module in the make file, kamailio still recompiles a lot of files. That indicates bad dependencies to me.
If you change one of the main Makefile*, everything will be re-compiled
(everything depends on the Makefile, if you change some option in it,
everything has to be re-compiled).
>
> I think something is wrong in the build system and the documentation. I will fight a bit more to get some more detailed information for you to work with,
> but it worries me that I can't figure this out by myself. Something propably needs to change to make Kamailio more "oej-compatible" ;-)
>
> My pua module still hasn't compiled, even though I did run this command (quote from INSTALL):
>
> ---------------------------------
> -compile all the modules from the modules subdirectory (even the one excluded
> by default):
>
> make exclude_modules="" modules-all
It works perfectly for me. Maybe you have a strange modules.lst? (try a
make proper, although for me it works without it)
BTW: the easiest way to include your module temporarily (only for one
build) is: make include_modules=pua modules-all. To include it
permanently: make modules-cfg include_modules=pua.
To only compile only your module: make -C modules_k/pua .
You can see the list of the modules that will be compiled, the list of
extra included modules and the list of excluded modules, by running:
make print-modules
E.g.: in your case, try:
make print-modules |grep --color pua
make print-modules exclude_modules=""|grep --color pua
make print-modules include_modules=pua|grep --color pua
All this commands are documented in INSTALL (not in the most friendly or
structured way though):
- change & save the modules list without rebuilding the whole config
(so that already compiled modules won't be re-compiled by
make all/make modules):
make modules-cfg include_modules="mysql postgress"
...
NOTE!!! As this mechanism is very powerful, you may be uncertain which
modules that will be included. Just replace all (or modules) with
print-modules and you will see which modules will be included and excluded,
ex:
make print-modules
...
* make cfg or make config - force config and module list regeneration
Example:
make cfg include_modules=mysql mode=debug
...
* make cfg-defs (force config regeneration, but don't touch the module list)
make modules-cfg
or
make modules-list
saves the module list, without regenerating the build config
Example:
make modules-list include_modules="tls" skip_modules="print"
Andrei
More information about the sr-dev
mailing list