Makefile 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. #
  2. # Asterisk -- A telephony toolkit for Linux.
  3. #
  4. # Top level Makefile
  5. #
  6. # Copyright (C) 1999, Mark Spencer
  7. #
  8. # Mark Spencer <markster@linux-support.net>
  9. #
  10. # This program is free software, distributed under the terms of
  11. # the GNU General Public License
  12. #
  13. .EXPORT_ALL_VARIABLES:
  14. # Create OPTIONS variable
  15. OPTIONS=
  16. OSARCH=$(shell uname -s)
  17. ifeq (${OSARCH},Linux)
  18. PROC=$(shell uname -m)
  19. else
  20. ifeq (${OSARCH},FreeBSD)
  21. PROC=$(shell uname -m)
  22. endif
  23. endif
  24. # Pentium Pro Optimize
  25. #PROC=i686
  26. # Pentium & VIA processors optimize
  27. #PROC=i586
  28. #PROC=k6
  29. #PROC=ppc
  30. PWD=$(shell pwd)
  31. ######### More GSM codec optimization
  32. ######### Uncomment to enable MMXTM optimizations for x86 architecture CPU's
  33. ######### which support MMX instructions. This should be newer pentiums,
  34. ######### ppro's, etc, as well as the AMD K6 and K7.
  35. #K6OPT = -DK6OPT
  36. #Tell gcc to optimize the asterisk's code
  37. OPTIMIZE=-O6
  38. #Include debug symbols in the executables (-g) and profiling info (-pg)
  39. DEBUG=-g #-pg
  40. # New hangup routines for chan_zap.c
  41. # If this flag is uncommented then you need to have new libpri code in your system
  42. # You can still use the old libpri if you do "cvs update -D "08/03/03" in libpri source code
  43. OPTIONS += -DNEW_PRI_HANGUP
  44. # Optional debugging parameters
  45. DEBUG_THREADS = #-DDEBUG_THREADS #-DDO_CRASH
  46. # Uncomment next one to enable ast_frame tracing (for debugging)
  47. TRACE_FRAMES = #-DTRACE_FRAMES
  48. # Uncomment next one to enable malloc debugging
  49. # You can view malloc debugging with:
  50. # *CLI> show memory allocations [filename]
  51. # *CLI> show memory summary [filename]
  52. #
  53. MALLOC_DEBUG = #-include $(PWD)/include/asterisk/astmm.h
  54. # Where to install asterisk after compiling
  55. # Default -> leave empty
  56. INSTALL_PREFIX=
  57. # Staging directory
  58. # Files are copied here temporarily during the install process
  59. # For example, make DESTDIR=/tmp/asterisk woud put things in
  60. # /tmp/asterisk/etc/asterisk
  61. DESTDIR=
  62. # Original busydetect routine
  63. BUSYDETECT = #-DBUSYDETECT
  64. # Improved busydetect routine, comment the previous one if you use this one
  65. BUSYDETECT+= -DBUSYDETECT_MARTIN
  66. # Detect the busy signal looking only at tone lengths
  67. # For example if you have 3 beeps 100ms tone, 100ms silence separated by 500 ms of silence
  68. BUSYDETECT+= #-DBUSYDETECT_TONEONLY
  69. # Inforce the detection of busy singal (get rid of false hangups)
  70. # Don't use together with -DBUSYDETECT_TONEONLY
  71. BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE
  72. ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
  73. ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
  74. ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
  75. ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
  76. ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
  77. ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk
  78. ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
  79. ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
  80. ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
  81. ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
  82. MODULES_DIR=$(ASTLIBDIR)/modules
  83. AGI_DIR=$(ASTVARLIBDIR)/agi-bin
  84. INCLUDE=-Iinclude -I../include
  85. CFLAGS=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
  86. CFLAGS+=$(OPTIMIZE)
  87. CFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
  88. CFLAGS+=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
  89. ifeq (${OSARCH},FreeBSD)
  90. CFLAGS+=-pthread
  91. INCLUDE+=-I/usr/local/include
  92. endif
  93. ifeq (${OSARCH},OpenBSD)
  94. CFLAGS+=-pthread
  95. endif
  96. #Uncomment this to use the older DSP routines
  97. #CFLAGS+=-DOLD_DSP_ROUTINES
  98. CFLAGS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
  99. LIBEDIT=editline/libedit.a
  100. ASTERISKVERSION=$(shell if [ -f .version ]; then cat .version; else if [ -d CVS ]; then echo "CVS-`date +"%D-%T"`"; fi; fi)
  101. HTTPDIR=$(shell if [ -d /var/www ]; then echo "/var/www"; else echo "/home/httpd"; fi)
  102. RPMVERSION=$(shell if [ -f .version ]; then sed 's/[-\/:]/_/g' .version; else echo "unknown" ; fi)
  103. CFLAGS+=-DASTERISK_VERSION=\"$(ASTERISKVERSION)\"
  104. CFLAGS+=-DINSTALL_PREFIX=\"$(INSTALL_PREFIX)\"
  105. CFLAGS+=-DASTETCDIR=\"$(ASTETCDIR)\"
  106. CFLAGS+=-DASTLIBDIR=\"$(ASTLIBDIR)\"
  107. CFLAGS+=-DASTVARLIBDIR=\"$(ASTVARLIBDIR)\"
  108. CFLAGS+=-DASTVARRUNDIR=\"$(ASTVARRUNDIR)\"
  109. CFLAGS+=-DASTSPOOLDIR=\"$(ASTSPOOLDIR)\"
  110. CFLAGS+=-DASTLOGDIR=\"$(ASTLOGDIR)\"
  111. CFLAGS+=-DASTCONFPATH=\"$(ASTCONFPATH)\"
  112. CFLAGS+=-DASTMODDIR=\"$(MODULES_DIR)\"
  113. CFLAGS+=-DASTAGIDIR=\"$(AGI_DIR)\"
  114. CFLAGS+= $(DEBUG_THREADS)
  115. CFLAGS+= $(TRACE_FRAMES)
  116. CFLAGS+= $(MALLOC_DEBUG)
  117. CFLAGS+= $(BUSYDETECT)
  118. CFLAGS+= $(OPTIONS)
  119. CFLAGS+=# -fomit-frame-pointer
  120. SUBDIRS=res channels pbx apps codecs formats agi cdr astman stdtime
  121. ifeq (${OSARCH},Linux)
  122. LIBS=-ldl -lpthread
  123. endif
  124. ifeq (${OSARCH},OpenBSD)
  125. LIBS=-pthread
  126. else
  127. ifeq (${OSARCH},FreeBSD)
  128. LIBS=-pthread
  129. else
  130. endif
  131. endif
  132. LIBS+=-lncurses -lm
  133. ifeq (${OSARCH},Linux)
  134. LIBS+=-lresolv #-lnjamd
  135. endif
  136. ifeq (${OSARCH},Darwin)
  137. ifeq ($(shell uname -r),7.0.0)
  138. LIBS+=-lresolv
  139. endif
  140. endif
  141. OBJS=io.o sched.o logger.o frame.o loader.o config.o channel.o \
  142. translate.o file.o say.o pbx.o cli.o md5.o term.o \
  143. ulaw.o alaw.o callerid.o fskmodem.o image.o app.o \
  144. cdr.o tdd.o acl.o rtp.o manager.o asterisk.o ast_expr.o \
  145. dsp.o chanvars.o indications.o autoservice.o db.o privacy.o \
  146. astmm.o enum.o srv.o dns.o aescrypt.o aestab.o aeskey.o
  147. ifeq (${OSARCH},Darwin)
  148. OBJS+=poll.o dlfcn.o
  149. ASTLINK=-Wl,-dynamic
  150. SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
  151. else
  152. ASTLINK=-Wl,-E
  153. SOLINK=-shared -Xlinker -x
  154. endif
  155. CC=gcc
  156. INSTALL=install
  157. _all: all
  158. @echo " +--------- Asterisk Build Complete ---------+"
  159. @echo " + Asterisk has successfully been built, but +"
  160. @echo " + cannot be run before being installed by +"
  161. @echo " + running: +"
  162. @echo " + +"
  163. @echo " + $(MAKE) install +"
  164. @echo " +-------------------------------------------+"
  165. all: depend asterisk subdirs
  166. editline/config.h:
  167. cd editline && unset CFLAGS LIBS && ./configure ; \
  168. editline/libedit.a: FORCE
  169. cd editline && unset CFLAGS LIBS && test -f config.h || ./configure
  170. $(MAKE) -C editline libedit.a
  171. db1-ast/libdb1.a: FORCE
  172. @if [ -d db1-ast ]; then \
  173. $(MAKE) -C db1-ast libdb1.a ; \
  174. else \
  175. echo "You need to do a cvs update -d not just cvs update"; \
  176. exit 1; \
  177. fi
  178. ifneq ($(wildcard .depend),)
  179. include .depend
  180. endif
  181. .PHONY: _version
  182. _version:
  183. if [ -d CVS ] && ! [ -f .version ]; then echo $(ASTERISKVERSION) > .version; fi
  184. .version: _version
  185. .y.c:
  186. bison $< --name-prefix=ast_yy -o $@
  187. ast_expr.o: ast_expr.c
  188. cli.o: cli.c build.h
  189. asterisk.o: asterisk.c build.h
  190. ifneq ($(strip $(ASTERISKVERSION)),)
  191. build.h: .version
  192. ./make_build_h
  193. else
  194. build.h:
  195. ./make_build_h
  196. endif
  197. stdtime/libtime.a: FORCE
  198. @if [ -d stdtime ]; then \
  199. $(MAKE) -C stdtime libtime.a ; \
  200. else \
  201. echo "You need to do a cvs update -d not just cvs update"; \
  202. exit 1; \
  203. fi
  204. asterisk: editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
  205. $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBS) $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a
  206. subdirs:
  207. for x in $(SUBDIRS); do $(MAKE) -C $$x || exit 1 ; done
  208. clean:
  209. for x in $(SUBDIRS); do $(MAKE) -C $$x clean || exit 1 ; done
  210. rm -f *.o *.so asterisk .depend
  211. rm -f build.h
  212. rm -f ast_expr.c
  213. @if [ -e editline/Makefile ]; then $(MAKE) -C editline distclean ; fi
  214. $(MAKE) -C db1-ast clean
  215. $(MAKE) -C stdtime clean
  216. datafiles: all
  217. mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
  218. for x in sounds/digits/*.gsm; do \
  219. if grep -q "^%`basename $$x`%" sounds.txt; then \
  220. install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
  221. else \
  222. echo "No description for $$x"; \
  223. exit 1; \
  224. fi; \
  225. done
  226. for x in sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-*; do \
  227. if grep -q "^%`basename $$x`%" sounds.txt; then \
  228. install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
  229. else \
  230. echo "No description for $$x"; \
  231. exit 1; \
  232. fi; \
  233. done
  234. mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/mohmp3
  235. mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/images
  236. for x in images/*.jpg; do \
  237. install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
  238. done
  239. mkdir -p $(DESTDIR)$(AGI_DIR)
  240. update:
  241. @if [ -d CVS ]; then \
  242. echo "Updating from CVS..." ; \
  243. cvs -q update -Pd; \
  244. rm -f .version; \
  245. else \
  246. echo "Not CVS"; \
  247. fi
  248. bininstall: all
  249. mkdir -p $(DESTDIR)$(MODULES_DIR)
  250. mkdir -p $(DESTDIR)$(ASTSBINDIR)
  251. mkdir -p $(DESTDIR)$(ASTETCDIR)
  252. mkdir -p $(DESTDIR)$(ASTBINDIR)
  253. mkdir -p $(DESTDIR)$(ASTSBINDIR)
  254. mkdir -p $(DESTDIR)$(ASTVARRUNDIR)
  255. mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail
  256. install -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/
  257. install -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
  258. if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
  259. install -m 755 contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\
  260. fi
  261. for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done
  262. install -d $(DESTDIR)$(ASTHEADERDIR)
  263. install -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
  264. rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/vm
  265. rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
  266. if [ ! -h $(DESTDIR)$(ASTSPOOLDIR)/vm ] && [ -d $(DESTDIR)$(ASTSPOOLDIR)/vm ]; then \
  267. mv $(DESTDIR)$(ASTSPOOLDIR)/vm $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \
  268. else \
  269. mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \
  270. rm -f $(DESTDIR)$(ASTSPOOLDIR)/vm; \
  271. fi
  272. ln -s $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm
  273. rm -f $(DESTDIR)$(MODULES_DIR)/chan_ixj.so
  274. rm -f $(DESTDIR)$(MODULES_DIR)/chan_tor.so
  275. rm -f $(DESTDIR)$(MODULES_DIR)/cdr_mysql.so
  276. rm -f $(DESTDIR)$(MODULES_DIR)/cdr_unixodbc.so
  277. rm -f $(DESTDIR)$(MODULES_DIR)/codec_mp3_d.so
  278. rm -f $(DESTDIR)$(MODULES_DIR)/format_mp3.so
  279. rm -f $(DESTDIR)$(MODULES_DIR)/app_voicemail2.so
  280. mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds
  281. mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
  282. mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/keys
  283. install -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
  284. ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/vm . )
  285. ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . )
  286. @echo " +---- Asterisk Installation Complete -------+"
  287. @echo " + +"
  288. @echo " + YOU MUST READ THE SECURITY DOCUMENT +"
  289. @echo " + +"
  290. @echo " + Asterisk has successfully been installed. +"
  291. @echo " + If you would like to install the sample +"
  292. @echo " + configuration files (overwriting any +"
  293. @echo " + existing config files), run: +"
  294. @echo " + +"
  295. @echo " + $(MAKE) samples +"
  296. @echo " + +"
  297. @echo " +----------------- or ---------------------+"
  298. @echo " + +"
  299. @echo " + You can go ahead and install the asterisk +"
  300. @echo " + program documentation now or later run: +"
  301. @echo " + +"
  302. @echo " + $(MAKE) progdocs +"
  303. @echo " + +"
  304. @echo " + **Note** This requires that you have +"
  305. @echo " + doxygen installed on your local system +"
  306. @echo " +-------------------------------------------+"
  307. install: all datafiles bininstall
  308. upgrade: all bininstall
  309. adsi: all
  310. mkdir -p $(DESTDIR)$(ASTETCDIR)
  311. for x in configs/*.adsi; do \
  312. if ! [ -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
  313. install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
  314. fi ; \
  315. done
  316. samples: all datafiles adsi
  317. mkdir -p $(DESTDIR)$(ASTETCDIR)
  318. for x in configs/*.sample; do \
  319. if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
  320. mv -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`.old ; \
  321. fi ; \
  322. install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
  323. done
  324. echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf
  325. echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
  326. echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
  327. echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
  328. echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
  329. echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
  330. echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
  331. echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
  332. for x in sounds/demo-*; do \
  333. if grep -q "^%`basename $$x`%" sounds.txt; then \
  334. install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
  335. else \
  336. echo "No description for $$x"; \
  337. exit 1; \
  338. fi; \
  339. done
  340. for x in sounds/*.mp3; do \
  341. install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
  342. done
  343. mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
  344. :> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm
  345. for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isunavail; do \
  346. cat $(DESTDIR)$(ASTVARLIBDIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm ; \
  347. done
  348. :> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/busy.gsm
  349. for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isonphone; do \
  350. cat $(DESTDIR)$(ASTVARLIBDIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/busy.gsm ; \
  351. done
  352. webvmail:
  353. @[ -d $(DESTDIR)$(HTTPDIR) ] || ( echo "No HTTP directory" && exit 1 )
  354. @[ -d $(DESTDIR)$(HTTPDIR)/html ] || ( echo "No http directory" && exit 1 )
  355. @[ -d $(DESTDIR)$(HTTPDIR)/cgi-bin ] || ( echo "No cgi-bin directory" && exit 1 )
  356. install -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTPDIR)/cgi-bin/vmail.cgi
  357. mkdir -p $(DESTDIR)$(HTTPDIR)/html/_asterisk
  358. for x in images/*.gif; do \
  359. install -m 644 $$x $(DESTDIR)$(HTTPDIR)/html/_asterisk/; \
  360. done
  361. @echo " +--------- Asterisk Web Voicemail ----------+"
  362. @echo " + +"
  363. @echo " + Asterisk Web Voicemail is installed in +"
  364. @echo " + your cgi-bin directory. IT USES A SETUID +"
  365. @echo " + ROOT PERL SCRIPT, SO IF YOU DON'T LIKE +"
  366. @echo " + THAT, UNINSTALL IT! +"
  367. @echo " + +"
  368. @echo " +-------------------------------------------+"
  369. mailbox:
  370. ./contrib/scripts/addmailbox
  371. rpm: __rpm
  372. __rpm: _version
  373. rm -rf /tmp/asterisk ; \
  374. mkdir -p /tmp/asterisk/redhat/RPMS/i386 ; \
  375. $(MAKE) DESTDIR=/tmp/asterisk install ; \
  376. $(MAKE) DESTDIR=/tmp/asterisk samples ; \
  377. mkdir -p /tmp/asterisk/etc/rc.d/init.d ; \
  378. cp -f redhat/asterisk /tmp/asterisk/etc/rc.d/init.d/ ; \
  379. sed "s/^Version:.*/Version: $(RPMVERSION)/g" redhat/asterisk.spec > asterisk.spec ; \
  380. rpmbuild --rcfile /usr/lib/rpm/rpmrc:redhat/rpmrc -bb asterisk.spec
  381. progdocs:
  382. doxygen contrib/asterisk-ng-doxygen
  383. config:
  384. if [ -d /etc/rc.d/init.d ]; then \
  385. install -m 755 contrib/init.d/rc.redhat.asterisk /etc/rc.d/init.d/asterisk; \
  386. /sbin/chkconfig --add asterisk; \
  387. elif [ -d /etc/init.d ]; then \
  388. install -m 755 init.asterisk /etc/init.d/asterisk; \
  389. fi
  390. dont-optimize:
  391. $(MAKE) OPTIMIZE= K6OPT= install
  392. valgrind: dont-optimize
  393. depend: .depend
  394. for x in $(SUBDIRS); do $(MAKE) -C $$x depend || exit 1 ; done
  395. .depend:
  396. ./mkdep ${CFLAGS} `ls *.c`
  397. FORCE: