Is there any way to tell automake not to interpret part of the automake file?

Is there any way to tell automake not to interpret part of Makefile.am?

In particular, I am trying to code the Makefile condition in Makefile.am. As other people have noticed, this does not work because automake interprets the endif construct.

Is there a way to avoid or specify lines in Makefile.am files so that automake copies them verbatim to destination Makefile? In particular, I do not want it to interpret endif in something like:

ifeq "$(SOMEVAR)" "" SOMEVAR="default_value" endif 
+4
source share
3 answers

The reason automake makes conditional expressions is because some dinosaur does. However, if you really have to do this, you can define your fragment as a variable in configure.ac and AC_SUBST in your Makefile . Thus, automake will not get a chance to see this. Remember to use AM_SUBST_NOTMAKE to avoid creating a string like FOO = @ FOO@ .)

 dnl In configure.ac: snippet=' ifeq ($(somevar),Y) foo endif ' AC_SUBST([snippet]) AM_SUBST_NOTMAKE([snippet]) 

and

 ## In Makefile.am: @ snippet@ 

I sincerely hope for a better way than this.

+6
source

I managed to find another solution. You can put your bebe-escape bits in a separate file, and then follow these steps:

 $(eval include $(srcdir)/Include.Makefile) 

Since automake does not understand $(eval , it just leaves the whole line intact. So you can put whatever you want into another file and GNU make will read it with pleasure. Note: you cannot just use include directly, since Automake understands this and will move to another file.

+2
source

What about:

 SOMEVAR=$(if $(SOMEVAR),$(SOMEVAR),"default_value") 
0
source

All Articles