2006-07-06 23:20:14 +00:00
|
|
|
#
|
2012-10-18 14:17:40 +00:00
|
|
|
# Asterisk -- An open source telephony toolkit.
|
2006-07-06 23:20:14 +00:00
|
|
|
#
|
|
|
|
# Makefile rules
|
|
|
|
#
|
2010-04-02 18:57:58 +00:00
|
|
|
# Copyright (C) 2006-2010, Digium, Inc.
|
2006-07-06 23:20:14 +00:00
|
|
|
#
|
|
|
|
# Kevin P. Fleming <kpfleming@digium.com>
|
|
|
|
#
|
|
|
|
# This program is free software, distributed under the terms of
|
|
|
|
# the GNU General Public License
|
|
|
|
#
|
|
|
|
|
2006-07-16 22:24:39 +00:00
|
|
|
# Each command is preceded by a short comment on what to do.
|
|
|
|
# Prefixing one or the other with @\# or @ or nothing makes the desired
|
|
|
|
# behaviour. ECHO_PREFIX prefixes the comment, CMD_PREFIX prefixes the command.
|
2006-07-06 23:20:14 +00:00
|
|
|
|
2006-09-09 03:27:21 +00:00
|
|
|
-include $(ASTTOPDIR)/makeopts
|
2006-08-21 02:11:39 +00:00
|
|
|
|
2007-10-01 21:54:41 +00:00
|
|
|
.PHONY: dist-clean
|
|
|
|
|
2008-11-26 19:08:56 +00:00
|
|
|
# If 'make' decides to create intermediate files to satisfy a build requirement
|
|
|
|
# (like producing a .i from a .c), we want to keep them, so tell make to keep
|
|
|
|
# all intermediate files
|
|
|
|
.SECONDARY:
|
|
|
|
|
2007-11-05 16:41:39 +00:00
|
|
|
# extra cflags to build dependencies. Recursively expanded.
|
Merged revisions 157859 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r157859 | kpfleming | 2008-11-19 15:34:47 -0600 (Wed, 19 Nov 2008) | 7 lines
the gcc optimizer frequently finds broken code (use of uninitalized variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems.
with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course).
while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 00:08:12 +00:00
|
|
|
MAKE_DEPS=-MD -MT $@ -MF .$(subst /,_,$@).d -MP
|
2007-11-05 16:41:39 +00:00
|
|
|
|
2006-07-16 22:24:39 +00:00
|
|
|
ifeq ($(NOISY_BUILD),)
|
2007-11-05 16:41:39 +00:00
|
|
|
ECHO_PREFIX=@
|
|
|
|
CMD_PREFIX=@
|
2006-07-16 22:24:39 +00:00
|
|
|
else
|
Merged revisions 157859 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r157859 | kpfleming | 2008-11-19 15:34:47 -0600 (Wed, 19 Nov 2008) | 7 lines
the gcc optimizer frequently finds broken code (use of uninitalized variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems.
with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course).
while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 00:08:12 +00:00
|
|
|
ECHO_PREFIX=@\#
|
2007-11-05 16:41:39 +00:00
|
|
|
CMD_PREFIX=
|
2006-07-16 22:24:39 +00:00
|
|
|
endif
|
2006-07-06 23:20:14 +00:00
|
|
|
|
2014-03-02 17:03:56 +00:00
|
|
|
OPTIMIZE?=-O3
|
2010-03-09 20:30:03 +00:00
|
|
|
ifneq ($(findstring darwin,$(OSARCH)),)
|
2011-09-19 20:31:09 +00:00
|
|
|
ifeq ($(shell if test `/usr/bin/sw_vers -productVersion | cut -c4` -gt 5; then echo 6; else echo 0; fi),6)
|
|
|
|
# Snow Leopard/Lion has an issue with this optimization flag on large files (like chan_sip)
|
2010-03-09 20:30:03 +00:00
|
|
|
OPTIMIZE+=-fno-inline-functions
|
|
|
|
endif
|
|
|
|
endif
|
Merged revisions 157859 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r157859 | kpfleming | 2008-11-19 15:34:47 -0600 (Wed, 19 Nov 2008) | 7 lines
the gcc optimizer frequently finds broken code (use of uninitalized variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems.
with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course).
while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 00:08:12 +00:00
|
|
|
|
2010-07-27 21:16:39 +00:00
|
|
|
ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS))$(AST_CODE_COVERAGE),no)
|
2009-07-21 13:28:04 +00:00
|
|
|
_ASTCFLAGS+=$(OPTIMIZE)
|
2009-09-28 19:11:20 +00:00
|
|
|
else
|
|
|
|
_ASTCFLAGS+=-O0
|
2006-08-21 02:11:39 +00:00
|
|
|
endif
|
|
|
|
|
2010-07-27 21:16:39 +00:00
|
|
|
ifeq ($(AST_CODE_COVERAGE),yes)
|
|
|
|
_ASTCFLAGS+=-ftest-coverage -fprofile-arcs
|
|
|
|
_ASTLDFLAGS+=-ftest-coverage -fprofile-arcs
|
|
|
|
endif
|
|
|
|
|
2010-06-08 15:41:23 +00:00
|
|
|
ifeq ($(findstring $(CONFIG_CFLAGS),$(_ASTCFLAGS)),)
|
|
|
|
_ASTCFLAGS+=$(CONFIG_CFLAGS)
|
|
|
|
endif
|
|
|
|
|
Merged revisions 157859 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r157859 | kpfleming | 2008-11-19 15:34:47 -0600 (Wed, 19 Nov 2008) | 7 lines
the gcc optimizer frequently finds broken code (use of uninitalized variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems.
with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course).
while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 00:08:12 +00:00
|
|
|
# shortcuts for common combinations of flags; these must be recursively expanded so that
|
|
|
|
# per-target settings will be applied
|
2009-07-21 13:28:04 +00:00
|
|
|
CC_CFLAGS=$(PTHREAD_CFLAGS) $(_ASTCFLAGS) $(ASTCFLAGS)
|
|
|
|
CXX_CFLAGS=$(PTHREAD_CFLAGS) $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(AST_DECLARATION_AFTER_STATEMENT),$(_ASTCFLAGS) $(ASTCFLAGS))
|
2009-03-18 02:21:23 +00:00
|
|
|
|
|
|
|
ifeq ($(GNU_LD),1)
|
2010-04-08 16:35:10 +00:00
|
|
|
SO_SUPPRESS_SYMBOLS=-Wl,--version-script,$(subst .so,.exports,$@),--warn-common
|
2009-11-30 16:53:10 +00:00
|
|
|
ifneq ($(wildcard $(subst .so,.dynamics,$@)),)
|
|
|
|
SO_SUPPRESS_SYMBOLS+=-Wl,--dynamic-list,$(subst .so,.dynamics,$@)
|
|
|
|
endif
|
2009-03-18 02:21:23 +00:00
|
|
|
endif
|
|
|
|
|
2009-07-21 13:28:04 +00:00
|
|
|
CC_LDFLAGS_SO=$(PTHREAD_CFLAGS) $(_ASTLDFLAGS) $(SOLINK) $(SO_SUPPRESS_SYMBOLS) $(ASTLDFLAGS)
|
|
|
|
CXX_LDFLAGS_SO=$(PTHREAD_CFLAGS) $(_ASTLDFLAGS) $(SOLINK) $(SO_SUPPRESS_SYMBOLS) $(ASTLDFLAGS)
|
Merged revisions 157859 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r157859 | kpfleming | 2008-11-19 15:34:47 -0600 (Wed, 19 Nov 2008) | 7 lines
the gcc optimizer frequently finds broken code (use of uninitalized variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems.
with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course).
while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 00:08:12 +00:00
|
|
|
CC_LIBS=$(PTHREAD_LIBS) $(LIBS)
|
|
|
|
CXX_LIBS=$(PTHREAD_LIBS) $(LIBS)
|
|
|
|
|
|
|
|
# determine whether to double-compile so that the optimizer can report code path problems
|
|
|
|
# this is only done when developer mode and DONT_OPTIMIZE are both enabled
|
|
|
|
# in that case, we run the preprocessor to produce a .i or .ii file from the source
|
|
|
|
# code, then compile once with optimizer enabled (and the output to /dev/null),
|
|
|
|
# and if that doesn't fail then compile again with optimizer disabled
|
|
|
|
ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS))$(AST_DEVMODE),DONT_OPTIMIZEyes)
|
|
|
|
COMPILE_DOUBLE=yes
|
2014-06-22 18:53:26 +00:00
|
|
|
else
|
|
|
|
_ASTCFLAGS+=$(AST_FORTIFY_SOURCE)
|
Merged revisions 157859 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r157859 | kpfleming | 2008-11-19 15:34:47 -0600 (Wed, 19 Nov 2008) | 7 lines
the gcc optimizer frequently finds broken code (use of uninitalized variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems.
with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course).
while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 00:08:12 +00:00
|
|
|
endif
|
|
|
|
|
2012-04-12 15:25:47 +00:00
|
|
|
ifeq ($(findstring BUILD_NATIVE,$(MENUSELECT_CFLAGS)),BUILD_NATIVE)
|
|
|
|
_ASTCFLAGS+=-march=native
|
|
|
|
endif
|
|
|
|
|
Merged revisions 157859 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r157859 | kpfleming | 2008-11-19 15:34:47 -0600 (Wed, 19 Nov 2008) | 7 lines
the gcc optimizer frequently finds broken code (use of uninitalized variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems.
with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course).
while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 00:08:12 +00:00
|
|
|
%.o: %.s
|
|
|
|
$(ECHO_PREFIX) echo " [AS] $< -> $@"
|
|
|
|
ifeq ($(COMPILE_DOUBLE),yes)
|
2012-02-28 14:47:23 +00:00
|
|
|
$(CMD_PREFIX) $(CC) -o /dev/null -c $< $(CC_CFLAGS) $(OPTIMIZE)
|
Merged revisions 157859 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r157859 | kpfleming | 2008-11-19 15:34:47 -0600 (Wed, 19 Nov 2008) | 7 lines
the gcc optimizer frequently finds broken code (use of uninitalized variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems.
with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course).
while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 00:08:12 +00:00
|
|
|
endif
|
|
|
|
$(CMD_PREFIX) $(CC) -o $@ -c $< $(CC_CFLAGS)
|
|
|
|
|
2007-02-22 02:36:00 +00:00
|
|
|
%.o: %.i
|
2007-11-05 16:41:39 +00:00
|
|
|
$(ECHO_PREFIX) echo " [CCi] $< -> $@"
|
Merged revisions 157859 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r157859 | kpfleming | 2008-11-19 15:34:47 -0600 (Wed, 19 Nov 2008) | 7 lines
the gcc optimizer frequently finds broken code (use of uninitalized variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems.
with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course).
while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 00:08:12 +00:00
|
|
|
ifeq ($(COMPILE_DOUBLE),yes)
|
2012-02-28 14:47:23 +00:00
|
|
|
$(CMD_PREFIX) $(CC) -o /dev/null -c $< $(CC_CFLAGS) $(OPTIMIZE)
|
Merged revisions 157859 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r157859 | kpfleming | 2008-11-19 15:34:47 -0600 (Wed, 19 Nov 2008) | 7 lines
the gcc optimizer frequently finds broken code (use of uninitalized variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems.
with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course).
while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 00:08:12 +00:00
|
|
|
endif
|
|
|
|
$(CMD_PREFIX) $(CC) -o $@ -c $< $(CC_CFLAGS)
|
2007-02-22 02:36:00 +00:00
|
|
|
|
2008-11-26 19:08:56 +00:00
|
|
|
ifneq ($(COMPILE_DOUBLE),yes)
|
2008-11-15 19:51:29 +00:00
|
|
|
%.o: %.c
|
|
|
|
$(ECHO_PREFIX) echo " [CC] $< -> $@"
|
2009-07-21 13:28:04 +00:00
|
|
|
$(CMD_PREFIX) $(CC) -o $@ -c $< $(MAKE_DEPS) $(CC_CFLAGS)
|
Merged revisions 157859 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r157859 | kpfleming | 2008-11-19 15:34:47 -0600 (Wed, 19 Nov 2008) | 7 lines
the gcc optimizer frequently finds broken code (use of uninitalized variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems.
with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course).
while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 00:08:12 +00:00
|
|
|
endif
|
2008-11-15 19:51:29 +00:00
|
|
|
|
2007-02-22 02:36:00 +00:00
|
|
|
%.i: %.c
|
2007-11-05 16:41:39 +00:00
|
|
|
$(ECHO_PREFIX) echo " [CPP] $< -> $@"
|
2009-07-21 13:28:04 +00:00
|
|
|
$(CMD_PREFIX) $(CC) -o $@ -E $< $(MAKE_DEPS) $(CC_CFLAGS)
|
2007-02-22 02:36:00 +00:00
|
|
|
|
Merged revisions 157859 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r157859 | kpfleming | 2008-11-19 15:34:47 -0600 (Wed, 19 Nov 2008) | 7 lines
the gcc optimizer frequently finds broken code (use of uninitalized variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems.
with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course).
while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 00:08:12 +00:00
|
|
|
%.oo: %.ii
|
|
|
|
$(ECHO_PREFIX) echo " [CXXi] $< -> $@"
|
|
|
|
ifeq ($(COMPILE_DOUBLE),yes)
|
2012-02-28 14:47:23 +00:00
|
|
|
$(CMD_PREFIX) $(CXX) -o /dev/null -c $< $(CXX_CFLAGS) $(OPTIMIZE)
|
Merged revisions 157859 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r157859 | kpfleming | 2008-11-19 15:34:47 -0600 (Wed, 19 Nov 2008) | 7 lines
the gcc optimizer frequently finds broken code (use of uninitalized variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems.
with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course).
while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 00:08:12 +00:00
|
|
|
endif
|
|
|
|
$(CMD_PREFIX) $(CXX) -o $@ -c $< $(CXX_CFLAGS)
|
2007-01-03 03:28:12 +00:00
|
|
|
|
2008-11-26 19:08:56 +00:00
|
|
|
ifneq ($(COMPILE_DOUBLE),yes)
|
2006-09-29 22:48:43 +00:00
|
|
|
%.oo: %.cc
|
|
|
|
$(ECHO_PREFIX) echo " [CXX] $< -> $@"
|
2009-07-21 13:28:04 +00:00
|
|
|
$(CMD_PREFIX) $(CXX) -o $@ -c $< $(MAKE_DEPS) $(CXX_CFLAGS)
|
Merged revisions 157859 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r157859 | kpfleming | 2008-11-19 15:34:47 -0600 (Wed, 19 Nov 2008) | 7 lines
the gcc optimizer frequently finds broken code (use of uninitalized variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems.
with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course).
while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 00:08:12 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
%.ii: %.cc
|
|
|
|
$(ECHO_PREFIX) echo " [CPP] $< -> $@"
|
2009-07-21 13:28:04 +00:00
|
|
|
$(CMD_PREFIX) $(CXX) -o $@ -E $< $(MAKE_DEPS) $(CXX_CFLAGS)
|
2006-07-06 23:20:14 +00:00
|
|
|
|
2006-09-29 22:48:43 +00:00
|
|
|
%.so: %.o
|
2010-04-02 18:57:58 +00:00
|
|
|
ifeq ($(GNU_LD),1)
|
2010-04-08 16:35:10 +00:00
|
|
|
$(CMD_PREFIX) $(ASTTOPDIR)/build_tools/make_linker_version_script $* "$(LINKER_SYMBOL_PREFIX)" "$(ASTTOPDIR)"
|
2010-04-02 18:57:58 +00:00
|
|
|
endif
|
2006-09-29 22:48:43 +00:00
|
|
|
$(ECHO_PREFIX) echo " [LD] $^ -> $@"
|
Merged revisions 157859 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r157859 | kpfleming | 2008-11-19 15:34:47 -0600 (Wed, 19 Nov 2008) | 7 lines
the gcc optimizer frequently finds broken code (use of uninitalized variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems.
with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course).
while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 00:08:12 +00:00
|
|
|
$(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(CC_LDFLAGS_SO) $^ $(CC_LIBS)
|
2006-07-06 23:20:14 +00:00
|
|
|
|
2007-01-03 03:28:12 +00:00
|
|
|
%.so: %.oo
|
2010-04-02 18:57:58 +00:00
|
|
|
ifeq ($(GNU_LD),1)
|
2010-04-08 16:35:10 +00:00
|
|
|
$(CMD_PREFIX) $(ASTTOPDIR)/build_tools/make_linker_version_script $* "$(LINKER_SYMBOL_PREFIX)" "$(ASTTOPDIR)"
|
2010-04-02 18:57:58 +00:00
|
|
|
endif
|
2006-09-29 22:48:43 +00:00
|
|
|
$(ECHO_PREFIX) echo " [LDXX] $^ -> $@"
|
Merged revisions 157859 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r157859 | kpfleming | 2008-11-19 15:34:47 -0600 (Wed, 19 Nov 2008) | 7 lines
the gcc optimizer frequently finds broken code (use of uninitalized variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems.
with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course).
while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 00:08:12 +00:00
|
|
|
$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(CXX_LDFLAGS_SO) $^ $(CXX_LIBS)
|
2006-07-06 23:20:14 +00:00
|
|
|
|
2007-02-22 02:36:00 +00:00
|
|
|
%.eo: %.o
|
|
|
|
$(ECHO_PREFIX) echo " [EMBED] $< -> $@"
|
|
|
|
$(CMD_PREFIX) $(ASTTOPDIR)/build_tools/make_linker_eo_script $* > .$@.ld
|
|
|
|
$(CMD_PREFIX) $(LD) -r -T .$@.ld -o $@ $<
|
|
|
|
$(CMD_PREFIX) rm -f .$@.ld
|
|
|
|
|
2007-11-17 17:27:26 +00:00
|
|
|
%.eo: %.oo
|
2007-02-22 02:36:00 +00:00
|
|
|
$(ECHO_PREFIX) echo " [EMBED] $< -> $@"
|
|
|
|
$(CMD_PREFIX) $(ASTTOPDIR)/build_tools/make_linker_eo_script $* > .$@.ld
|
|
|
|
$(CMD_PREFIX) $(LD) -r -T .$@.ld -o $@ $<
|
|
|
|
$(CMD_PREFIX) rm -f .$@.ld
|
|
|
|
|
2006-09-29 22:48:43 +00:00
|
|
|
%: %.o
|
|
|
|
$(ECHO_PREFIX) echo " [LD] $^ -> $@"
|
2009-07-21 13:28:04 +00:00
|
|
|
$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(PTHREAD_CFLAGS) $(_ASTLDFLAGS) $^ $(CXX_LIBS) $(ASTLDFLAGS)
|
2007-10-01 21:54:41 +00:00
|
|
|
|
2008-11-15 19:45:19 +00:00
|
|
|
dist-clean:: clean
|