# 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 BR2_TOOLCHAIN_DIR ?= $(shell cd ../toolchain/out-uclinux/bin;pwd) export BR2_TOOLCHAIN_DIR BR2_UCLINUX_DIST ?= $(shell cd ../uclinux533/uClinux-dist;pwd) export BR2_UCLINUX_DIST BR2_KERNEL_SOURCE ?= $(BR2_UCLINUX_DIST)/linux-2.6.x export BR2_KERNEL_SOURCE # 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 # Make a bootable linux image containing uCasterisk executable and all # support files. Assumes we have already made uCasterisk. You can set # up different Asterisk configurations using the syntax: # # make ASTCFG=2fxo2fxs bin # # in this case a 2FXO 2FXS configuration is built. The ASTCFG # variable sets the suffix of the three configuration files. There # are lots of different config files stored in package/asterisk/files # & package/zaptel/files ASTCFG=2fxo2fxs # default, can overwrite from command line export ASTCFG bin: # set up our own copy of the rom file system build by uClinux-dist rm -Rf $(TOPDIR)/romfs cp -a $(BR2_KERNEL_SOURCE)/../romfs $(TOPDIR) # copy files we need to run Asterisk and create uImage 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: make -C package/libtool clean make -C package/zlib clean make -C package/openssl clean make -C package/ncurses clean make -C src clean make -C package/zaptel clean make -C package/asterisk clean