I have some problem adding specific rules to an autotools project.
I have this small exemple project :
project/configure.ac :
AC_INIT([myprog], [0.1], [[email protected]])
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
AM_EXTRA_RECURSIVE_TARGETS([quality])
AC_PROG_CC
AC_SUBST([AM_CFLAGS])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT
project/Makefile.am:
SUBDIRS = src
project/src/Makefile.am:
bin_PROGRAMS= myprog
myprog_SOURCES = myprog.c
QUALITYDIR=$(builddir)/quality
QUALITY_FILE="$(QUALITYDIR)/quality.log"
quality-local: $(QUALITY_FILE)
$(QUALITY_FILE): myprog
mkdir -p $(QUALITYDIR)
valgrind ./myprog 2>&1 | tee $(QUALITY_FILE)
CLEANFILES = $(QUALITY_FILE)
Each time I do :
$ make quality
the valgrind stuff is run, even if "myprog" has not been rebuilt. I expect it shall only be executed when myprog is younger than the quality.log file in build/src/quality .
What do I do wrong ?