How to add/modify extra compile options.

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

cross mob
NoMa_3617641
Level 2
Level 2

Hi,

Please tell me how to add/modify extra compile options.

For example, suppress some warnings, customize optimization and so on.

Regards,

Nobuhiro

0 Likes
1 Solution
SiSa_3185206
Level 4
Level 4
10 likes received First like received First like given

Under tools/makefiles directory you will see some makefiles as below:

...

wiced_config.mk

...

wiced_toolchain_ARM_GNU.mk

wiced_toolchain_GCC.mk

wiced_toolchain_IAR.mk

wiced_toolchain_Win32_MIPS.mk

wiced_toolchain_common.mk

wiced_toolchain_x86_GNU.mk

The wiced_config.mk file has the toolchain type set to either gcc or iar.

By default the gcc toolchain is used in the WICED build.

So, as per the toolchain defined in the wiced_config.mk file, you can change the respective toolchain makefile under tools/makefiles directory.

In this case where gcc toolchain is used, you can edit the wiced_toolchain_GCC.mk file which will in turn does not contain any build parameters but includes the wiced_toolchain_ARM_GNU.mk makefile, so you need to edit the wiced_toolchain_ARM_GNU.mk file finally.

Similarly you can edit other makefile(s) too.

Following is the build macro in the makefile that has the compiler optimization flag:

COMPILER_SPECIFIC_OPTIMIZED_CFLAGS

If you want to suppress some warnings then you can modify the below macro:

COMPILER_SPECIFIC_STANDARD_CFLAGS

COMPILER_SPECIFIC_PEDANTIC_CFLAGS

First take a BACKUP of the file you are going to modify.

View solution in original post

2 Replies
SiSa_3185206
Level 4
Level 4
10 likes received First like received First like given

Under tools/makefiles directory you will see some makefiles as below:

...

wiced_config.mk

...

wiced_toolchain_ARM_GNU.mk

wiced_toolchain_GCC.mk

wiced_toolchain_IAR.mk

wiced_toolchain_Win32_MIPS.mk

wiced_toolchain_common.mk

wiced_toolchain_x86_GNU.mk

The wiced_config.mk file has the toolchain type set to either gcc or iar.

By default the gcc toolchain is used in the WICED build.

So, as per the toolchain defined in the wiced_config.mk file, you can change the respective toolchain makefile under tools/makefiles directory.

In this case where gcc toolchain is used, you can edit the wiced_toolchain_GCC.mk file which will in turn does not contain any build parameters but includes the wiced_toolchain_ARM_GNU.mk makefile, so you need to edit the wiced_toolchain_ARM_GNU.mk file finally.

Similarly you can edit other makefile(s) too.

Following is the build macro in the makefile that has the compiler optimization flag:

COMPILER_SPECIFIC_OPTIMIZED_CFLAGS

If you want to suppress some warnings then you can modify the below macro:

COMPILER_SPECIFIC_STANDARD_CFLAGS

COMPILER_SPECIFIC_PEDANTIC_CFLAGS

First take a BACKUP of the file you are going to modify.

Thanks for your reply.

This is what I want to know.

0 Likes