asterisk/codecs/Makefile

95 lines
1.8 KiB
Makefile
Raw Normal View History

#
# Asterisk -- An open source telephony toolkit.
#
# Makefile for codec modules
#
# Copyright (C) 1999-2006, Digium, Inc.
#
# Mark Spencer <markster@digium.com>
#
# This program is free software, distributed under the terms of
# the GNU General Public License
#
-include $(ASTTOPDIR)/menuselect.makeopts $(ASTTOPDIR)/menuselect.makedeps
Merged revisions 93180 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r93180 | kpfleming | 2007-12-16 22:44:51 -0800 (Sun, 16 Dec 2007) | 23 lines In http://lists.digium.com/pipermail/asterisk-dev/2007-December/031145.html, rizzo brought up some issues related to the way that the metadata required for menuselect and the rest of the build system is extracted from the source files. Since I had a few hours to kill on an airplane today, I decided to improve this situation... so now the system caches the extracted metadata and uses it to build the menuselect 'tree' as much as it can. The result of this is that when a single source file is changed, only the metadata for that file needs to be extracted again, and the rest is used from the cache files. I also reduced the number of forked processes required to do the metadata extraction; it was actually possible to do most of what we needed in the Makefiles themselves without using any shell scripts at all! On my laptop, these changes resulted in an 80% decrease in the time required for the 'menuselect.makeopts' automatic check to occur after editing a single source file. While doing this work I also cleaned up a few minor things in the Makefiles, adding a check for 'awk' to the configure script and changed all remaining places we use 'grep' or 'awk' to use the ones found by the configure script, and changed the 'prep_tarball' script to build the menuselect metadata so that tarballs of Asterisk will include it and won't require the user to wait while it is extracted after unpacking. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 07:25:35 +00:00
MODULE_PREFIX=codec
MENUSELECT_CATEGORY=CODECS
MENUSELECT_DESCRIPTION=Codec Translators
SUB_GSM := gsm
SUB_ILBC := ilbc
LIBILBC := $(SUB_ILBC)/libilbc.a
SUB_LPC10 := lpc10
LIBLPC10 := $(SUB_LPC10)/liblpc10.a
SUB_DIRS := \
$(SUB_GSM) \
$(SUB_ILBC) \
$(SUB_LPC10) \
all: _all
include $(ASTTOPDIR)/Makefile.moddir_rules
ifneq ($(GSM_INTERNAL),no)
GSM_INCLUDE := -I$(SUB_GSM)/inc
codec_gsm.so: $(SUB_GSM)/lib/libgsm.a
endif
# Don't run the implicit rules for this target.
$(SUB_GSM)/lib/libgsm.a: $(SUB_GSM) ;
$(SUB_GSM):
@mkdir -p $(SUB_GSM)/lib
@$(MAKE) -C $(SUB_GSM) lib/libgsm.a
clean::
for dir in $(SUB_DIRS); do \
$(MAKE) -C $$dir clean; \
done
.PHONY: $(SUB_DIRS)
codec_lpc10.so: $(LIBLPC10)
# Don't run the implicit rules for this target.
$(LIBLPC10): $(SUB_LPC10) ;
$(SUB_LPC10):
@$(MAKE) -C $(SUB_LPC10) all
ifneq ($(ILBC_INTERNAL),no)
codec_ilbc.so: $(LIBILBC)
else
ILBC_INCLUDE += -DILBC_WEBRTC
endif
# Don't run the implicit rules for this target.
$(LIBILBC): $(SUB_ILBC) ;
$(SUB_ILBC):
@$(MAKE) -C $(SUB_ILBC) all _ASTCFLAGS="$(filter-out -Wmissing-prototypes -Wmissing-declarations -Wshadow,$(_ASTCFLAGS)) $(AST_NO_STRICT_OVERFLOW)"
$(call MOD_ADD_C,codec_g722,g722/g722_encode.c g722/g722_decode.c)
ifeq ($(BUILD_CPU),x86_64)
SPEEX_RESAMPLE_CFLAGS:=-fPIC
else
SPEEX_RESAMPLE_CFLAGS:=
endif
$(call MOD_ADD_C,codec_resample,speex/resample.c)
codec_resample.o: _ASTCFLAGS+=-DOUTSIDE_SPEEX
speex/resample.o: _ASTCFLAGS+=$(SPEEX_RESAMPLE_CFLAGS) -DOUTSIDE_SPEEX -DEXPORT=