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?