0

I'm reading Jamrule file of some project to understand how it builds. But there is some that I can't understand. Such like $(1:D=) or $(1:S=$(sample)) or $(1:G=$(sample)) what does it mean?

I searched colon and equal meaning in a shell script but I couldn't find when the alphabet is in between them.

ex) local _s = $(1:D=) ;

HasithaJay
  • 355
  • 2
  • 9
  • I do know the shell command `_s=${1:-D=}`, (without spaces and curly brackets and an extra char before the `D`, did you paste the command correctly ? – Walter A May 15 '19 at 10:31
  • Maybe it's an emoticon joke with a tongue hanging out and a beard - tilt your head so your left ear is on your left shoulder to see it. – Mark Setchell May 15 '19 at 12:39
  • It's definitely not shell syntax. You'd have to consult the Jam documentation. – chepner May 15 '19 at 13:12

1 Answers1

0

$(1) expands the first argument of a rule. $(1:D=foo) applies a modifier that replaces the directory portion of the expanded elements (dirname, if you think in shell terms) with the string foo. The special case $(1:D=) removes the directory portion. The modifier S refers to the suffix (aka extension) of the file name, G to the "grist" of a jam target name.

Please refer to the Variable Expansion section of the Perforce Jam documentation for a complete list. I can recommend reading the complete Jam documentation to understand the specific concepts (like grist).

user686249
  • 669
  • 6
  • 17