I am trying to create Makefile.am
and configure.ac
but i have errors when i type make dist
or 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
i type the following command:
autoreconf -i
./configure
make distcheck
the result is :
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
what is the error ???
The problem is here:
AC_INIT([neuromz] , [1.0] , [mz32programmer@gmail.com])
Remember always that Autoconf is fundamentally a text processor and that space characters are part of the text it processes. Quoting with []
is just that -- quoting -- not demarcation of argument values. The arguments are delimited by the commas in the argument list.
Autoconf ignores leading whitespace in macro arguments, but not trailing whitespace (though the manual does not call out the latter explicitly). The trailing spaces in these particular arguments happen to screw up the build rule for the distribution tarball. You might argue that Automake should apply more careful quotation in generated Makefiles, and I wouldn't argue with that. Do note, however, that the result of it doing so in this case would likely not be what you expected or wanted. In any event, you can resolve the problem simply by removing the trailing spaces from the macro arguments:
AC_INIT([neuromz], [1.0], [mz32programmer@gmail.com])