How to pass Macro in hello_sensor makefile.mk?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi Broadcom helpers,

I just take hello_sensor project as an example, because I have a swarm of files need to get the same macro defines. So I put this in the makefile.mk like below:

########################################################################

# Add Application sources here.

########################################################################

CFLAG += -DHELLO_MACRO=1

APP_SRC = hello_sensor.c

But the CFLAG setting seems not work with the source code compiling.

I use the blocking item like below, and it happened:

#ifndef HELLO_MACRO

#error HELLO_MACRO not defined!!!

#endif

Please provide any document or information about the settings of makefile.mk.

Thanks.

0 Likes
1 Solution
Anonymous
Not applicable

Hello Henry,

Can you please try replacing CFLAG with C_FLAGS.

Thanks,

Kevin

View solution in original post

0 Likes
2 Replies
Anonymous
Not applicable

Hello Henry,

Can you please try replacing CFLAG with C_FLAGS.

Thanks,

Kevin

0 Likes
Anonymous
Not applicable

Hi Kevin,

The C_FLAGS works with the define in Makefile.

Thank you.

Henry

0 Likes