Newer
Older
# Asterisk -- An open source telephony toolkit.
#
# Copyright (C) 1999-2010, Digium, Inc.
Kevin P. Fleming
committed
# Mark Spencer <markster@digium.com>
#
# This program is free software, distributed under the terms of
# the GNU General Public License
#
# All Makefiles use the following variables:
#
# 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 dynamically loadable modules
# as .so files
# DYLINK - linker flags used only for creating shared libaries
# (.so files on Unix-type platforms, .dylib on Darwin)
# Values for ASTCFLAGS and ASTLDFLAGS can be specified in the
# environment when running make, as follows:
#
# or as a variable value on the make command line itself:
export ASTTOPDIR # Top level dir, used in subdirs' Makefiles
export ASTERISKVERSION
export ASTERISKVERSIONNUM
#--- values used for default paths
# DESTDIR is the staging (or final) directory where files are copied
# during the install process. Define it before 'export', otherwise
# export will set it to the empty string making ?= fail.
# Trying to run asterisk from the DESTDIR is completely unsupported
# behavior.
# WARNING: do not put spaces or comments after the value.
DESTDIR?=$(INSTALL_PATH)
export DESTDIR
export INSTALL_PATH # Additional prefix for the following paths
export ASTETCDIR # Path for config files
export ASTVARRUNDIR
export ASTSPOOLDIR
export ASTVARLIBDIR
export ASTDATADIR
export ASTLOGDIR
export ASTMODDIR
export ASTMANDIR
export ASTHEADERDIR
export ASTSBINDIR
export AGI_DIR
export ASTCONFPATH
export NOISY_BUILD # Used in Makefile.rules
export MENUSELECT_CFLAGS # Options selected in menuselect.
export AST_DEVMODE # Set to "yes" for additional compiler
# and runtime checks
export AST_DEVMODE_STRICT # Enables shadow warnings (-Wshadow)
export _SOLINK # linker flags for all shared objects
export SOLINK # linker flags for loadable modules
export DYLINK # linker flags for shared libraries
#--- paths to various commands
# The makeopts include below tries to set these if they're found during
# configure.
export CC
export CXX
export AR
export RANLIB
export HOST_CC
export INSTALL
export MD5
export LDCONFIG
export LDCONFIG_FLAGS
export TAR
export PATCH
export SED
export NM
# makeopts is required unless the goal is just {dist{-}}clean
ifeq ($(MAKECMDGOALS),clean)
else ifeq ($(MAKECMDGOALS),distclean)
else ifeq ($(MAKECMDGOALS),dist-clean)
else
include makeopts
endif
Kevin P. Fleming
committed
# start the primary CFLAGS and LDFLAGS with any that were provided
# to the configure script
George Joseph
committed
_ASTCFLAGS:=$(CONFIG_CFLAGS) $(CONFIG_SIGNED_CHAR)
Kevin P. Fleming
committed
_ASTLDFLAGS:=$(CONFIG_LDFLAGS)
# Some build systems, such as the one in openwrt, like to pass custom target
Kevin P. Fleming
committed
# CFLAGS and LDFLAGS in the COPTS and LDOPTS variables; these should also
# go before any build-system computed flags, since they are defaults, not
# overrides
_ASTCFLAGS+=$(COPTS)
_ASTLDFLAGS+=$(LDOPTS)
_ASTCFLAGS+=$(LIBXML2_INCLUDE)
# BIND_8_COMPAT
_ASTCFLAGS+=$(BIND8_CFLAGS)
#Uncomment this to see all build commands instead of 'quiet' output
#NOISY_BUILD=yes
empty:=
space:=$(empty) $(empty)
ASTTOPDIR:=$(subst $(space),\$(space),$(CURDIR))
# Overwite config files on "make samples" or other config installation targets
# Include debug and macro symbols in the executables (-g) and profiling info (-pg)
Olle Johansson
committed
# Asterisk.conf is located in ASTETCDIR or by using the -C flag
# when starting Asterisk
ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
Joshua Colp
committed
AGI_DIR=$(ASTDATADIR)/agi-bin
Olle Johansson
committed
# If you use Apache, you may determine by a grep 'DocumentRoot' of your httpd.conf file
HTTP_DOCSDIR=/var/www/html
# Determine by a grep 'ScriptAlias' of your Apache httpd.conf file
HTTP_CGIDIR=/var/www/cgi-bin
Kevin P. Fleming
committed
# If your platform's linker expects a prefix on symbols generated from compiling C
# source files, set LINKER_SYMBOL_PREFIX to that value. On some systems, exported symbols
# from C source files are prefixed with '_', for example. If this value is not set
# properly, the linker scripts that live in the '*.exports' files in various places
# in this tree will unintentionally suppress symbols that should be visible
# in the final binary objects.
LINKER_SYMBOL_PREFIX=
# Uncomment this to use the older DSP routines
#_ASTCFLAGS+=-DOLD_DSP_ROUTINES
# Default install directory for DAHDI hooks.
DAHDI_UDEV_HOOK_DIR = /usr/share/dahdi/span_config.d
# If the file .asterisk.makeopts is present in your home directory, you can
Kevin P. Fleming
committed
# include all of your favorite menuselect options so that every time you download
# a new version of Asterisk, you don't have to run menuselect to set them.
Kevin P. Fleming
committed
# The file /etc/asterisk.makeopts will also be included but can be overridden
Russell Bryant
committed
# by the file in your home directory.
Corey Farrell
committed
ifeq ($(wildcard menuselect.makeopts),)
USER_MAKEOPTS=$(wildcard ~/.asterisk.makeopts)
GLOBAL_MAKEOPTS=$(wildcard /etc/asterisk.makeopts)
else
USER_MAKEOPTS=
GLOBAL_MAKEOPTS=
endif
Kevin P. Fleming
committed
MOD_SUBDIR_CFLAGS="-I$(ASTTOPDIR)/include"
OTHER_SUBDIR_CFLAGS="-I$(ASTTOPDIR)/include"
# Create OPTIONS variable, but probably we can assign directly to ASTCFLAGS
OPTIONS=
ifeq ($(findstring -save-temps,$(_ASTCFLAGS) $(ASTCFLAGS)),)
ifeq ($(findstring -pipe,$(_ASTCFLAGS) $(ASTCFLAGS)),)
_ASTCFLAGS+=-pipe
endif
endif
ifeq ($(findstring -Wall,$(_ASTCFLAGS) $(ASTCFLAGS)),)
_ASTCFLAGS+=-Wall
_ASTCFLAGS+=-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(AST_NESTED_FUNCTIONS) $(AST_CLANG_BLOCKS) $(DEBUG)
Loading
Loading full blame...