[Tools] ‘Tab’ means ‘Command’ in Make.

Remind! :
‘make’ can tell difference between normal line and command only by using ‘tab’.

It’s same in GNU Automake.
Here two simple ‘Makefile.am’ – A, B.

[A]
...
if COND_X
[spaces]VARX=xxx
endif
...

[B]
...
if COND_X
[tab]VARX=xxx
endif
...

Only difference is leading spaces [A] and leading tab [B].
But, in case of [B], make regard ‘VARX=xxx’ as command.
So, ‘Makefile.in’ generated by ‘automake’ looks like follows.

[A]
...
(usually, at the head of Makefile.in)
VARX=xxx
...
(start rules)
all: config.h ...

[B]
...
(usually, at the end of Makefile.in)
.PHONY
[tab]VARX=xxx
...

So, in case [B], ‘VARX’ cannot be used as a variable at the ‘rule’ part!
The point is, “‘Tab’ means ‘Command’ in ‘Make’!”.
Keep this in mind!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s