Eric and Russ, thanks for the reply. After long testing back and forth I decided to use AC_SUBST. My solution might not be the cleanest but it works for me.
In configure.ac I added the following line AC_SUBST([DOLLAR_SIGN],[$]) In the Makefile.am I changed my previous line into MY_REVISION=@DOLLAR_SIGN@(shell cat $(SRC_DIR)/$(MY_REVISION_FILE)) Finally the makefile ended up with the line of code I wanted MY_REVISION=$(shell cat $(SRC_DIR)/$(MY_REVISION_FILE)) And it works. Again, thanks for your help Oliver > [adding automake] > > On 03/29/2013 03:44 PM, Russ Allbery wrote: > > >> MY_REVISION_FILE=my-revision.txt > >> MY_REVISION=$(shell cat $(top_srcdir)/$(MY_REVISION_FILE)) > > $(shell ...) is a GNU make extension, and by using it, you are making your > Makefile.am useless for all other make flavors. Automake's goal is to be > portable to ALL makes by default, hence the warning. > > > > >> server/Makefile.am:9: cat $(top_srcdir: non-POSIX variable name > >> server/Makefile.am:9: (probably a GNU make extension) > >> autoreconf: automake failed with exit status: 1 > > Admittedly, the warning is rather poor quality; perhaps it is worth turning > this > into an automake bug to improve the quality of that message. > > > > > This is actually an Automake question, but the short answer is that > > you probably have fatal warnings enabled and you need to add > > -Wno-portability to the Automake flags (in AM_INIT_AUTOMAKE, for > example). > > Or don't use $(shell), or upgrade to Automake-NG (which _requires_ GNU > make to be installed on the end-user's machine, and therefore should let > you use GNU make extensions without question). >