Post Go back to editing

Generating makefile from command line

Category: Software
Product Number: CCES
Software Version: 2.9.3.0

I am trying to create a dos script to be used in production to create LDR files for loading to the product.

The requirements are:

  • The source files and project file are pulled from the git repository. 
  • use a makefile generated from the project file
  • Use RELEASE config
  • Do not want to archive the /release/makefile/, because the last checkin might not have rebuilt using RELEASE, so then the makefile in archive would be out of sync

By searching around your FAQs, I found part of the answer.

This script creates the release-style makefile:

set PATH=%PATH%;c:\Analog Devices\CrossCore Embedded Studio 2.9.3\
set PATH=%PATH%;c:\Analog Devices\CrossCore Embedded Studio 2.9.3\Eclipse
set CCES_HOME="c:\Analog Devices\CrossCore Embedded Studio 2.9.3\"
mkdir temp
ccesc.exe -nosplash -consoleLog -application com.analog.crosscore.headlesstools -data temp -project ..\tvs_ffu\ -build Release
rmdir /S /Q temp

Then, a second script builds from the makefile, and also invokes elfloader multiple times to create various forms of the *.ldf:

set PATH=%PATH%;c:\Analog Devices\CrossCore Embedded Studio 2.9.3\
cd ..\TVS_FFU\release

del *.dxe

make clean
make all

rem Get the build target name as var so it is independent of pull name.
rem Only one target should exist since del *.dxe was performed above.

for /f "delims=" %%a in ('dir /b *.dxe') do set "pname=%%a"
elfloader -proc ADSP-21563 -si-revision 0.2 -bspimaster -fbinary -width 8 -o "SPIbin.ldr" %pname%
elfloader -proc ADSP-21563 -si-revision 0.2 -bspimaster -finclude -width 8 -o "SPIincl.ldr" %pname%
elfloader -proc ADSP-21563 -si-revision 0.2 -buartslave -fbinary -width 8 -o "UARTbin.ldr" %pname%
elfloader -proc ADSP-21563 -si-revision 0.2 -buartslave -finclude -width 8 -o "UARTincl.ldr" %pname%
copy *.ldr ..\*
cd ..\..\scripts

QUESTIONS

1. The "ccesc.exe -nosplash ..." invocation in the first set not only causes the Release/makefile to be created, but also runs a make. However, the parameters appear to be different than when the make is executed in the second script. So I would rather do the make all in the second script-- but then, is there a way to suppress the make that autoruns in the -nosplash line earlier? In other words, I think all I need in the first is for the makefile to be created.

2. In the definitions such as set  "PATH=%PATH%;c:\Analog Devices\CrossCore Embedded Studio 2.9.3\" etc., is there a way to generalize to "whichever version is installed," rather than a hard-coded version?

3. In general, any comments or criticisms re this basic approach? Is this best-practice? Are there any vulnerabilities?

  • Hi,

    We are looking into this and get back to you as soon as possible.


    Regards,
    Nishanthi.V

  • Look forward to it, tnx.

    Meanwhile, I am duplicating these attempts applied to a different project. This time, when doing a "release" build it fails to find an .h file in one of the built in functions. (See screen shot below).

    I went into the options page and noticed that the "include" paths for DEBUG are more extensive than for the RELEASE build. So I manually copied the ones in the DEBUG to RELEASE, and this fixed the first fail but shifted it to a different .h file still missing. (The one shown in screenshot).

    I didn't have this kind of problem with the "first" project documented above; this one was created by others. The new project includes the FreeRTOS while the other one didn't. That's one difference. Another difference is that the first project used the pin-config utility, while the second does not. I list this as question #4 if that is permitted, since it is in the same "family" of questions.

    4. What makes it so that one project creates the dependencies automatically, but the other only in DEBUG mode and not the corresponding RELEASE? Should one try to "repair" it manually, and if so, is there a standard wiki or info-source for doing this in a systematic way?

    I spent a few hours searching the forums. Found one similar about "missing .h files" but it was six years ago and seems to not apply (answer referred to private correspondence).

  • Hi ,

    We are checking internally regarding our first post.

    Regarding the second one, We are able to build our sample FreeRTOS project successfully with both debug and release configurations.Also, the include directories are not getting changed between these configurations.

    So, could you please provide us your project which replicates this issue along with the screenshot of the difference in include directories.This will help us to assist you further.

    Awaiting for your reply.

    Regards,
    Nishanthi.V

  • requirements

    Hi,

    Regarding your first post, here is our answer.

    Answer for #1 – Unfortunately not. We can create projects with headless tools, but we cannot generate the Makefiles without building.

    Answer for #2 – One needs to invoke ccesc.exe (on Windows) either explicitly or by having the .exe in the PATH. A simple script can be written to find the CCES version though and set the environment.

    Answer for #3 – This Seems reasonable.

    Regards,
    Nishanthi.V