Version 0.1.2 from FTP
[asterisk/asterisk.git] / Makefile
index 1ac473a..1b157c9 100755 (executable)
--- a/Makefile
+++ b/Makefile
 
 MODULES_DIR=/usr/lib/asterisk/modules
 
+# Pentium Pro Optimize
+#PROC=i686
+# Pentium Optimize
+PROC=i586
+
 DEBUG=-g #-pg
 INCLUDE=-Iinclude -I../include
 CFLAGS=-pipe -Wall -Werror -Wmissing-prototypes -Wmissing-declarations -O6 $(DEBUG) $(INCLUDE) -D_REENTRANT
-CFLAGS+=$(shell if $(CC) -march=i686 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=i686"; fi)
+CFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
 SUBDIRS=channels pbx apps codecs formats
-LIBS=-ldl -lpthread -lreadline # -lefence
-OBJS=io.o sched.o logger.o frame.o loader.o config.o channel.o translate.o file.o say.o pbx.o cli.o asterisk.o
+LIBS=-ldl -lpthread -lreadline #-lefence
+OBJS=io.o sched.o logger.o frame.o loader.o config.o channel.o translate.o file.o say.o pbx.o cli.o md5.o asterisk.o
 CC=gcc
 INSTALL=install
 
+_all: all
+       @echo " +--------- Asterisk Build Complete ---------+"  
+       @echo " + Asterisk has successfully been built, but +"  
+       @echo " + cannot be run before being installed by   +"  
+       @echo " + running:                                  +"  
+       @echo " +                                           +"
+       @echo " +               make install                +"  
+       @echo " +                                           +"
+       @echo " +-------------------------------------------+"  
+
 all: asterisk subdirs
 
 asterisk: $(OBJS)
@@ -38,8 +53,51 @@ clean:
        for x in $(SUBDIRS); do $(MAKE) -C $$x clean || exit 1 ; done
        rm -f *.o *.so asterisk
 
+datafiles: all
+       mkdir -p /var/lib/asterisk/sounds/digits
+       for x in sounds/digits/*; do \
+               install $$x /var/lib/asterisk/sounds/digits ; \
+       done
+       for x in sounds/vm-* sounds/transfer* ; do \
+               install $$x /var/lib/asterisk/sounds ; \
+       done
+
 install: all
        mkdir -p $(MODULES_DIR)
        for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done
        install -d /usr/include/asterisk
        install include/asterisk/*.h /usr/include/asterisk
+       rm -f /var/lib/asterisk/sounds/vm
+       mkdir -p /var/spool/asterisk/vm
+       rm -f /usr/lib/asterisk/modules/chan_ixj.so
+       ( cd /var/lib/asterisk/sounds  ; ln -s ../../../spool/asterisk/vm . )
+       @echo " +---- Asterisk Installation Complete -------+"  
+       @echo " + Asterisk has successfully been installed. +"  
+       @echo " + If you would like to install the sample   +"  
+       @echo " + configuration files (overwriting any      +"
+       @echo " + existing config files), run:              +"  
+       @echo " +                                           +"
+       @echo " +               make samples                +"
+       @echo " +                                           +"
+       @echo " +-------------------------------------------+"  
+
+samples: all datafiles
+       mkdir -p /etc/asterisk
+       for x in configs/*.sample; do \
+               if [ -f /etc/asterisk/`basename $$x .sample` ]; then \
+                       mv -f /etc/asterisk/`basename $$x .sample` /etc/asterisk/`basename $$x .sample`.old ; \
+               fi ; \
+               install $$x /etc/asterisk/`basename $$x .sample` ;\
+       done
+       for x in sounds/demo-*; do \
+               install $$x /var/lib/asterisk/sounds; \
+       done
+       mkdir -p /var/lib/asterisk/sounds/vm/1234
+       :> /var/lib/asterisk/sounds/vm/1234/unavail.gsm
+       for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isunavail; do \
+               cat /var/lib/asterisk/sounds/$$x.gsm >> /var/lib/asterisk/sounds/vm/1234/unavail.gsm ; \
+       done
+       :> /var/lib/asterisk/sounds/vm/1234/busy.gsm
+       for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isonphone; do \
+               cat /var/lib/asterisk/sounds/$$x.gsm >> /var/lib/asterisk/sounds/vm/1234/busy.gsm ; \
+       done