Compile
lightblue application using command line
This doucment assumes that you know how to write a make file it
only tells you
which options should be added to the commnad line of the compiler and
linker.
Table of contents
- Compile your lightblue application
using command line
- Table of contents
- Additional Defines
- Additional Include file directories
- GNU ARM Specifc Command Line
- Realview 2.x Specific Command Line
- Virtual C++ Specific Command Line
Additional Defines
Lightblue library does not need any additional defines beside those
needed by the BREW SDK. The BREW SDK requires DYNAMIC_APP to be defined
to be defined and for the simulator build, AEE_SIMULATOR should also be
defined.
So for the ARM build, following options should be added to the
command line of the compiler:
-DDYNAMIC_APP
For the simulator build, you should add:
/DDYNAMIC_APP /DAEE_SIMULATOR
Additional Include
file directories
Lightblue library requires the "include" and "include\213" directories
in the librarie's install directory to be included if you are
using
BREW SDK 2.1.3 or "include" and "include\314" if you are using BREW SDK
2.1.4. in addition, the original BREW SDK's "inc" direcotry
is also
needed.
So if you are using BREW SDK 2.1.3, you should add following to the
command line of the compiler
-I"$(lb_root)\inlcude" -I"$(lb_root)\inlcude\213" -I <the path to
the BREW SDK 2.1.3>
Note, the variable $(lb_root) is not defined automatically, define it
to the installation path of the lightblue library or replace $(lb_root)
with the actuall absolute path in the command line.
For VC compiler, just change "-I" to "/I"
GNU ARM Specifc
Command Line
gcc options:
-g -O2 -mlittle-endian -fno-builtin -fshort-enums -fno-rtti
-fno-exceptions -mcpu=arm7tdmi -mthumb-interwork -mapcs-frame
Notes: the "-g" option tells the compiler to create a ELF that
contains debug information. It will not effect the size or
speed of
the final MOD file.
ld options:
-Ttext 0 --emit-relocs -entry AEEMod_Load -lgcc
-L"c:\gnude\lib\gcc-lib\arm-elf\3.3.1"
Change the library path if needed.
After the ELF is linked, use the BREWElf2Mod.exe to gnerate a MOD file
out of it.
Notes: there is an additional object file that should be linked into
the ELF: entryptr.o in the "lib\g++" directory. You have to make
it
the first file in the object file list.
Realview 2.x Specific
Command Line
armcc options:
--no_exceptions --no_rtti --cpu ARM7TDMI --littleend
--apcs=/ropi/interwork/norwpi -W -Ospace -O2 -g
--split_sections
-ogame.o
Notes:
The "-g" option tells the compiler to create a ELF that
contains debug information. It will not effect the size or
speed of
the final MOD file.
armlink options:
--entry 0x8000 --no_exceptions --first AEEMod_Load --reloc
After the ELF is linked, use the lbmg.exe to generate a MOD file for
example: "lbmg example.elf" will create example.mod in the same
directory as example.elf.
Notes:
There is an additional object file that should be linked into
the ELF: entryptr.o in the "lib\rv22" directory. You have to make
it
the first file in the object file list.
No additonal libraries are needed.
Virtual C++ Specific
Command Line
cl options:
/Od /Gm /EHsc /RTC1 /MLd /Fd"./vc70.pdb" /W3 /c /ZI /TP
link options:
/DLL /DEBUG /SUBSYSTEM:WINDOWS /MACHINE:X86 /LIBPATH:"$(VCLIB)"
Notes:
There is an additional object file that should be linked into
the ELF: entryptr.obj in the "lib\vc" directory. You have to make
it
the first file in the object file list.
if $(VCLIB) is not defined, replace it as the "lib" sub directory of vc
7's direcotry.
No additonal libraries are needed except the defualt libraries.
(end)