This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Cannot add a new file extension
- To: automake at gnu dot org
- Subject: Cannot add a new file extension
- From: Dmitry Mikhin <dmitrym at acres dot com dot au>
- Date: Thu, 25 Oct 2001 12:16:51 +0930
- List-Id: Discussion list for automake <automake.gnu.org>
- Organization: Acacia Research
Assume that we have a language called K. The source files *.k are
compiled
using a compiler called 'kc'. This project has a single source file
'file.k' and
I want to use autotools for generating Makefiles. Automake fails to
produce
'Makefile.in' complaining:
Can't call method "target_hook" on an undefined value at
/usr/local/bin/automake line 1943.
Software setup:
automake 1.5
autoconf 2.52
perl 5.6.0
RedHat Linux (2.4.2-2 kernel)
In my case the language was Fortran-90, but the error is generated for
any unknown file extension, even if compilation rules for that language
are provided in 'Makefile.am'.
Any suggestions?
Dmitry
The setup follows:
******** configure.in ********************
dnl Process this file with autoconf to produce a configure script.
AC_INIT(acconfig.h)
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE(prj, 1.0.0)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
AC_PROG_CC
AC_PROG_CPP
AC_PROG_LN_S
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_SUBST(INCLUDES)
AC_OUTPUT([Makefile])
AC_MSG_RESULT()
AC_MSG_RESULT([To compile the package run 'make', then 'make install'.])
AC_MSG_RESULT([To perform checks before the installation, run 'make
check'.])
AC_MSG_RESULT()
******** Makefile.am **************
# new suffix
SUFFIXES = .k
# compiler and flags
KC=kc
KFLAGS=
# compilation of *.k
.k.o:
$(KC) -c $(KFLAGS) $<
# our goal
lib_LIBRARIES = \
lib@PACKAGE@.a
# the library sources
lib@PACKAGE@_a_SOURCES = \
file.k
all-local:
@echo "*** Everything completed ***"