Lars Hecking <[EMAIL PROTECTED]> writes: > === Running test ./target-cflags.test > automake: Makefile.am: installing `./compile' > creating cache ./config.cache [...] > creating ./config.status > creating Makefile > gcc -DPACKAGE=\"target-cflags\" -DVERSION=\"0.0\" -I. -I.. -DFOO -g -O2 -c -o >foo-foo.o `test -f foo.c || echo '../'`foo.c > gcc -g -O2 -o foo foo-foo.o > gcc -DPACKAGE=\"target-cflags\" -DVERSION=\"0.0\" -I. -I.. -g -O2 -c ../bar.c > gcc -g -O2 -o bar bar.o I'm surprised Make doesn't speak here. Reading the test files, GNU Make is required, and GNU Make is usually verbose. In my case I have: config.status: creating Makefile make[3]: Entering directory `/mnt/nostromo/home/lrde/prof/akim/src/am/tests/testSubDir/obj' gcc -DPACKAGE=\"target-cflags\" -DVERSION=\"0.0\" -I. -I.. -DFOO -g -O2 -c -o foo-foo.o `test -f foo.c || echo '../'`foo.c gcc -g -O2 -o foo foo-foo.o gcc -DPACKAGE=\"target-cflags\" -DVERSION=\"0.0\" -I. -I.. -g -O2 -c ../bar.c gcc -g -O2 -o bar bar.o make[3]: Leaving directory `/mnt/nostromo/home/lrde/prof/akim/src/am/tests/testSubDir/obj' Could you srcdir=. VERBOSE=yes sh -x ./target-cflags.test ? > creating cache ./config.cache [...] > creating Makefile > ./target-cflags.test[51]: ./foo: not found Hm, in my case something is rebuilt. Maybe this version of the file would make it easier to track
#! /bin/sh # Test to make sure target specific CFLAGS work # Assar Westerlund <[EMAIL PROTECTED]> . $srcdir/defs || exit 1 cat > configure.in << 'END' AC_INIT(foo.c) AM_INIT_AUTOMAKE(target-cflags,0.0) AC_PROG_CC AC_OUTPUT(Makefile) END cat > Makefile.am << 'END' AUTOMAKE_OPTIONS = foreign no-dependencies bin_PROGRAMS = foo bar foo_CFLAGS = -DFOO END cat > foo.c << 'END' #include <stdio.h> #ifdef FOO int main(void) { return 0; } #endif END cat > bar.c << 'END' #ifndef FOO int main(void) { return 0; } #endif END # Fail gracefully if no autoconf. $needs_autoconf # Likewise for gcc. (gcc -v) > /dev/null 2>&1 || exit 77 # Likewise for GNU make. ($MAKE --version) > /dev/null 2>&1 || exit 77 set -e $ACLOCAL $AUTOCONF $AUTOMAKE -a mkdir obj ( cd obj ../configure $MAKE /foo ./bar ) ./configure $MAKE ./foo ./bar