I don't think you can do what you're trying to achieve.  AFAIK the
if .. endif syntax used by automake is for conditionals only (see:
http://www.gnu.org/software/automake/manual/html_node/
Conditionals.html) and there is nothing such as "ifdef".

ifdef...endif is GNU make syntax. I found some old mail now, that tells
me, that automake doesn't accept that syntax, although it doesn't need
to process it. The ifdef...endif syntax would be interpreted by GNU
make. Of course
my example probably would need to be interpreted by automake too,
because WIN32_EXTRA_LDFLAGS is set, before it gets extended. But to know
that, automake would need to understand this syntax.

However, what I wanted to do is not possible atm, so I restored the old
Makefile code.

Just found this old thread, but was able to find the following workaround:

In configure.ac, add something like:

MYMAKE='include $(top_srcdir)/mymake.mk'
AC_SUBST([MYMAKE])

In Makefile.am, add:

@MYMAKE@

This way automake will make the substitution, but leave processing of the include directive to make.

The downside is that your build will be less portable.

Just thought I'd share in case others were still having the same problem.

- Daniel


Reply via email to