8 Replies Latest reply on Jan 18, 2019 2:33 AM by SeSh_3921701

    Proper way of Makefile organizing for porting POSIX service to WICED platform


      Hi, everybody!


      I would ask you how to properly create a Makefile for the project with POSIX origins that we want to port on WICED platform.


      First of all, I can see that the actual work to build the source is performed "under the hood" via general .mk makefiles within WICED platform SDK, so the only thing that you need to do is properly point your source to different places where all other needed parts are located.


      But that's my problem.


      Initially, the service that we're porting knows something about the WICED platform, cause there're some defines, like 'TARGET_PLATFORM_WICED', that control conditional compilation process. So I have created the directory inside '43xxx_Wi-Fi/libraries', created an .mk file with the same name, set the name for the service with 'NAME' variable and added a path to single C file which contains the main function and started to check what else will be needed.

      Along the way, I have added other header files from our service that are included.


      Everything was good until I needed to include 'wiced_security.h' header. It is located under '20706-A2_Bluetooth/include' directory (we use Wi-Fi/Bluetooth WICED platform combo). I have added a relative path to it, but after that, there are many "double definitions" of various macros and alike:


      In file included from .../wiced_result.h:45:0,


      ./include/wiced_bluetooth_result.h:58:0: error: "BT_RESULT_LIST" redefined [-Werror]

      #define BT_RESULT_LIST( prefix ) \


      In file included from .../20706-A2_Bluetooth/include/wiced_result.h:26:0,

      .../20706-A2_Bluetooth/include/wiced_bt_constants.h:43:0: note: this is the location of the previous definition

      #define BT_RESULT_LIST( prefix ) \



      So, my main question is how you deal with such problems? Are there some conventions to be used that I'm missing?


      Thanks in advance for responses.