1

我正在为我的应用程序和 Autotools 实现 CPPUTEST,但在子目录中生成的最终生成文件无法进行最终构建。

文件夹结构:

|
+- Build_output: holds executable for CPPUTEST
+- Configure : holds `configure.ac` and `Makefile.am`
+- Src: contains source files that contain functions and makefile.am
+- Test: contains test file
+- build: shell script for creating executables.

快照添加:构建结构

构建结构继续

通常我会在每个配置文件保存在外部而不是配置文件夹内的地方看到自动工具的示例。

配置文件夹内的 Configure.ac:

AC_INIT([cpputest], [1.0], [])
AM_INIT_AUTOMAKE([
  -Wall -Werror foreign subdir-objects
])
AC_PROG_CXX
AC_CONFIG_FILES([
  Makefile
  ../src/Makefile
  ../test/Makefile
])
AC_OUTPUT

Makefile.am 在配置文件夹中

SUBDIRS = \
../src \
../test 

Shell 脚本存在于“构建”之外

#!/bin/sh
cd configure
autoreconf -i
./configure
make check

当我运行我的 shell 脚本时,make 文件在内部src和 test 文件夹中生成,但是当我尝试 make check 它执行 cd ../.. ---> 附加屏幕截图 ./build 执行

是否需要添加任何其他configure.ac选项makefile.am

4

0 回答 0