Radoslaw Krasimirow
Radoslaw Krasimirow

Reputation: 1873

What does this do in makefiles?

Here is the line that bothers me:

CFLAGS+=-DCONTIKI_VERSION_THINKSQUARE=1

There are so many signs one after another (+=-) that totally confuses me :) I know that += is append operator, but the right side is unknown for me. Thank you in advance.

Upvotes: 1

Views: 42

Answers (1)

Eugeniu Rosca
Eugeniu Rosca

Reputation: 5305

The whole right side of += is interpreted as a string that is appended to the makefile variable CFLAGS. Say, your makefile is:

CFLAGS:=VAL1
CFLAGS+=-DCONTIKI_VERSION_THINKSQUARE=1

all:
    @echo $(CFLAGS)

make all will output:

VAL1 -DCONTIKI_VERSION_THINKSQUARE=1

Upvotes: 1

Related Questions