让我们设想一个具有以下结构的最小项目:
|-- configure.ac |-- Makefile.am |-- src/ `-- ... |-- test/ `-- Makefile.am `-- test.sh `-- test.py.in
现在,test.py.in
使用autotools变量来构建test.py
。正在运行configure
会构建test.py
,我对此感到非常高兴。
但是,触摸/ 修改test.py.in
然后运行make check
应该在实际测试之前运行configure
,但事实并非如此。怎么样?
我的Makefile.am
:
check_SCRIPTS = \
test.sh \
$(NULL)
check_PROGRAMS = \
$(NULL)
testsuite_bin_SOURCES = \
$(NULL)
TESTS = \
test.sh \
$(NULL)
MOSTLYCLEANFILES = \
*.out *.err *.log \
$(NULL)
EXTRA_DIST = \
test.sh \
test.py \
$(NULL)
make check
test.py
时rm
正在运行{/ 1}}:
$ make check
make test.sh
make[1]: Entering directory `.../test'
make[1]: Nothing to be done for `test.sh'.
make[1]: Leaving directory `.../test'
make check-TESTS
make[1]: Entering directory `.../test'
*** './test.py' was not found - aborting test ***
FAIL: test.sh
=======================================
1 of 1 test failed
Please report to nobody@nohost.nodomain
=======================================
make[1]: *** [check-TESTS] Error 1
make[1]: Leaving directory `/test
make: *** [check-am] Error 2
我configure.ac
的一部分:
AC_CONFIG_FILES([
#...
test/Makefile
test/test.py
])
AC_OUTPUT