autotools:如何处理configure生成的源码?

时间:2016-10-25 08:35:06

标签: build dependencies autotools autoconf automake

让我们设想一个具有以下结构的最小项目:

|-- 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.pyrm正在运行{/ 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

0 个答案:

没有答案