Q:

Makefile for web project: how to use placeholders properly? 

It should be very simple.  I have a makefile for a web project (don't ask me why :) :
solution = solution_name
common = app css js/*.js js/app js/locale #...
private = app css image js template #...

all:
  @echo Solution '${solution}'
  @tar cvfz ${solution}.tgz --exclude=.svn \
  $(addprefix ../../, ${common}) \
  ${private}

My goal is to have app.js file with make-variable %VERSION% inside, which I can substitute, and include into archive, not changing the original file (to use this variable in future).  All I have found to the moment is
sed -i -r "s/%VERSION%/`svnversion`/" js/app.js

This code does half of the job.  The line is modified after processing, and I can not use set the second time.  How can I achieve my goal?  Thank you. 

A:

I use following trick for such problems:
sed -i 's# *=.*//.*VERSION.*#  = "`get_version`" // comment with word VERSION inside it#' myfile.ext

and in myfile.ext i have:
some_variable = '1.2.3.45-r67' // comment with word VERSION inside it

so every time I run sed, it gets actual version (date, time, branch, whatever) and this can be repeated as often I need

