Wednesday, February 11, 2009

Building programs with the SDK

The numerous Symbian SDKs share a
special build system developed by
Symbian for the use specifically with
the SDK. Some of the Symbian IDEs
build on top of it, in order to provide
integration with the SDK. C++BuilderX in particular integrates with the default
build system very well. Although there exist alternative ways
to build things for Symbian (as the
Rudolf König SDK on Unix using plain
GNU Makefile), the Symbian build
system is somewhat standard in the
Symbian C++ world. So I believe that it must be known by every Symbian C++
programmer and I will teach you how
to use and develop applications with it. A Symbian application source usually
stores, in a directory named 'group', the
file 'bld.inf' and one or more files with
extension '.mmp'. You define the build
for your Symbian application by writing b l d . i n f and at least one p r o j e c t . mm p . Then you process these files with a tool named
'bldmake' and will obtain a batch file
('ABLD.BAT') and some makefiles that
will build the application for you. This tool exists mainly because a
Symbian application is usually built for
many platforms: the emulator, using a
Microsoft X86 compiler, as well as the
real device using a gcc-derived ARM
compiler. The b l d m a k e saves you from writing specially crafted makefiles
for these compilers and make utilities;
also it allows for building many targets
with just a single command. In fact, 'bldmake' is quite easy to use IF
you accept the way it works. If you
don't, you will suffer endless
nightmares in order to build things the
way you want. Another drawback is
the fact that it is somewhat slow, so you have to compile, build and start the
emulator, and always wait some time
in the middle of the process. Let's explain how it works with an
example. Open a command line prompt,
and after changing to the directory
containing the b l d . i n f , t y p e : > b l d m a k e b l d f i l e s Of course, you must have the PATH set
correctly for the installation of the SDK
you are using. This command will look
for the b l d . i n f , process it and the related * . mm p , then generate a BATCH file named A B L D . B A T . Now you have all you need to build your
applications. Simply type: > a b l d b u i l d This will build your application in all the
available flavors. Well, in fact you are
building eight (!) different binaries. Note
that the target files are stored in a very
deep directory structure, and you are
building both in debug and release versions for WINS (windows), ARM4
(plain arm), ARMI (speed optimized
arm), THUMB (size optimized ARM)! But
you can choose to build for only one
target, and since it take less time, you
usually build ONLY for one version of one target. For example, to build for the
emulator only in the debug version, or
for the device, optimized for size, in
release version, you type: > a b l d b u i l d w i n s u d e b > a b l d b u i n d t h u m b u r e l Building for Windows is enough to start
the emulator and run the application in
the emulated environment. Application
files are compiled and placed straight
where the emulator can run it: no need
to copy them in the right location. But for real devices, you have to pack
everything in a . s i s file for installation, send it to the phone and
install the application. You are required
to write a . p k g file to describe the installer, and then create it with: > m a k e s i s f i l e . p k g References:
BldMake
ABLD

Submenu
2.1 Binary Files
2.2 Source Files
2.3 The build process
2.4 The .mmp
2.5 The AIF
2.6 Create an installer

No comments:

Post a Comment