Hi,
Problem I had was that I was specifying %s in Makefile (sort of
shortcut for patsubst function). It seems automake doesn't accept this
notation, so using $(VARIABLE:%.g=%.cpp) won't work as well as
implicit rules using %s. However, if we use old style (i.e.
$(VARIABLE:.g=.cpp) and ".g.cpp" like rules, it works.
I tried to make an example, but I made it even more unclear. I've
specified also lxx file in previous example so I know whether
transition from .g to .o through lex works.
The real application is tao_idl, which takes some idl file as an
input and produces nine ouptut files.
Example:
Let's say we have file input.idl. Produced files will be then (after
running tao_idl input.idl):
inputC.h
inputC.cpp
inputC.i
inputS.h
inputS.cpp
inputS.i
inputS_T.h
inputS_T.cpp
inputS_T.i
What do I want is to specify only idl files in program_SOURCES
variables and specify implicit rules so all cpp files are build (i.e.
*C.cpp, *S.cpp, *S_T.cpp). I'm not sure this is possible. Because I'm
not sure whether there is a way how to tell automake that we want to
build three cpp files from one idl file using implicit rules.
Next I bumped into this problem...
I tested this and couldn't get expected output (am_amktest_OBJECTS in
Makefile.in is still empty):
---Makefile.am---
AUTOMAKE_OPTIONS = foreign
SUFFIXES = .g C.cpp
.gC.cpp:
@echo "Ok, it works"
touch $@
bin_PROGRAMS= amktest
amktest_SOURCES= myfile.g---
#---EOF---
---configure.ac---
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([myfile.g])
AC_CONFIG_HEADER([config.h])
# Checks for programs.
AC_PROG_CXX
# Checks for libraries.
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_CONFIG_FILES(Makefile)
AC_OUTPUT
#---EOF---
After doing:
$ aclocal && autoheader && autoconf && automake -a && touch myfile.g
&& ./configure && make
I'm still getting:
make all-am
make[1]: Entering directory `/tmp/00'
cc -o amktest
gcc-3.2.2: no input files
make[1]: *** [amktest] Error 1
make[1]: Leaving directory `/tmp/00'
make: *** [all] Error 2
Then running this to see am_amktest_OBJECTS...
$ cat Makefile.in | grep "am_amktest_OBJECTS"
am_amktest_OBJECTS =
amktest_OBJECTS = $(am_amktest_OBJECTS)
Automake doesn't accept my SUFFIXES... Probably.
It seems I'm still missing some detail, which causes me troubles
(before, I would swear that also implicit rules without %s didn't
worked when I've had tried them...). Maybe some automatically
generated files that aren't regenerated (but used during Makefile.in
building) after I do "automake && ./configure" or whatever mess in...
Thanks for help.
Regards,
Juraj
Sander Niemeijer wrote:
Hi,
I have some problems understanding what will be created from a
source.src file by filemaker (I myself am not familiar with this
application).
You can use suffix rules but these only work when the filename bit
without the suffix part is the same for both the source and target
files. This means that if you have something like:
---
SUFFIXES = .src
.c.src:
filemaker $<
bin_PROGRAMS = foo
foo_SOURCES = foo.src
---
automake will expect filemaker to create a foo.c.
So my question back to you is: what exactly is created from a foo.src
file (all three .cpp, .c, and .lxx files or only one of them) and
what will be the exact file names for the generated files (foo.cpp,
foo.c, and foo.lxx or different)?
Regards,
Sander