Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "$(@:H)" do in MakeFile?

Tags:

makefile

I was speaking with one of my fellow interns at lunch today who is working almost exclusively in Makefile this summer, and he mentioned that he has no idea what $(@:H) means or does. My google-fu is failing me, as I cannot find it anywhere on the web, and was hoping you guys could help me out.

like image 959
Swammy Avatar asked Oct 20 '22 09:10

Swammy


1 Answers

Assuming this is GNU make then that's just the expansion of the (oddly named) @:H variable. Which isn't a default variable (and isn't a variable that can be set with the normal assignment syntax) and would be an odd choice for a variable name to begin with as it is very close to real variable expansions.

It is much more likely that this is referring to BSD make where :H is a variable modifier which (excerpt from the man page):

:H

Replaces each word in the variable with everything but the last component.

like image 58
Etan Reisner Avatar answered Oct 22 '22 21:10

Etan Reisner