Makefile 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049
  1. # $Id$
  2. #
  3. # sip_router makefile
  4. #
  5. # WARNING: requires gmake (GNU Make)
  6. # Arch supported: Linux, FreeBSD, SunOS (tested on Solaris 8), OpenBSD (3.2),
  7. # NetBSD (1.6).
  8. #
  9. # History:
  10. # --------
  11. # created by andrei
  12. # 2003-02-24 make install no longer overwrites ser.cfg - patch provided
  13. # by Maxim Sobolev <[email protected]> and
  14. # Tomas Björklund <[email protected]>
  15. # 2003-03-11 PREFIX & LOCALBASE must also be exported (andrei)
  16. # 2003-04-07 hacked to work with solaris install (andrei)
  17. # 2003-04-17 exclude modules overwritable from env. or cmd. line,
  18. # added include_modules and skip_modules (andrei)
  19. # 2003-05-30 added extra_defs & EXTRA_DEFS
  20. # Makefile.defs force-included to allow recursive make
  21. # calls -- see comment (andrei)
  22. # 2003-06-02 make tar changes -- unpacks in $NAME-$RELEASE (andrei)
  23. # 2003-06-03 make install-cfg will properly replace the module path
  24. # in the cfg (re: /usr/.*lib/ser/modules)
  25. # ser.cfg.default is installed only if there is a previous
  26. # cfg. -- fixes packages containing ser.cfg.default (andrei)
  27. # 2003-08-29 install-modules-doc split from install-doc, added
  28. # install-modules-all, removed README.cfg (andrei)
  29. # added skip_cfg_install (andrei)
  30. # 2004-09-02 install-man will automatically "fix" the path of the files
  31. # referred in the man pages
  32. # 2006-02-14 added utils & install-utils (andrei)
  33. # 2006-03-15 added nodeb parameter for make tar (andrei)
  34. # 2006-09-29 added modules-doc as target and doc_format= as make option (greger)
  35. # 2006-12-09 added new group_include as make option and defined groups
  36. # defining which modules to include. Also added new target
  37. # print-modules that you can use to check which modules will be
  38. # compiled (greger)
  39. # 2007-01-10 added new group_include targets mysql, radius, and presence
  40. # improved print-modules output fixed problem in include/exclude
  41. # logic when using group_include (greger)
  42. # 2007-03-01 fail if a module or a required utility make fail unless
  43. # err_fail=0; don't try to make modules with no Makefiles (andrei)
  44. # 2007-03-16 moved the exports to Makefile.defs (andrei)
  45. # 2007-03-29 install-modules changed to use make -C modpath install (andrei)
  46. # 2007-05-04 "if ! foo" not supported in standard sh, switched to
  47. # "if foo; then :; else ... ; fi" (andrei)
  48. # 2008-06-23 added 2 new targets: README and man (re-generate the README
  49. # or manpages for all the modules) (andrei)
  50. # 2008-06-25 make cfg support (use a pre-built cfg.: config.mak) (andrei)
  51. # 2008-06-28 added clean-all, proper-all, install-modules-man and error
  52. # checks for install-utils & doc (andrei)
  53. # 2008-07-01 split module list from config.mak into modules.lst so that
  54. # the modules list can be changed without rebuilding the whole
  55. # ser (andrei)
  56. # added cfg-defs, new target that only rebuilds config.mak
  57. # 2009-03-10 replaced DEFS with C_DEFS (DEFS are now used only for
  58. # "temporary" defines inside modules or libs) (andrei)
  59. # 2009-03-27 multiple modules directory support, see modules_dirs (andrei)
  60. # 2009-04-02 workaround for export not supported in gnu make 3.80
  61. # target specific variables: use mk_params for each
  62. # $(MAKE) invocation (andrei)
  63. # 2009-04-22 don't rebuild config.mak or modules.lst if not needed
  64. # (e.g. on clean) (andrei)
  65. # 2009-06-24 auto-generate autover.h, containing the REPO_VER macro, defined
  66. # to the top git commit sha (if git is found) (andrei)
  67. #
  68. # check make version
  69. # everything works with 3.80, except evals inside ifeq/endif
  70. # (see https://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=1516).
  71. # recommended 3.81
  72. req_ver=3.81
  73. # the check below works for version number of the type x.yy or x.yy.z*
  74. # (from the GNU Make Cookbook)
  75. ifeq (,$(filter $(req_ver),$(firstword $(sort $(MAKE_VERSION) $(req_ver)))))
  76. $(error make version $(MAKE_VERSION) not supported, use at least $(req_ver))
  77. endif
  78. auto_gen=lex.yy.c cfg.tab.c #lexx, yacc etc
  79. auto_gen_others=cfg.tab.h # auto generated, non-c
  80. auto_gen_keep=autover.h # auto generated, should be included in archives
  81. COREPATH=.
  82. #include source related defs
  83. include Makefile.sources
  84. #include special targets lists
  85. include Makefile.targets
  86. # whether or not the entire build process should fail if building a module or
  87. # an utility fails
  88. err_fail?=1
  89. # whether or not to install $(MAIN_NAME).cfg or just $(MAIN_NAME).cfg.default
  90. # ($(MAIN_NAME).cfg will never be overwritten by make install, this is usefull
  91. # when creating packages)
  92. skip_cfg_install?=
  93. #extra modules to exclude
  94. skip_modules?=
  95. # see Makefile.dirs for the directories used for the modules
  96. include Makefile.dirs
  97. # Set document format
  98. # Alternatives are txt, html, xhtml, and pdf (see Makefile.doc)
  99. doc_format?=html
  100. # don't force modules.lst generation if the makefile goals do not
  101. # require it (but if present use it)
  102. ifeq (,$(strip $(filter-out $(clean_targets) $(aux_targets),$(MAKECMDGOALS))))
  103. ifneq (,$(strip $(wildcard modules.lst)))
  104. -include modules.lst
  105. endif
  106. else
  107. include modules.lst
  108. endif # ifneq (,$(strip $(filter-out ...,$(MAKECMDGOALS))))
  109. #if called with group_include, ignore the modules from modules.lst
  110. ifneq ($(group_include),)
  111. include_modules=
  112. exclude_modules=
  113. modules_configured:=0
  114. endif
  115. # Module group definitions, default only include the standard group
  116. # Make backwards compatible, don't set group_include default...
  117. #group_include?="standard"
  118. # Modules in this group are considered a standard part of SER (due to
  119. # widespread usage) and have no external compile or link dependencies (note
  120. # that some of these interplay with external systems).
  121. module_group_standard=acc_syslog auth avp ctl dispatcher diversion enum\
  122. eval exec fifo db_flatstore gflags maxfwd mediaproxy \
  123. nathelper options pdt permissions pike print ratelimit \
  124. registrar rr sanity sl textops timer tm uac unixsock uri \
  125. usrloc xlog cfg_rpc
  126. # Modules in this group are considered a standard part of SER (due to
  127. # widespread usage) but they have dependencies that must be satisfied for
  128. # compilation.
  129. # acc_radius, auth_radius, misc_radius => radiusclient-ng
  130. # acc_db, auth_db, avp_db, db_ops, domain, lcr, msilo, dialog, speeddial,
  131. # uri_db => database module (db_mysql, db_postgres, dbtext ...)
  132. # mysql, postgres => mysql server and client libraries or postgres server and
  133. # client libraries or other database back-end (ex. mysql-devel)
  134. # pa, xmlrpc => libxml2
  135. # rls => pa
  136. #
  137. # NOTE! All presence modules (dialog, pa, presence_b2b, rls, xcap) have been
  138. # included in this group due to interdependencies
  139. module_group_standard_dep=acc_db acc_radius auth_db auth_radius avp_db \
  140. auth_identity db_ops domain lcr misc_radius \
  141. msilo dialog pa \
  142. presence_b2b rls speeddial uri_db xcap xmlrpc
  143. # For db use (db modules, excluding drivers)
  144. module_group_db=acc_db auth_db avp_db db_ops db_text \
  145. uri_db domain lcr msilo speeddial
  146. #dbtext (s) not migrated yet to the new db interface
  147. # For mysql
  148. module_group_mysql_driver=db_mysql
  149. module_group_mysql=$(module_group_mysql_driver) $(module_group_db)
  150. # For postgress
  151. module_group_postgres_driver=db_postgres
  152. module_group_postgres=$(module_group_postgres_driver) $(module_group_db)
  153. # For radius
  154. module_group_radius=acc_radius auth_radius misc_radius peering
  155. # For presence
  156. # kamailio modules
  157. module_group_presence=presence presence_dialoginfo presence_mwi presence_xml \
  158. pua pua_bla pua_dialoginfo pua_mi pua_usrloc pua_xmpp \
  159. rls xcap_client
  160. #ser modules
  161. module_group_presence+=dialog presence_b2b xcap
  162. # obsolete/unmaintained ser modules
  163. #module_group_presence=pa rls
  164. # Modules in this group satisfy specific or niche applications, but are
  165. # considered stable for production use. They may or may not have dependencies
  166. # cpl-c => libxml2
  167. # jabber => expat (library)
  168. # osp => OSP Toolkit (sipfoundry)
  169. # sms => none (external modem)
  170. module_group_stable=cpl-c dbtext jabber osp sms pdb
  171. # Modules in this group are either not complete, untested, or without enough
  172. # reports of usage to allow the module into the stable group. They may or may
  173. # not have dependencies
  174. module_group_experimental=tls oracle iptrtpproxy
  175. # if not set on the cmd. line, env or in the modules.lst (cfg_group_include)
  176. # exclude the below modules.
  177. ifneq ($(group_include)$(cfg_group_include),)
  178. # For group_include, default all modules are excluded except those in
  179. # include_modules
  180. exclude_modules?=
  181. else
  182. # Old defaults for backwards compatibility
  183. # excluded because they depend on external libraries
  184. exclude_modules?= cpl mangler postgres jabber mysql cpl-c \
  185. auth_radius misc_radius \
  186. acc_radius pa rls presence_b2b xcap xmlrpc\
  187. osp tls oracle \
  188. unixsock dbg print_lib auth_identity ldap \
  189. db_berkeley db_mysql db_postgres db_oracle \
  190. db_unixodbc memcached mi_xmlrpc \
  191. perl perlvdb purple seas \
  192. snmpstats xmpp \
  193. carrierroute misc_radius peering \
  194. dialplan lcr utils presence \
  195. presence_dialoginfo presence_xml pua pua_bla \
  196. pua_dialoginfo pua_usrloc pua_xmpp \
  197. regex xcap_client
  198. #excluded because they depend on external *.h files
  199. exclude_modules+= h350
  200. # excluded because they do not compile (remove them only after they are
  201. # fixed) -- andrei
  202. exclude_modules+= bdb dbtext iptrtpproxy pa rls
  203. endif
  204. # always exclude the CVS dir
  205. override exclude_modules+= CVS $(skip_modules)
  206. # Test for the groups and add to include_modules
  207. ifneq (,$(group_include))
  208. $(eval override include_modules+= $(foreach grp, $(group_include), \
  209. $(module_group_$(grp)) ))
  210. endif
  211. # first 2 lines are excluded because of the experimental or incomplete
  212. # status of the modules
  213. # the rest is excluded because it depends on external libraries
  214. #
  215. static_modules:=
  216. ALLDEP=config.mak Makefile Makefile.dirs Makefile.sources Makefile.rules
  217. #include general defs (like CC, CFLAGS a.s.o)
  218. # hack to force makefile.defs re-inclusion (needed when make calls itself with
  219. # other options -- e.g. make bin)
  220. #makefile_defs=0
  221. #C_DEFS:=
  222. # try saved cfg, unless we are in the process of building it or if we're doing
  223. # a clean
  224. ifeq (,$(strip \
  225. $(filter config.mak config cfg cfg-defs $(clean_targets),$(MAKECMDGOALS))))
  226. include config.mak
  227. ifeq ($(makefile_defs),1)
  228. ifeq ($(quiet),verbose)
  229. $(info config.mak loaded)
  230. endif # verbose
  231. export makefile_defs
  232. # config_make valid & used
  233. config_mak=1
  234. ifeq ($(MAIN_NAME),)
  235. $(error "bad config.mak, try re-running make cfg")
  236. endif
  237. endif
  238. else # config.mak doesn't need to be used
  239. ifneq (,$(filter cfg config cfg-defs,$(word 1,$(MAKECMDGOALS))))
  240. # needed here to avoid starting a config submake
  241. # (e.g. rm -f config.mak; make config.mak), which would either require
  242. # double Makefile.defs defines execution (suboptimal), would loose
  243. # $(value ...) expansion or would cause some warning (if Makefile.defs exec.
  244. # is skipped in the "main" makefile invocation).
  245. $(shell rm -rf config.mak)
  246. config_mak=0
  247. makefile_defs=0
  248. exported_vars=0
  249. else
  250. # config.mak not strictly needed, but try to load it if exists for $(Q)
  251. config_mak=skip
  252. -include config.mak
  253. export makefile_defs
  254. endif
  255. endif
  256. main_makefile=1
  257. include Makefile.defs
  258. static_modules_path=$(addprefix modules/, $(static_modules))
  259. extra_sources=$(wildcard $(addsuffix /*.c, $(static_modules_path)))
  260. extra_objs=$(extra_sources:.c=.o)
  261. static_defs:= $(foreach mod, $(static_modules), \
  262. -DSTATIC_$(shell echo $(mod) | tr [:lower:] [:upper:]) )
  263. override extra_defs+=$(static_defs) $(EXTRA_DEFS)
  264. export extra_defs
  265. # Historically, the resultant set of modules is: modules/* - exclude_modules +
  266. # include_modules
  267. # When group_include is used, we want: include_modules (based on group_include)
  268. # - exclude_modules
  269. ifneq ($(modules_configured),1)
  270. #modules_all=$(filter-out modules/CVS,$(wildcard modules/*))
  271. # create modules*_all vars
  272. $(foreach mods,$(modules_dirs),$(eval \
  273. $(mods)_all=$$(filter-out $(mods)/CVS,$$(wildcard $(mods)/*))))
  274. #debugging
  275. #$(foreach mods,$(modules_dirs),$(info "$(mods)_all=$($(mods)_all)"))
  276. ifneq ($(group_include),)
  277. $(foreach mods,$(modules_dirs),$(eval \
  278. $(mods)=$$(filter-out $$(addprefix $(mods)/, \
  279. $$(exclude_modules) $$(static_modules)), \
  280. $$(addprefix $(mods)/, $$(include_modules) )) ))
  281. else
  282. # Standard, old resultant set
  283. $(foreach mods,$(modules_dirs),$(eval \
  284. $(mods)_noinc=$$(filter-out $$(addprefix $(mods)/, \
  285. $$(exclude_modules) $$(static_modules)), $$($(mods)_all)) \
  286. ))
  287. $(foreach mods,$(modules_dirs),$(eval \
  288. $(mods)=$$(filter-out $$(modules_noinc), \
  289. $$(addprefix $(mods)/, $$(include_modules) )) $$($(mods)_noinc) \
  290. ))
  291. endif # ifneq($(group_include),)
  292. endif # ifneq($(modules_configured),1)
  293. $(foreach mods,$(modules_dirs),$(eval \
  294. $(mods)_names=$$(shell echo $$($(mods))| \
  295. sed -e "s/$(mods)"'\/\([^/ ]*\)\/*/\1.so/g' ) \
  296. ))
  297. $(foreach mods,$(modules_dirs),$(eval \
  298. $(mods)_basenames:=$$(shell echo $$($(mods))| \
  299. sed -e "s/$(mods)"'\/\([^/ ]*\)\/*/\1/g' ) \
  300. ))
  301. # all modules from all the $(modules_dirs)
  302. all_modules_lst=$(foreach mods,$(modules_dirs), $($(mods)_all))
  303. # compile modules list (all the compiled mods from $(modules_dirs))
  304. cmodules=$(foreach mods,$(modules_dirs), $($(mods)))
  305. #modules_names=$(patsubst modules/%, %.so, $(modules))
  306. #modules_full_path=$(join $(modules), $(addprefix /, $(modules_names)))
  307. # list of utils directories that should be compiled by make utils
  308. C_COMPILE_UTILS= utils/sercmd
  309. # list of binaries that should be installed alongside
  310. # (they should be created after make utils, see C_COMPILE_UTILS)
  311. C_INSTALL_BIN= # sercmd is now installed by ctl
  312. # which utils know to install themselves and should be installed
  313. # along the core (list of utils directories)
  314. C_INSTALL_UTILS=
  315. # list of scripts that should be installed along the core
  316. # (here a script is something that doesn't have a Makefile)
  317. C_INSTALL_SCRIPTS=
  318. # list of extra configs that should be installed along the core
  319. # Note: all the paths of the form /usr/*lib/$(CFG_NAME)/<module_dir>
  320. # will be updated to the directory where the modules will be installed.
  321. C_INSTALL_CFGS=
  322. # list of files that should be installed in the arch-independent
  323. # directory (by default /usr/local/share/$(MAIN_NAME)))
  324. C_INSTALL_SHARE=
  325. NAME=$(MAIN_NAME)
  326. tar_name=$(NAME)-$(RELEASE)_src
  327. tar_extra_args+=$(addprefix --exclude=$(notdir $(CURDIR))/, \
  328. $(auto_gen) $(auto_gen_others))
  329. ifeq ($(CORE_TLS), 1)
  330. tar_extra_args+=
  331. else
  332. tar_extra_args+=--exclude=$(notdir $(CURDIR))/tls/*
  333. endif
  334. ifneq ($(nodeb),)
  335. tar_extra_args+=--exclude=$(notdir $(CURDIR))/debian
  336. tar_name:=$(tar_name)_nodeb
  337. endif
  338. # sanity checks
  339. ifneq ($(TLS),)
  340. $(warning "make TLS option is obsoleted, try TLS_HOOKS or CORE_TLS")
  341. endif
  342. # include the common rules
  343. include Makefile.rules
  344. #extra targets
  345. $(NAME): $(extra_objs) # static_modules
  346. lex.yy.c: cfg.lex cfg.tab.h $(ALLDEP)
  347. $(LEX) $<
  348. cfg.tab.c cfg.tab.h: cfg.y $(ALLDEP)
  349. $(YACC) $(YACC_FLAGS) $<
  350. nullstring=
  351. space=$(nullstring) $(nullstring)
  352. modules_search_path=$(subst $(space),:,$(strip\
  353. $(foreach m,$(modules_dirs),$($(m)_target))))
  354. # $(addprefix $(modules_target),$(modules_dirs))))
  355. # special depends for main.o
  356. main.d main.o: autover.h
  357. main.o: DEFS+=-DMODS_DIR='"$(modules_search_path)"'
  358. #special depends for core_cmd.o
  359. core_cmd.d core_cmd.o: autover.h
  360. include Makefile.shared
  361. ifeq ($(config_mak),1)
  362. include Makefile.cfg
  363. # fix basedir path (relative -> absolute)
  364. ifneq (,$(basedir))
  365. ifeq (,$(filter /%, $(basedir)))
  366. override basedir:=$(CURDIR)/$(basedir)
  367. # remove basedir from command line overrides
  368. MAKEOVERRIDES:=$(filter-out basedir=%,$ $(MAKEOVERRIDES))
  369. endif # (,$(filter /%, $(basedir)))
  370. endif # (,$(basedir))
  371. else ifneq ($(config_mak),skip)
  372. config.mak: Makefile.defs
  373. @echo making config...
  374. @echo "# this file is autogenerated by make cfg" >$@
  375. @$(call mapf2,cfg_save_var,saved_fixed_vars,$(@))
  376. @$(call mapf2,cfg_save_var2,saved_chg_vars,$(@))
  377. @echo "override makefile_defs:=1" >>$@
  378. @echo "C_DEFS:=\$$(filter-out \$$(DEFS_RM) \$$(extra_defs),\$$(C_DEFS))" \
  379. "\$$(extra_defs)" >>$@
  380. @echo "CFLAGS:=\$$(filter-out \$$(CFLAGS_RM) \$$(CC_EXTRA_OPTS)," \
  381. "\$$(CFLAGS)) \$$(CC_EXTRA_OPTS)" >>$@
  382. endif # ifeq ($(config_mak),1)
  383. modules.lst:
  384. @echo saving modules list...
  385. @echo "# this file is autogenerated by make modules-cfg" >$@
  386. @echo "modules_dirs:=$(modules_dirs)" >>$@
  387. @echo "cfg_group_include=$(group_include)" >>$@
  388. @$(call cfg_save_var2,include_modules,$@)
  389. @$(call cfg_save_var2,static_modules,$@)
  390. @$(call cfg_save_var2,skip_modules,$@)
  391. @$(call cfg_save_var2,exclude_modules,$@)
  392. @$(foreach mods,$(modules_dirs), \
  393. $(call cfg_save_var2,$(mods)_all,$@))
  394. @$(foreach mods,$(modules_dirs), \
  395. $(call cfg_save_var2,$(mods)_noinc,$@))
  396. @$(foreach mods,$(modules_dirs), \
  397. $(call cfg_save_var2,$(mods),$@))
  398. @echo "modules_configured:=1" >>$@
  399. .PHONY: cfg config cfg-defs
  400. cfg-defs: config.mak
  401. cfg config: cfg-defs modules-cfg
  402. .PHONY: modules-cfg modules-list modules-lst
  403. modules-cfg modules-list modules-lst:
  404. rm -f modules.lst
  405. $(MAKE) modules.lst
  406. ifneq ($(wildcard .git),)
  407. # if .git/ exists
  408. repo_ver=$(shell RV=`git rev-parse --verify --short=6 HEAD 2>/dev/null`;\
  409. [ -n "$$RV" ] && \
  410. test -n "`git update-index --refresh --unmerged >/dev/null\
  411. ; git diff-index --name-only HEAD 2>/dev/null | \
  412. grep -v Makefile`" &&\
  413. RV="$$RV"-dirty; echo "$$RV")
  414. autover_h_dep=.git $(filter-out $(auto_gen), $(sources)) cfg.y cfg.lex
  415. else
  416. # else if .git/ does not exist
  417. repo_ver=
  418. autover_h_dep=
  419. endif
  420. autover.h: $(autover_h_dep)
  421. @echo "generating autover.h ..."
  422. @echo "/* this file is autogenerated by make autover.h" >$@
  423. @echo " * DO NOT EDIT IT" >>$@
  424. @echo " */" >>$@
  425. @echo "" >>$@
  426. @echo "#define REPO_VER \"$(repo_ver)\"" >>$@
  427. .PHONY: all
  428. all: $(NAME) every-module
  429. .PHONY: print-modules
  430. print-modules:
  431. @echo The following modules were chosen to be included: \
  432. $(include_modules) ; \
  433. echo ---------------------------------------------------------- ; \
  434. echo The following modules will be excluded: $(exclude_modules) ; \
  435. echo ---------------------------------------------------------- ; \
  436. echo The following modules will be made; \
  437. $(foreach mods,$(modules_dirs), \
  438. echo $(mods)/: $($(mods)_basenames) ; ) \
  439. #echo DBG: The following modules will be made: $(modules_basenames) ; \
  440. # modules templates (instantiated based on modules_dirs contents)
  441. define MODULES_RULES_template
  442. $(1)_dst=$(modules_prefix)/$(modules_dir)$(1)
  443. $(1)_target=$(prefix)/$(modules_dir)$(1)
  444. .PHONY: $(1)
  445. $(1): modules.lst
  446. @for r in $($(1)) "" ; do \
  447. if [ -n "$$$$r" -a -r "$$$$r/Makefile" ]; then \
  448. $(call oecho, "" ;) \
  449. $(call oecho, "" ;) \
  450. if $(MAKE) -C $$$$r $$(mk_params) || [ ${err_fail} != 1 ] ; then \
  451. :; \
  452. else \
  453. exit 1; \
  454. fi ; \
  455. fi ; \
  456. done; true
  457. .PHONY: $(1)-doc
  458. $(1)-doc: modules.lst
  459. @for r in $($(1)) "" ; do \
  460. if [ -n "$$$$r" ]; then \
  461. $(call oecho, "" ;) \
  462. $(call oecho, "" ;) \
  463. $(MAKE) -C $$$$r/doc $(doc_format) $$(mk_params); \
  464. fi ; \
  465. done
  466. .PHONY: $(1)-readme
  467. $(1)-readme: modules.lst
  468. -@for r in $($(1)) "" ; do \
  469. if [ -n "$$$$r" ]; then \
  470. $(call oecho, "" ;) \
  471. $(call oecho, "" ;) \
  472. if $(MAKE) -C $$$$r $$(mk_params) README || [ ${err_fail} != 1 ];\
  473. then \
  474. :; \
  475. else \
  476. exit 1; \
  477. fi ; \
  478. fi ; \
  479. done; true
  480. .PHONY: $(1)-man
  481. $(1)-man: modules.lst
  482. -@for r in $($(1)) "" ; do \
  483. if [ -n "$$$$r" ]; then \
  484. $(call oecho, "" ;) \
  485. $(call oecho, "" ;) \
  486. if $(MAKE) -C $$$$r $$(mk_params) man || [ ${err_fail} != 1 ] ;\
  487. then \
  488. :; \
  489. else \
  490. exit 1; \
  491. fi ; \
  492. fi ; \
  493. done; true
  494. .PHONY: install-$(1)
  495. install-$(1): modules.lst $$($(1)_dst)
  496. @for r in $($(1)) "" ; do \
  497. if [ -n "$$$$r" -a -r "$$$$r/Makefile" ]; then \
  498. $(call oecho, "" ;) \
  499. $(call oecho, "" ;) \
  500. if $(MAKE) -C $$$$r install mods_dst=$$($(1)_dst) $$(mk_params) \
  501. || [ ${err_fail} != 1 ] ; then \
  502. :; \
  503. else \
  504. exit 1; \
  505. fi ; \
  506. fi ; \
  507. done; true
  508. .PHONY: install-$(1)-doc
  509. install-$(1)-doc: modules.lst $(doc_prefix)/$(doc_dir)$(1)
  510. @for r in $($(1)_basenames) "" ; do \
  511. if [ -n "$$$$r" ]; then \
  512. if [ -f $(1)/"$$$$r"/README ]; then \
  513. $$(call try_err,\
  514. $(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)$(1)/README ); \
  515. $$(call try_err,\
  516. $(INSTALL_DOC) $(1)/"$$$$r"/README \
  517. $(doc_prefix)/$(doc_dir)$(1)/README ); \
  518. $$(call try_err,\
  519. mv -f $(doc_prefix)/$(doc_dir)$(1)/README \
  520. $(doc_prefix)/$(doc_dir)$(1)/README."$$$$r" ); \
  521. fi ; \
  522. fi ; \
  523. done; true
  524. .PHONY: install-$(1)-man
  525. install-$(1)-man: $(1)-man $(man_prefix)/$(man_dir)/man7
  526. @for r in $($(1)_basenames) "" ; do \
  527. if [ -n "$$$$r" ]; then \
  528. if [ -f $(1)/"$$$$r"/"$$$$r".7 ]; then \
  529. $$(call try_err,\
  530. $(INSTALL_TOUCH) $(man_prefix)/$(man_dir)/man7/"$$$$r".7 );\
  531. $$(call try_err,\
  532. $(INSTALL_MAN) $(1)/"$$$$r"/"$$$$r".7 \
  533. $(man_prefix)/$(man_dir)/man7 ); \
  534. fi ; \
  535. fi ; \
  536. done; true
  537. $(modules_prefix)/$(modules_dir)$(1):
  538. mkdir -p $$(@)
  539. $(doc_prefix)/$(doc_dir)$(1):
  540. mkdir -p $$(@)
  541. endef
  542. # instantiate the template
  543. $(foreach mods,$(modules_dirs),$(eval $(call MODULES_RULES_template,$(mods))))
  544. #$(foreach mods,$(modules_dirs),$(eval $(info DUMP: $(call MODULES_RULES_template,$(mods)))))
  545. # build all the modules
  546. modules-all every-module: $(modules_dirs)
  547. $(extra_objs):
  548. @echo "Extra objs: $(extra_objs)"
  549. @for r in $(static_modules_path) "" ; do \
  550. if [ -n "$$r" -a -r "$$r/Makefile" ]; then \
  551. $(call oecho, "" ;) \
  552. $(call oecho, "Making static module $r" ;) \
  553. if $(MAKE) -C $$r static $(mk_params) ; then \
  554. :; \
  555. else \
  556. exit 1; \
  557. fi ; \
  558. fi ; \
  559. done
  560. .PHONY: utils
  561. utils:
  562. @for r in $(C_COMPILE_UTILS) "" ; do \
  563. if [ -n "$$r" ]; then \
  564. $(call oecho, "" ;) \
  565. $(call oecho, "" ;) \
  566. if $(MAKE) -C $$r $(mk_params) || [ ${err_fail} != 1 ] ; \
  567. then \
  568. :; \
  569. else \
  570. exit 1; \
  571. fi ; \
  572. fi ; \
  573. done; true
  574. dbg: sip-router
  575. gdb -command debug.gdb
  576. .PHONY: tar
  577. .PHONY: dist
  578. dist: tar
  579. tar: $(auto_gen_keep)
  580. $(TAR) -C .. \
  581. --exclude=$(notdir $(CURDIR))/test* \
  582. --exclude=$(notdir $(CURDIR))/tmp* \
  583. --exclude=$(notdir $(CURDIR))/debian/$(MAIN_NAME) \
  584. --exclude=$(notdir $(CURDIR))/debian/$(MAIN_NAME)-* \
  585. --exclude=$(notdir $(CURDIR))/$(MAIN_NAME)_tls* \
  586. --exclude=.git* \
  587. --exclude=CVS* \
  588. --exclude=.svn* \
  589. --exclude=.cvsignore \
  590. --exclude=librpath.lst \
  591. --exclude=libiname.lst \
  592. --exclude=makecfg.lst \
  593. --exclude=config.mak \
  594. --exclude=modules.lst \
  595. --exclude=*.[do] \
  596. --exclude=*.so \
  597. --exclude=*.il \
  598. --exclude=$(notdir $(CURDIR))/$(MAIN_NAME) \
  599. --exclude=*.gz \
  600. --exclude=*.bz2 \
  601. --exclude=*.tar \
  602. --exclude=*.patch \
  603. --exclude=.\#* \
  604. --exclude=*.swp \
  605. --exclude=*.swo \
  606. ${tar_extra_args} \
  607. -cf - $(notdir $(CURDIR)) | \
  608. (mkdir -p tmp/_tar1; mkdir -p tmp/_tar2 ; \
  609. cd tmp/_tar1; $(TAR) -xf - ) && \
  610. mv tmp/_tar1/$(notdir $(CURDIR)) \
  611. tmp/_tar2/"$(NAME)-$(RELEASE)" && \
  612. (cd tmp/_tar2 && $(TAR) \
  613. -zcf ../../"$(tar_name)".tar.gz \
  614. "$(NAME)-$(RELEASE)" ) ; \
  615. rm -rf tmp/_tar1; rm -rf tmp/_tar2
  616. # binary dist. tar.gz
  617. .PHONY: bin
  618. bin:
  619. mkdir -p tmp/$(MAIN_NAME)/usr/local
  620. $(MAKE) install basedir=$(CURDIR)/tmp/$(MAIN_NAME) $(mk_params)
  621. $(TAR) -C tmp/$(MAIN_NAME)/ -zcf ../$(NAME)-$(RELEASE)_$(OS)_$(ARCH).tar.gz .
  622. rm -rf tmp/$(MAIN_NAME)
  623. .PHONY: deb
  624. deb:
  625. -@if [ -d debian ]; then \
  626. dpkg-buildpackage -rfakeroot -tc; \
  627. else \
  628. ln -s pkg/debian debian; \
  629. dpkg-buildpackage -rfakeroot -tc; \
  630. rm debian; \
  631. fi
  632. .PHONY: sunpkg
  633. sunpkg:
  634. mkdir -p tmp/$(MAIN_NAME)
  635. mkdir -p tmp/$(MAIN_NAME)_sun_pkg
  636. $(MAKE) install basedir=$(CURDIR)/tmp/$(MAIN_NAME) \
  637. prefix=/usr/local $(mk_params)
  638. (cd pkg/solaris; \
  639. pkgmk -r ../../tmp/$(MAIN_NAME)/usr/local -o -d ../../tmp/$(MAIN_NAME)_sun_pkg/ -v "$(RELEASE)" ;\
  640. cd ../..)
  641. cat /dev/null > ../$(NAME)-$(RELEASE)-$(OS)-$(ARCH)-local
  642. pkgtrans -s tmp/$(MAIN_NAME)_sun_pkg/ ../$(NAME)-$(RELEASE)-$(OS)-$(ARCH)-local \
  643. IPTEL$(MAIN_NAME)
  644. gzip -9 ../$(NAME)-$(RELEASE)-$(OS)-$(ARCH)-local
  645. rm -rf tmp/$(MAIN_NAME)
  646. rm -rf tmp/$(MAIN_NAME)_sun_pkg
  647. .PHONY: install
  648. install: mk_params="compile_for_install=yes"
  649. install: install-bin install-every-module install-cfg \
  650. install-doc install-man install-utils install-share
  651. .PHONY: dbinstall
  652. dbinstall:
  653. -@echo "Initializing $(MAIN_NAME) database"
  654. scripts/mysql/$(SCR_NAME)_mysql.sh create
  655. -@echo "Done"
  656. .PHONY: README
  657. README: $(foreach mods,$(modules_dirs),$(mods)-readme)
  658. .PHONY: man
  659. man: $(foreach mods,$(modules_dirs),$(mods)-man)
  660. mk-install_dirs: $(cfg_prefix)/$(cfg_dir) $(bin_prefix)/$(bin_dir) \
  661. $(modules_prefix)/$(modules_dir) $(doc_prefix)/$(doc_dir) \
  662. $(man_prefix)/$(man_dir)/man8 $(man_prefix)/$(man_dir)/man5 \
  663. $(share_prefix)/$(share_dir) \
  664. $(foreach mods,$(modules_dirs),\
  665. $(modules_prefix)/$(modules_dir)$(mods) \
  666. $(doc_prefix)/$(doc_dir)$(mods) )
  667. $(cfg_prefix)/$(cfg_dir):
  668. mkdir -p $(cfg_prefix)/$(cfg_dir)
  669. $(bin_prefix)/$(bin_dir):
  670. mkdir -p $(bin_prefix)/$(bin_dir)
  671. $(share_prefix)/$(share_dir):
  672. mkdir -p $(share_prefix)/$(share_dir)
  673. $(modules_prefix)/$(modules_dir):
  674. mkdir -p $(modules_prefix)/$(modules_dir)
  675. $(doc_prefix)/$(doc_dir):
  676. mkdir -p $(doc_prefix)/$(doc_dir)
  677. $(man_prefix)/$(man_dir)/man8:
  678. mkdir -p $(man_prefix)/$(man_dir)/man8
  679. $(man_prefix)/$(man_dir)/man7:
  680. mkdir -p $(man_prefix)/$(man_dir)/man7
  681. $(man_prefix)/$(man_dir)/man5:
  682. mkdir -p $(man_prefix)/$(man_dir)/man5
  683. # note: sed with POSIX.1 regex doesn't support |, + or ? (darwin, solaris ...)
  684. install-cfg: $(cfg_prefix)/$(cfg_dir)
  685. @sed $(foreach m,$(modules_dirs),\
  686. -e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
  687. < etc/$(CFG_NAME)-basic.cfg > \
  688. $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg.sample
  689. @chmod 644 $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg.sample
  690. @if [ -z "${skip_cfg_install}" -a \
  691. ! -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg ]; then \
  692. mv -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg.sample \
  693. $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg; \
  694. fi
  695. @sed $(foreach m,$(modules_dirs),\
  696. -e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
  697. < etc/$(CFG_NAME)-oob.cfg \
  698. > $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample
  699. @chmod 644 $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample
  700. @if [ -z "${skip_cfg_install}" -a \
  701. ! -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg ]; \
  702. then \
  703. mv -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample \
  704. $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg; \
  705. fi
  706. # other configs
  707. @for r in $(C_INSTALL_CFGS) ; do \
  708. if [ -n "$$r" ]; then \
  709. if [ -f "$$r" ]; then \
  710. n=`basename "$$r"` ; \
  711. sed $(foreach m,$(modules_dirs),\
  712. -e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
  713. < "$$r" \
  714. > "$(cfg_prefix)/$(cfg_dir)$$n.sample" ; \
  715. chmod 644 "$(cfg_prefix)/$(cfg_dir)$$n.sample" ; \
  716. if [ -z "${skip_cfg_install}" -a \
  717. ! -f "$(cfg_prefix)/$(cfg_dir)$$n" ]; \
  718. then \
  719. mv -f "$(cfg_prefix)/$(cfg_dir)$$n.sample" \
  720. "$(cfg_prefix)/$(cfg_dir)$$n"; \
  721. fi ; \
  722. else \
  723. echo "ERROR: $$r not found" ; \
  724. if [ ${err_fail} = 1 ] ; then \
  725. exit 1; \
  726. fi ; \
  727. fi ; \
  728. fi ; \
  729. done; true
  730. # radius dictionary
  731. $(INSTALL_TOUCH) $(cfg_prefix)/$(cfg_dir)/dictionary.$(CFG_NAME)
  732. $(INSTALL_CFG) etc/dictionary.$(CFG_NAME) $(cfg_prefix)/$(cfg_dir)
  733. install-bin: $(bin_prefix)/$(bin_dir) $(NAME)
  734. $(INSTALL_TOUCH) $(bin_prefix)/$(bin_dir)/$(NAME)
  735. $(INSTALL_BIN) $(NAME) $(bin_prefix)/$(bin_dir)
  736. install-share: $(share_prefix)/$(share_dir)
  737. @for r in $(C_INSTALL_SHARE) "" ; do \
  738. if [ -n "$$r" ]; then \
  739. if [ -f "$$r" ]; then \
  740. $(call try_err, $(INSTALL_TOUCH) \
  741. $(share_prefix)/$(share_dir)/`basename "$$r"` ); \
  742. $(call try_err, \
  743. $(INSTALL_SHARE) "$$r" $(share_prefix)/$(share_dir) );\
  744. else \
  745. echo "ERROR: $$r not found" ; \
  746. if [ ${err_fail} = 1 ] ; then \
  747. exit 1; \
  748. fi ; \
  749. fi ;\
  750. fi ; \
  751. done; true
  752. install-every-module: $(foreach mods,$(modules_dirs),install-$(mods))
  753. install-every-module-doc: $(foreach mods,$(modules_dirs),install-$(mods)-doc)
  754. install-every-module-man: $(foreach mods,$(modules_dirs),install-$(mods)-man)
  755. install-utils: utils $(bin_prefix)/$(bin_dir)
  756. @for r in $(C_INSTALL_BIN) "" ; do \
  757. if [ -n "$$r" ]; then \
  758. if [ -f "$$r" ]; then \
  759. $(call try_err, $(INSTALL_TOUCH) \
  760. $(bin_prefix)/$(bin_dir)/`basename "$$r"` ); \
  761. $(call try_err,\
  762. $(INSTALL_BIN) "$$r" $(bin_prefix)/$(bin_dir) ); \
  763. else \
  764. echo "ERROR: $$r not compiled" ; \
  765. if [ ${err_fail} = 1 ] ; then \
  766. exit 1; \
  767. fi ; \
  768. fi ;\
  769. fi ; \
  770. done; true
  771. @for r in $(C_INSTALL_SCRIPTS) "" ; do \
  772. if [ -n "$$r" ]; then \
  773. if [ -f "$$r" ]; then \
  774. $(call try_err, $(INSTALL_TOUCH) \
  775. $(bin_prefix)/$(bin_dir)/`basename "$$r"` ); \
  776. $(call try_err,\
  777. $(INSTALL_SCRIPT) "$$r" $(bin_prefix)/$(bin_dir) ); \
  778. else \
  779. echo "ERROR: $$r not compiled" ; \
  780. if [ ${err_fail} = 1 ] ; then \
  781. exit 1; \
  782. fi ; \
  783. fi ;\
  784. fi ; \
  785. done; true
  786. @for ut in $(C_INSTALL_UTILS) ; do \
  787. $(call try_err, $(MAKE) -C "$${ut}" install-if-newer ) ;\
  788. done; true
  789. install-modules-all: install-every-module install-every-module-doc
  790. install-doc: $(doc_prefix)/$(doc_dir) install-every-module-doc
  791. $(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/INSTALL
  792. $(INSTALL_DOC) INSTALL $(doc_prefix)/$(doc_dir)
  793. $(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/README-MODULES
  794. $(INSTALL_DOC) README-MODULES $(doc_prefix)/$(doc_dir)
  795. $(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/AUTHORS
  796. $(INSTALL_DOC) AUTHORS $(doc_prefix)/$(doc_dir)
  797. $(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/NEWS
  798. $(INSTALL_DOC) NEWS $(doc_prefix)/$(doc_dir)
  799. $(INSTALL_TOUCH) $(doc_prefix)/$(doc_dir)/README
  800. $(INSTALL_DOC) README $(doc_prefix)/$(doc_dir)
  801. install-sr-man: $(man_prefix)/$(man_dir)/man8 $(man_prefix)/$(man_dir)/man5
  802. @sed -e "s#/etc/$(CFG_NAME)/$(CFG_NAME)\.cfg#$(cfg_target)$(MAIN_NAME).cfg#g" \
  803. -e "s#/usr/sbin/#$(bin_target)#g" \
  804. $(foreach m,$(modules_dirs),\
  805. -e "s#/usr/lib/$(CFG_NAME)/$(m)\([^_]\)#$($(m)_target)\1#g") \
  806. -e "s#/usr/share/doc/$(CFG_NAME)/#$(doc_target)#g" \
  807. < $(CFG_NAME).8 > \
  808. $(man_prefix)/$(man_dir)/man8/$(MAIN_NAME).8
  809. @chmod 644 $(man_prefix)/$(man_dir)/man8/$(MAIN_NAME).8
  810. @sed -e "s#/etc/$(CFG_NAME)/$(CFG_NAME)\.cfg#$(cfg_target)$(MAIN_NAME).cfg#g" \
  811. -e "s#/usr/sbin/#$(bin_target)#g" \
  812. $(foreach m,$(modules_dirs),\
  813. -e "s#/usr/lib/$(CFG_NAME)/$(m)\([^_]\)#$($(m)_target)\1#g") \
  814. -e "s#/usr/share/doc/$(CFG_NAME)/#$(doc_target)#g" \
  815. < $(CFG_NAME).cfg.5 > \
  816. $(man_prefix)/$(man_dir)/man5/$(MAIN_NAME).cfg.5
  817. @chmod 644 $(man_prefix)/$(man_dir)/man5/$(MAIN_NAME).cfg.5
  818. install-man: install-sr-man install-every-module-man
  819. # libs cleaning targets
  820. .PHONY: clean-libs
  821. clean-libs:
  822. $(MAKE) -C lib clean
  823. .PHONY: proper-libs realclean-libs distclean-libs maintainer-clean-libs
  824. proper-libs realclean-libs distclean-libs maintainer-clean-libs:
  825. $(MAKE) -C lib $(patsubst %-libs,%,$@)
  826. # utils cleaning targets
  827. .PHONY: clean-utils
  828. clean-utils:
  829. @for r in $(C_COMPILE_UTILS) $(C_INSTALL_UTILS) "" ; do \
  830. if [ -d "$$r" ]; then \
  831. $(MAKE) -C "$$r" clean ; \
  832. fi ; \
  833. done
  834. .PHONY: proper-utils
  835. .PHONY: distclean-utils
  836. .PHONY: realclean-utils
  837. .PHONY: maintainer-clean-utils
  838. proper-utils realclean-utils distclean-utils maintainer-clean-utils: \
  839. clean_target=$(patsubst %-utils,%,$@)
  840. proper-utils realclean-utils distclean-utils maintainer-clean-utils:
  841. @for r in $(C_COMPILE_UTILS) $(C_INSTALL_UTILS) "" ; do \
  842. if [ -d "$$r" ]; then \
  843. $(MAKE) -C "$$r" $(clean_target); \
  844. fi ; \
  845. done
  846. # clean extra binary names (common "flavour" names)
  847. clean: clean-extra-names
  848. # clean modules on make clean
  849. clean: clean-modules
  850. # clean utils on make clean
  851. clean: clean-utils
  852. # cleaning in libs always when cleaning sip-router
  853. clean: clean-libs
  854. .PHONY: clean-extra-names
  855. clean-extra-names:
  856. @rm -f $(filter-out $(MAIN_NAME), sip-router ser kamailio)
  857. # proper/distclean a.s.o modules, utils and libs too
  858. proper: clean-extra-names proper-modules proper-utils proper-libs
  859. distclean: distclean-modules distclean-utils distclean-libs
  860. realclean: realclean-modules realclean-utils realclean-libs
  861. maintainer-clean: maintainer-clean-modules maintainer-clean-utils \
  862. maintainer-clean-libs
  863. #try to clean everything (including all the modules, even ones that are not
  864. # configured/compiled normally
  865. .PHONY: clean-all
  866. clean-all: cmodules=$(all_modules_lst)
  867. clean-all: clean
  868. maintainer-clean: modules=$(modules_all)
  869. # on make proper clean also the build config (w/o module list)
  870. proper realclean distclean maintainer-clean: clean_cfg
  871. # on maintainer clean, remove also the configured module list
  872. maintainer-clean: clean_modules_cfg
  873. .PHONY: proper-all realclean-all distclean-all
  874. proper-all realclean-all distclean-all: cmodules=$(all_modules_lst)
  875. proper-all realclean-all distclean-all: proper
  876. .PHONY: clean_cfg clean-cfg
  877. clean_cfg clean-cfg:
  878. rm -f config.mak
  879. .PHONY: clean_modules_cfg clean-modules-cfg
  880. clean_modules_cfg clean-modules-cfg:
  881. rm -f modules.lst
  882. .PHONY: dbschema
  883. dbschema:
  884. -@echo "Build database schemas"
  885. $(MAKE) -C lib/srdb1/schema
  886. -@echo "Done"