Shell commands in GNU make?
Hi,
Was wondering, how can you put say a for loop into a makefile so it works?
Something like:
sub: $(HEADERS)
for dir in $(SUBDIRS) do cd $dir && make
I've seen $() used to contain shell commands e.g. $(shell pwd), and other times without "shell". The GNU make manual seems to suggest that its valid just to write the command without the $()...
Also i'm not sure about using shell variables - if I write a for loop like above - is it valid to refer to $dir, or should I write $(dir)?
Cheers,
M
|