错误 make distcheck
Error make distcheck
我正在尝试创建 Makefile.am
和 configure.ac
但是当我输入 make dist
或 make distcheck
时出现错误
Makefile.am:
bin_PROGRAMS = neuromz
neuromz_SOURCES = neuromz.c neuromz.h ann.c ann.h
neuromz_CFLAGS = -lm
counfigure.ac:
AC_INIT([neuromz] , [1.0] , [mz32programmer@gmail.com])
AC_PREREQ([2.68])
AC_CONFIG_SRCDIR([neuromz.c])
AC_CONFIG_HEADERS([config.h])
#AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([1.11 -Wall -Werror])
AC_CONFIG_FILES([Makefile])
AC_SEARCH_LIBS([exp],[m])
AC_PROG_CC
AM_PROG_CC_C_O
AC_OUTPUT
我输入以下命令:
autoreconf -i
./configure
make distcheck
结果是:
mz@mz-32:~/programming/ctest/ANN$ make distcheck
make dist-gzip am__post_remove_distdir='@:'
make[1]: Entering directory '/home/mz/programming/ctest/ANN'
if test -d "neuromz--1.0 "; then find "neuromz--1.0 " -type d ! -perm -200 -exec chmod u+w {} ';' && rm -rf "neuromz--1.0 " || { sleep 5 && rm -rf "neuromz--1.0 "; }; else :; fi
test -d "neuromz--1.0 " || mkdir "neuromz--1.0 "
test -n "" \
|| find "neuromz--1.0 " -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec /bin/bash /home/mz/programming/ctest/ANN/install-sh -c -m a+r {} {} \; \
|| chmod -R a+r "neuromz--1.0 "
tardir=neuromz--1.0 && ${TAR-tar} chof - "$tardir" | GZIP=--best gzip -c >neuromz--1.0 .tar.gz
gzip: .tar.gz: No such file or directory
Makefile:528: recipe for target 'dist-gzip' failed
make[1]: *** [dist-gzip] Error 1
make[1]: Leaving directory '/home/mz/programming/ctest/ANN'
Makefile:563: recipe for target 'dist' failed
make: *** [dist] Error 2
错误是什么???
问题在这里:
AC_INIT([neuromz] , [1.0] , [mz32programmer@gmail.com])
永远记住,Autoconf 基本上是一个 text 处理器,space 字符是它处理的文本的一部分。用 []
引用只是——引用——而不是参数值的划分。参数由参数列表中的逗号分隔。
Autoconf ignores leading whitespace in macro arguments,但不尾随白色space(尽管手册没有明确指出后者)。这些特定参数中的尾随 space 恰好搞砸了分发 tarball 的构建规则。您可能会争辩说 Automake 应该在生成的 Makefile 中应用更仔细的引用,我不会反对。但是请注意,在这种情况下这样做的结果可能不是您所期望或想要的。无论如何,您只需从宏参数中删除尾随的 space 即可解决问题:
AC_INIT([neuromz], [1.0], [mz32programmer@gmail.com])
我正在尝试创建 Makefile.am
和 configure.ac
但是当我输入 make dist
或 make distcheck
时出现错误
Makefile.am:
bin_PROGRAMS = neuromz
neuromz_SOURCES = neuromz.c neuromz.h ann.c ann.h
neuromz_CFLAGS = -lm
counfigure.ac:
AC_INIT([neuromz] , [1.0] , [mz32programmer@gmail.com])
AC_PREREQ([2.68])
AC_CONFIG_SRCDIR([neuromz.c])
AC_CONFIG_HEADERS([config.h])
#AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([1.11 -Wall -Werror])
AC_CONFIG_FILES([Makefile])
AC_SEARCH_LIBS([exp],[m])
AC_PROG_CC
AM_PROG_CC_C_O
AC_OUTPUT
我输入以下命令:
autoreconf -i
./configure
make distcheck
结果是:
mz@mz-32:~/programming/ctest/ANN$ make distcheck
make dist-gzip am__post_remove_distdir='@:'
make[1]: Entering directory '/home/mz/programming/ctest/ANN'
if test -d "neuromz--1.0 "; then find "neuromz--1.0 " -type d ! -perm -200 -exec chmod u+w {} ';' && rm -rf "neuromz--1.0 " || { sleep 5 && rm -rf "neuromz--1.0 "; }; else :; fi
test -d "neuromz--1.0 " || mkdir "neuromz--1.0 "
test -n "" \
|| find "neuromz--1.0 " -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec /bin/bash /home/mz/programming/ctest/ANN/install-sh -c -m a+r {} {} \; \
|| chmod -R a+r "neuromz--1.0 "
tardir=neuromz--1.0 && ${TAR-tar} chof - "$tardir" | GZIP=--best gzip -c >neuromz--1.0 .tar.gz
gzip: .tar.gz: No such file or directory
Makefile:528: recipe for target 'dist-gzip' failed
make[1]: *** [dist-gzip] Error 1
make[1]: Leaving directory '/home/mz/programming/ctest/ANN'
Makefile:563: recipe for target 'dist' failed
make: *** [dist] Error 2
错误是什么???
问题在这里:
AC_INIT([neuromz] , [1.0] , [mz32programmer@gmail.com])
永远记住,Autoconf 基本上是一个 text 处理器,space 字符是它处理的文本的一部分。用 []
引用只是——引用——而不是参数值的划分。参数由参数列表中的逗号分隔。
Autoconf ignores leading whitespace in macro arguments,但不尾随白色space(尽管手册没有明确指出后者)。这些特定参数中的尾随 space 恰好搞砸了分发 tarball 的构建规则。您可能会争辩说 Automake 应该在生成的 Makefile 中应用更仔细的引用,我不会反对。但是请注意,在这种情况下这样做的结果可能不是您所期望或想要的。无论如何,您只需从宏参数中删除尾随的 space 即可解决问题:
AC_INIT([neuromz], [1.0], [mz32programmer@gmail.com])