This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCE430 v3.1: How to invoke Archiver under Managed Build

CCE430 v3 uses the linker to make libraries. I need object modules in a library to be separate and hence must make libs with Archiver. How to do this under a Managed Build? I've tried this two different ways but have run into traffic.

    a) Create a 2nd target in a separate makefile and append this to 'makefile' in the 'Build Command' (C/C++ Build Properties).But...

             CCE430 doesn't accept the revised line

                 "${CCE_INSTALL_ROOT}/utils/gmake/gmake -f makefile -f ..\make_archive all archive'

             It gets mangled when you try to type or paste it in

 

    b) Specify a subsidiary makefile for the archive as a 'post-build' step in the project properties.

               This doesn't work; gmake shells into the subsidiary makefile. It appears to see the object file list $OBJS from the parent 'makefile' but the rule for the Archiver isn't triggered.

 

I've heard that CCS v.4 makes libraries using the Archiver. However I would rather not jump to it just yet. Any thoughts?

         regards Steven Pruzina

 

  • OK, The best I can do is:

          - make a copy of 'makefile',

                ( somewhere elsewhere than the managed Debug/Release folders... these get cleaned every build)

          - In the copy, change the tool from cl430 to ar430, option is '-r'

           - edit 'Build Command' to use the new makefile

    This new makefile isn't managed, but it will only need to be remade if you add or remove source file folders in your managed project.

     

  • If you really want to do it from within the CCE Build environment, you could change the command line for the Librarian to invoke the archiver (ar430) instead of linker (cl430 -z) that it is currently set to. The cl430 -z basically invokes the shell and the -z option tells it to call the linker and passes it all the specified options. Changing the command line to ar430 will invoke the archiver instead.

    So to modify it to call the archiver instead, you could do the following:

    Go to Project Properties->C/C++ Build-> MSP430 Librarian

    1) Change command to: "${MSP430_CG_ROOT}/bin/ar430" -r test.lib     (where test.lib is the name of the library you want to create)
    2) Either remove all options by unchecking any checked options/deleting directories/files specified etc. and edit command line pattern to: ${command} ${flags} ${inputs} OR
    Leave the options as-is and edit command line pattern to: ${command} ${inputs}

    In the build window you should see something like the following for the archiving step:

    'Building target: test_archiver.lib'
    'Invoking: MSP430 Linker v3.1'

    "C:/Program Files/Texas Instruments/CC Essentials v3/tools/compiler/MSP430_31/bin/ar430" -r test.lib "./fet140_dma_06.obj"

    ==> new archive 'test.lib'
    ==> building archive 'test.lib'

    'Finished building target: test_archiver.lib'