1

I am trying to determine what the the difference is between the "$" and "@" when used during expression evaluation (if that is the correct term). For instance, in the Makefile I am trying to understand there is the following expression

NO-DEBUG   := @(if $(DEBUG),,1)

Later, there is the following expression

NO-CHECKED  := $(if $(CHECKED),,1)

These seem to be doing the same thing, but I am not sure how the "$" and "@" might be affecting the evaluations. I couldn't find anything by searching for ":= @" or "= @" in my cursory google searches. Any insight? Why would one be used apposed to the other?

Thanks and regards, Mark

1

I've never seen and have no idea about @(expression) in GNU make. It would simply be left uninterpreted if used. I confirmed it by tests with GNU make 4.0. There seems no mention in the manual.

Regarding = and :=, you should read The Two Flavors of Variables in the reference manual. There's detailed explanation with examples.

  • yaegashi, thanks for the response. My wording of my question wasn't the best as I was not looking for differences between "=" and ":=". My search started with ":= @", but yielded not results. So, I expanded the search to "= @" along with "gnu make" (in both cases). We are using v3.81, so I suspect your result will be the same with this version. I have no idea why it was used or if it was a mistake in the Makefile. – lordhog Jun 10 '15 at 0:02
  • @lordhog Ok, could you show that Makefile or tell the name of software that has it? – yaegashi Jun 10 '15 at 2:04
  • the Makefile comes from an internal project (not open source) file, so I can't share it. I had asked a few friends what it was, but best they thought it was something added for compatibility with another make utility. Thus, I was at a lost and posted this question. There were only two instances. One of which was the NO-DEBUG. – lordhog Jun 10 '15 at 2:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.