[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

_PROGRAMS for non-C/C++/F77

From: John Anon
Subject: _PROGRAMS for non-C/C++/F77
Date: Sun, 1 Feb 2015 14:58:12 -0800
User-agent: Mutt/1.5.23 (2014-03-12)


I'm wondering what the canonical way of providing my own compile/link
target are for sources with a particular suffix.

If I have a language foo (interpreted) and a byte compiler fooc how do I
best achieve what would be done equivalently in a C based
I'd like to take advantage of the existing automake primaries because
many of the other targets will `just work' for me in the way I expect.
In particular install/dist.  Anyway...

Typical snippet (similar to that for a C program).

# start
bin_PROGRAMS = someprog
someprog_SOURCES = someprog.fs
# end

Where for the above I would want a target generated (basically).
someprog$(EXEEXT): $(someprog_SOURCES)
        fooc -o $@ $(someprog_SOURCES)

I have tried the following:

Option 1: Just define a target for someprog$(EXEEXT) (i.e. override automake 
generated target)

While this works it generates a warning.

/usr/share/automake-1.14/am/ ... overrides Automake target
'someprog$(EXEEXT)' defined here
src/   while processing program 'someprog'

Which means I cannot AM_INIT_AUTOMAKE([-Werror]) which I would like.

Option 2: Abuse assignment to _LINK so the generated target has the desired 

# Also requires listing someprog_SOURCES with $(srcdir)

someprog_SOURCES = $(srcdir)/someprog.fs
someprog_LINK = fooc -o $@ $(someprog_SOURCES)

This also works but obviously the generated target is a bit unsightly
and full of empty variables that don't belong.

someprog$(EXEEXT): $(someprog_OBJECTS) $(someprog_DEPENDENCIES) 
        @rm -f someprog$(EXEEXT)
        $(AM_V_GEN)$(someprog_LINK) $(someprog_OBJECTS) $(someprog_LDADD) 

Obviously it's also a concern that this is likely to break in some
future version of automake.

So what is the canonical way to do this cleanly & correctly?  Or are we
looking at having to extend automake to get this?

Kind regards,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]