views:

119

answers:

1

With a GNU makefile content of:

SVNVERSION_NUMBER := $(shell svnversion --version | perl -lne 'print $1 if /version (\d+.\d+.\d+)/')

$(error $(SVNVERSION_NUMBER))

I get a result of:

Makefile:3: *** svnversion, version 1.6.2 (r37639).  Stop.

However, at the shell if I type:

svnversion --version | perl -lne 'print $1 if /version (\d+.\d+.\d+)/'

I get the result:

1.6.2

Clearly, my shell syntax is not doing what I think it is, but I'm not clear on why.

Thanks.

+5  A: 

$ is special in make strings. $$ for a literal dollar sign in the perl command.

Peter Cordes