[jamming] BJam's command/shell execution
Joshua ChaitinPollak
jpollak at kivasystems.com
Thu Mar 22 14:40:26 PST 2007
Hi,
I'm using BJam, and I can't figure out how to get the shell script
execution working. I know there was a recent thread about a COMMAND
patch for Jam, and I'm looking forward to that, but for now I'm using
BJam and I don't have the time to apply patches and compile, etc.
I've ported most of my project to Jam, but I have one Makefile I
can't figure out how to ditch. I have this Makefile code:
REVISION := $(shell svnversion)
OLD_REVISION := $(shell cat revision.cpp 2> /dev/null)
revision.cpp:
ifeq (,$(findstring \"{REVISION}\", ${OLD_REVISION}))
@echo "void config::getRevision(std::string& rev) { rev = \"$
{REVISION}\"; } >> revision.cpp
endif
This (should) effectively (re)builds revision.cpp if the revision has
changed. My program depends in revision.cpp, so if revision has
changed, the file gets rebuild and the program gets rebuilt.
How would I do this in a Jam way? I guess I could call a shell script
to build the revision.cpp file all the time, but I'd rather not
unless its out of date.
-Josh
--
Joshua ChaitinPollak
Software Engineer
Kiva Systems
More information about the jamming
mailing list