@ -11,6 +11,7 @@
# the GNU General Public License
# the GNU General Public License
#
#
# Rules for various build phases.
# Each command is preceded by a short comment on what to do.
# Each command is preceded by a short comment on what to do.
# Prefixing one or the other with @\# or @ or nothing makes the desired
# Prefixing one or the other with @\# or @ or nothing makes the desired
# behaviour. ECHO_PREFIX prefixes the comment, CMD_PREFIX prefixes the command.
# behaviour. ECHO_PREFIX prefixes the comment, CMD_PREFIX prefixes the command.
@ -19,52 +20,48 @@
.PHONY : dist -clean
.PHONY : dist -clean
# extra cflags to build dependencies. Recursively expanded.
_CFLAGS2 = -MMD -MT $@ -MF .$( subst /,_,$@ ) .d -MP
i f e q ( $( NOISY_BUILD ) , )
i f e q ( $( NOISY_BUILD ) , )
ECHO_PREFIX = @
ECHO_PREFIX = @
CMD_PREFIX = @
CMD_PREFIX = @
e l s e
e l s e
ECHO_PREFIX = @\#
ECHO_PREFIX = @\#
CMD_PREFIX =
CMD_PREFIX =
e n d i f
e n d i f
i f e q ( $( findstring DONT_OPTIMIZE ,$ ( MENUSELECT_CFLAGS ) ) , )
i f e q ( $( findstring DONT_OPTIMIZE ,$ ( MENUSELECT_CFLAGS ) ) , )
# More GSM codec optimization
# More GSM codec optimization
# Uncomment to enable MMXTM optimizations for x86 architecture CPU's
# Uncomment to enable MMXTM optimizations for x86 architecture CPU's
# which support MMX instructions. This should be newer pentiums,
# which support MMX instructions. This should be newer pentiums,
# ppro's, etc, as well as the AMD K6 and K7.
# ppro's, etc, as well as the AMD K6 and K7.
#K6OPT=-DK6OPT
#K6OPT=-DK6OPT
OPTIMIZE ? =-O6
OPTIMIZE? =-O6
ASTCFLAGS += $( OPTIMIZE)
ASTCFLAGS += $( OPTIMIZE)
e n d i f
e n d i f
# build rules for various targets
%.o : %.c
%.o : %.c
$( ECHO_PREFIX) echo " [CC] $< -> $@ "
$( ECHO_PREFIX) echo " [CC] $< -> $@ "
$( CMD_PREFIX) $( CC) -o $@ -c $< $( PTHREAD_CFLAGS) $( ASTCFLAGS) -MMD -MT $@ -MF .$( subst /,_,$@ ) .d -MP
$( CMD_PREFIX) $( CC) -o $@ -c $< $( PTHREAD_CFLAGS) $( ASTCFLAGS) $( _CFLAGS2)
%.o : %.i
%.o : %.i
$( ECHO_PREFIX) echo " [CC] $< -> $@ "
$( ECHO_PREFIX) echo " [CCi] $< -> $@ "
i f e q ( $( AST_DEVMODE ) , y e s )
$( CMD_PREFIX) $( CC) -o $@ -c $< $( PTHREAD_CFLAGS) $( ASTCFLAGS) $( _CFLAGS2)
$( CMD_PREFIX) $( CC) -o $@ -c $< $( PTHREAD_CFLAGS) $( ASTCFLAGS) -MMD -MT $@ -MF .$( subst /,_,$@ ) .d -MP
e l s e
$( CMD_PREFIX) $( CC) -o $@ -c $< $( PTHREAD_CFLAGS) $( ASTCFLAGS)
e n d i f
%.i : %.c
%.i : %.c
$( ECHO_PREFIX) echo " [CC] $< -> $@ "
$( ECHO_PREFIX) echo " [CPP] $< -> $@ "
i f e q ( $( AST_DEVMODE ) , y e s )
$( CMD_PREFIX) $( CC) -o $@ -E $< $( PTHREAD_CFLAGS) $( ASTCFLAGS) $( _CFLAGS2)
$( CMD_PREFIX) $( CC) -o $@ -E $< $( PTHREAD_CFLAGS) $( ASTCFLAGS) -MMD -MT $@ -MF .$( subst /,_,$@ ) .d -MP
e l s e
$( CMD_PREFIX) $( CC) -o $@ -E $< $( PTHREAD_CFLAGS) $( ASTCFLAGS)
e n d i f
%.o : %.s
%.o : %.s
$( ECHO_PREFIX) echo " [AS] $< -> $@ "
$( ECHO_PREFIX) echo " [AS] $< -> $@ "
$( CMD_PREFIX) $( CC) -o $@ -c $< $( PTHREAD_CFLAGS) $( ASTCFLAGS) -MMD -MT $@ -MF .$( subst /,_,$@ ) .d -MP
$( CMD_PREFIX) $( CC) -o $@ -c $< $( PTHREAD_CFLAGS) $( ASTCFLAGS) $( _CFLAGS2)
%.oo : %.cc
%.oo : %.cc
$( ECHO_PREFIX) echo " [CXX] $< -> $@ "
$( ECHO_PREFIX) echo " [CXX] $< -> $@ "
$( CMD_PREFIX) $( CXX) -o $@ -c $< $( PTHREAD_CFLAGS) $( filter-out -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations,$( ASTCFLAGS) ) -MMD -MT $@ -MF .$( subst /,_,$@ ) .d -MP
$( CMD_PREFIX) $( CXX) -o $@ -c $< $( PTHREAD_CFLAGS) $( filter-out -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations,$( ASTCFLAGS) ) $( _CFLAGS2)
%.c : %.y
%.c : %.y
$( ECHO_PREFIX) echo " [BISON] $< -> $@ "
$( ECHO_PREFIX) echo " [BISON] $< -> $@ "