I've struck a bit of a problem using a combination of ansi2knr,
libtool and .s assembler files which I think is related to automake
sorting the .SUFFIXES list.

I want a certain foo.lo to be provided either by foo.c or foo.s (and
some other possibilities) depending on the configured target, and if
foo.c is used it should be put through ansi2knr if necessary.

Here's what I came up with

        AUTOMAKE_OPTIONS = gnu no-dependencies ansi2knr

        lib_LTLIBRARIES = libfoo.la

        libfoo_la_SOURCES = bar.c
        libfoo_la_LIBADD = @FOO_OBJECTS@
        libfoo_la_DEPENDENCIES = $(libfoo_la_LIBADD)

        EXTRA_LTLIBRARIES = libdummy.la
        libdummy_la_SOURCES = foo.c

        SUFFIXES = .s
        .s.lo:
                $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $<

@FOO_OBJECTS@ is either foo_.lo when using foo.c and ansi2knr, or is
just foo.lo when using foo.c without ansi2knr, or using foo.s.  The
corresponding foo.c or foo.s is copied or linked from a sub-directory
chosen by configure.  libdummy.la isn't built, it's there just to
create a foo.c -> foo_.c rule for use if foo_.lo is chosen.

Unfortunately the .SUFFIXES is sorted,

        .SUFFIXES: .c .lo .o .obj .s

and because foo.c is mentioned in a rule (the foo_.c one), make
decides it "ought to exist" and uses .c.lo even if foo.s exists and
foo.c doesn't.


I wonder if there could be a way to control the order of the .SUFFIXES
generated, in this case wanting .s before .c.  Maybe the automake
generated ones could be tacked on the end of the given $(SUFFIXES).

Using .S instead would work in this case of course.  Other suggestions
welcome.
_______________________________________________
Automake mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/automake

Reply via email to