conditional suffix rules do not work

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

conditional suffix rules do not work

Ralf Wildenhues
Hi there,

It is not possible to override an internal suffix rule within an
Automake conditional.  Automake puts the conditional marker only on the
first line of the self-output rule.

Regards,
Ralf

touch foo.c
cat >configure.ac <<EOF
AC_INIT(a,1,b)
AM_INIT_AUTOMAKE(foreign)
AC_PROG_CC
AM_CONDITIONAL(FOO, :)
AC_CONFIG_FILES(Makefile)
AC_OUTPUT
EOF
cat >Makefile.am <<EOF
SUFFIXES = .c .o
bin_PROGRAMS = foo
if FOO
.c.o:
        echo hi
endif
EOF
autoreconf -vif
./configure
make # error


sed -n '/^@FOO_FALSE@/,/^$/p' Makefile.in
@FOO_FALSE@.c.o:
@am__fastdepCC_TRUE@    if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@    then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@       source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@   $(COMPILE) -c $<