OK, I finally got my makefile doing what I want and here's the code (I am
using 'VERSION ID 2 "mm/dd/yy"'):
mv myapp.rcp myapp.rcp.old
awk -v awkdate='"$(shell date +%m/%d/%y)"' \
'/VERSION ID 2/ { $$4=awkdate } { print $0 }' \
myapp.rcp.old > myapp.rcp
rm myapp.rcp.old
pilrc myapp.rcp
BUT if you store your date string as a string resource such as 'STRING ID
9999 "mm/dd/yy"', it would be:
mv myapp.rcp myapp.rcp.old
awk -v awkdate='"$(shell date +%m/%d/%y)"' \
'/STRING ID 9999/ { $$4=awkdate } { print $0 }' \
myapp.rcp.old > myapp.rcp
rm myapp.rcp.old
pilrc myapp.rcp
OR if you store your date string in a custom resource type such as 'DATA
"crdt" ID 1 "mm/dd/yy"', it would be:
mv myapp.rcp myapp.rcp.old
awk -v awkdate='"$(shell date +%m/%d/%y)"' \
'/DATA "crdt" ID 1/ { $$5=awkdate } { print $0 }' \
myapp.rcp.old > myapp.rcp
rm myapp.rcp.old
pilrc myapp.rcp
Just find the "pilrc" line in your makefile and insert the appropriate 3
commands (mv, awk, and rm) and you are done. The only 2 differences in
these examples are the pattern to match and the ordinal of the field to
change. This assumes a UNIX environment (the "shell date" part). I am
using GCC under cygwin and it works great.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/