@ -13,29 +13,23 @@
# All Makefiles use the following variables:
#
# ASTCFLAGS - compiler options
# ASTLDFLAGS - linker flags (not libraries)
# ASTCFLAGS - compiler options provided by the user (if any)
# _ASTCFLAGS - compiler options provided by the build system
# ASTLDFLAGS - linker flags (not libraries) provided by the user (if any)
# _ASTLDFLAGS - linker flags (not libraries) provided by the build system
# LIBS - additional libraries, at top-level for all links,
# on a single object just for that object
# SOLINK - linker flags used only for creating shared objects (.so files),
# used for all .so links
#
# Initial v alues for ASTCFLAGS and ASTLDFLAGS can be specified in the
# V alues for ASTCFLAGS and ASTLDFLAGS can be specified in the
# environment when running make, as follows:
#
# $ ASTCFLAGS="-Werror" make ...
#
# note that this is different from
# or as a variable value on the make command line itself:
#
# $ make ASTCFLAGS="-Werror" ...
#
# If you need to pass compiler/linker flags as 'make' variables, please use
#
# $ make COPTS="..." LDOPTS="..." ...
#
#
# You can add the path of local module subdirs from the command line with
# make LOCAL_MOD_SUBDIRS= ....
export A S T T O P D I R # Top level dir, used in subdirs' Makefiles
export ASTERISKVERSION
@ -171,7 +165,7 @@ HTTP_DOCSDIR=/var/www/html
HTTP_CGIDIR = /var/www/cgi-bin
# Uncomment this to use the older DSP routines
# ASTCFLAGS+=-DOLD_DSP_ROUTINES
# _ ASTCFLAGS+=-DOLD_DSP_ROUTINES
# If the file .asterisk.makeopts is present in your home directory, you can
# include all of your favorite menuselect options so that every time you download
@ -221,59 +215,59 @@ ifeq ($(OSARCH),linux-gnu)
endif
e n d i f
i f e q ( $( findstring -save -temps ,$ ( ASTCFLAGS) ) , )
ifeq ( $( findstring -pipe,$( ASTCFLAGS) ) ,)
ASTCFLAGS+= -pipe
i f e q ( $( findstring -save -temps ,$ ( _ASTCFLAGS) $ ( ASTCFLAGS) ) , )
ifeq ( $( findstring -pipe,$( _ASTCFLAGS) $( ASTCFLAGS) ) ,)
_ ASTCFLAGS+= -pipe
endif
e n d i f
i f e q ( $( findstring -Wall ,$ ( ASTCFLAGS) ) , )
ASTCFLAGS+= -Wall
i f e q ( $( findstring -Wall ,$ ( _ASTCFLAGS) $ ( ASTCFLAGS) ) , )
_ ASTCFLAGS+= -Wall
e n d i f
ASTCFLAGS+= -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $( DEBUG)
_ ASTCFLAGS+= -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $( DEBUG)
i f e q ( $( AST_DEVMODE ) , y e s )
ASTCFLAGS+= -Werror
ASTCFLAGS+= -Wunused
ASTCFLAGS+= $( AST_DECLARATION_AFTER_STATEMENT)
ASTCFLAGS+= $( AST_FORTIFY_SOURCE)
ASTCFLAGS+= -Wundef
ASTCFLAGS+= -Wmissing-format-attribute
ASTCFLAGS+= -Wformat= 2
_ ASTCFLAGS+= -Werror
_ ASTCFLAGS+= -Wunused
_ ASTCFLAGS+= $( AST_DECLARATION_AFTER_STATEMENT)
_ ASTCFLAGS+= $( AST_FORTIFY_SOURCE)
_ ASTCFLAGS+= -Wundef
_ ASTCFLAGS+= -Wmissing-format-attribute
_ ASTCFLAGS+= -Wformat= 2
e n d i f
i f n e q ( $( findstring BSD ,$ ( OSARCH ) ) , )
ASTCFLAGS+= -I/usr/local/include
ASTLDFLAGS+= -L/usr/local/lib
_ ASTCFLAGS+= -I/usr/local/include
_ ASTLDFLAGS+= -L/usr/local/lib
e n d i f
i f e q ( $( findstring -march ,$ ( ASTCFLAGS) ) , )
i f e q ( $( findstring -march ,$ ( _ASTCFLAGS) $ ( ASTCFLAGS) ) , )
ifneq ( $( PROC) ,ultrasparc)
ASTCFLAGS+= $( shell if $( CC) -march= $( PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>& 1; then echo " -march= $( PROC) " ; fi )
_ ASTCFLAGS+= $( shell if $( CC) -march= $( PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>& 1; then echo " -march= $( PROC) " ; fi )
endif
e n d i f
i f e q ( $( PROC ) , p p c )
ASTCFLAGS+= -fsigned-char
_ ASTCFLAGS+= -fsigned-char
e n d i f
i f e q ( $( OSARCH ) , F r e e B S D )
# -V is understood by BSD Make, not by GNU make.
BSDVERSION = $( shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
ASTCFLAGS+= $( shell if test $( BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE" ; fi )
_ ASTCFLAGS+= $( shell if test $( BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE" ; fi )
e n d i f
i f e q ( $( OSARCH ) , N e t B S D )
ASTCFLAGS+= -pthread -I/usr/pkg/include
_ ASTCFLAGS+= -pthread -I/usr/pkg/include
e n d i f
i f e q ( $( OSARCH ) , O p e n B S D )
ASTCFLAGS+= -pthread
_ ASTCFLAGS+= -pthread
e n d i f
i f e q ( $( OSARCH ) , S u n O S )
ASTCFLAGS+= -Wcast-align -DSOLARIS -I../include/solaris-compat -I/opt/ssl/include -I/usr/local/ssl/include -D_XPG4_2
_ ASTCFLAGS+= -Wcast-align -DSOLARIS -I../include/solaris-compat -I/opt/ssl/include -I/usr/local/ssl/include -D_XPG4_2
e n d i f
ASTERISKVERSION := $( shell GREP = $( GREP) AWK = $( AWK) build_tools/make_version .)
@ -286,9 +280,7 @@ ifneq ($(wildcard .svn),)
ASTERISKVERSIONNUM:= 999999
e n d i f
# XXX MALLOC_DEBUG is probably unused, Makefile.moddir_rules adds the
# value directly to ASTCFLAGS
ASTCFLAGS += $( MALLOC_DEBUG) $( OPTIONS)
_ASTCFLAGS += $( OPTIONS)
MOD_SUBDIRS := channels pbx apps codecs formats cdr funcs tests main res $( LOCAL_MOD_SUBDIRS)
OTHER_SUBDIRS := utils agi
@ -303,7 +295,7 @@ MOD_SUBDIRS_EMBED_LIBS:=$(MOD_SUBDIRS:%=%-embed-libs)
MOD_SUBDIRS_MENUSELECT_TREE := $( MOD_SUBDIRS:%= %-menuselect-tree)
i f n e q ( $( findstring darwin ,$ ( OSARCH ) ) , )
ASTCFLAGS+= -D__Darwin__
_ ASTCFLAGS+= -D__Darwin__
SOLINK = -dynamic -bundle -undefined suppress -force_flat_namespace
e l s e
# These are used for all but Darwin
@ -404,10 +396,10 @@ res: main
e n d i f
$(MOD_SUBDIRS) :
+ @ASTCFLAGS= " $( MOD_SUBDIR_CFLAGS) $( ASTCFLAGS) " ASTLDFLAGS = " $( ASTLD FLAGS) " $( SUBMAKE) --no-builtin-rules -C $@ SUBDIR = $@ all
@_ ASTCFLAGS= " $( MOD_SUBDIR_CFLAGS) $( _ ASTCFLAGS) " $( SUBMAKE) --no-builtin-rules -C $@ SUBDIR = $@ all
$(OTHER_SUBDIRS) :
+ @ASTCFLAGS= " $( OTHER_SUBDIR_CFLAGS) $( ASTCFLAGS) " ASTLDFLAGS = " $( ASTLD FLAGS) " $( SUBMAKE) --no-builtin-rules -C $@ SUBDIR = $@ all
@_ ASTCFLAGS= " $( OTHER_SUBDIR_CFLAGS) $( _ ASTCFLAGS) " $( SUBMAKE) --no-builtin-rules -C $@ SUBDIR = $@ all
defaults.h : makeopts
@build_tools/make_defaults_h > $@ .tmp
@ -465,7 +457,7 @@ distclean: $(SUBDIRS_DIST_CLEAN) _clean
rm -f build_tools/menuselect-deps
datafiles : _all
if [ x` $( ID) -un` = xroot ] ; then CFLAGS = " $( ASTCFLAGS) " bash build_tools/mkpkgconfig $( DESTDIR) /usr/lib/pkgconfig; fi
if [ x` $( ID) -un` = xroot ] ; then CFLAGS = " $( _ASTCFLAGS) $( ASTCFLAGS) " bash build_tools/mkpkgconfig $( DESTDIR) /usr/lib/pkgconfig; fi
# Should static HTTP be installed during make samples or even with its own target ala
# webvoicemail? There are portions here that *could* be customized but might also be
# improved a lot. I'll put it here for now.