# Top level Makefile for uCasterisk # David Rowe 8/11/05 # # Based on buildroot environemnt from openWRT project # # Note to debug make files (e.g. for asterisk package) try: # # make TOPDIR=$(pwd) -C package/asterisk compile --debug=verbose -n # TOPDIR = $(shell pwd) export TOPDIR # extract dir from /path/to/dir RELCWD = $(shell pwd | sed -e "s/.*\///") VERSION = 0.1.9 DATE = $(shell date '+%d %b %Y') # make everything we need to build uCasterisk all: @if [ ! -d dl ]; then \ mkdir dl; \ fi make -C package/libtool compile make -C package/zlib compile make -C package/openssl compile make -C package/ncurses compile make -C src make -C package/zaptel compile make -C package/zaptel install make -C package/threadstack install make -C package/blackfin-gsm install make -C package/speex install make -C package/asterisk compile make -C package/asterisk install # just make uCasterisk (used during asterisk development) # Or from command line type: # make TOPDIR=$(pwd) -C package/asterisk compile ast: make -C package/asterisk compile # make zaptel and wcfxs drivers zap: make -C package/zaptel compile # generate patches to create uCasterisk from Asterisk asterisk-make-patches: make -C package/asterisk make-patches make -C package/zaptel make-patches # generate tarball distro - we assume u have already generated patches dist: @if [ ! -d ../uCasterisk-$(VERSION) ]; then \ echo "Please change directory name to uCasterisk-$(VERSION)"; \ exit 1; \ fi # remove emacs backup files rm -f *~ find package -name *~ | xargs rm -f find scripts -name *~ | xargs rm -f cd unittest/spi;make clean cd unittest/sport;make clean # create tar ball containing only directories we need cd ..; tar vczf uCasterisk-$(VERSION).tar.gz \ --exclude '$(RELCWD)/build-bfin-uclinux/*' \ --exclude '$(RELCWD)/staging-bfin-uclinux/*' \ --exclude '$(RELCWD)/dl*' --exclude '$(RELCWD)/romfs*' \ --exclude '$(RELCWD)/images*' \ $(RELCWD) @echo @echo "Tar ball created in ../" ls -lh ../uCasterisk-$(VERSION).tar.gz # generate tarball of binary - assume we have run: # make TOPDIR=$(pwd) -C package/asterisk compile # make TOPDIR=$(pwd) -C package/asterisk install include .config bin: # set up our own private rom file system rm -Rf $(TOPDIR)/romfs cp -a $(BR2_KERNEL_SOURCE)/../romfs $(TOPDIR) make -C package/zaptel make-bin make -C package/asterisk make-bin # program MMC card and generate uImage for operation from MMC card # make MMCDIR=/path/to/mmc mmc mmc: rm -Rf $(TOPDIR)/romfs cp -a $(BR2_KERNEL_SOURCE)/../romfs $(TOPDIR) # program MMC card make -C package/asterisk make-mmc make -C package/zaptel make-mmc # generate uImage for operation off MMC card cp src/bfsi.ko $(TOPDIR)/romfs cp src/spi_mmc_bfsi.ko $(TOPDIR)/romfs make -C package/asterisk make-bin-mmc clean: # warn about cleaning our build-dir if that is where u have been # working, might delete latest work if not careful # convert README.txt to HTML and publish, sorry I # should really put this somewhere outside of this makefile! publish: asciidoc/buildmenu.pl README.txt asciidoc/menu.html /home/david/attic/asciidoc-7.0.4/asciidoc.py \ -a date='$(DATE)' -a icons -a badges \ -a stylesdir=$(TOPDIR)/asciidoc --unsafe \ -f $(TOPDIR)/asciidoc/layout1.conf README.txt scp README.html $(WEBSITE)/ucasterisk/ucasterisk.html