BLD.INF, .MMP and .pkg file

xiaoxiao2021-04-09  365

For each item, there must be an engineering boot file BLD.INF and a project definition file .mmp. BLD.INF files may reference one or more .mmp files, each .mmp file corresponding to a component to be generated.

First, the project boot file BLD.inf

In fact, it is a script that tells the build environment to prepare or know something before doing Build. The most common way is:

PRJ_MMPFILES

HelloWorld.MMP

This is telling the build environment, the name of the project file you want to handle is HelloWorld.mmp.

If you do a more complex program, you may need to be all libraries of Build, then you will list all the projects that you need Build:

PRJ_MMPFILES

Project.mmp

Project_lib1.mmp

Project_lib2.mmp

Another commonly used tag is PRJ_PLATFORMS. It tells the compilation environment, and the following platforms (Targets) are needed.

PRJ_PLATFORMS

Wins Armi Winscw

Or use directly:

PRJ_PLATFORMS

DEFAULT

Note: If you don't do a Prj_Platforms tag in bld.inf, its effect is equivalent to Prj_Platforms Default, that is, this tag is not necessary.

The third common mark is Prj_Exports. It tells the compiler to copy to the specified location before compiling. For example, if you need an INCLUDE a third-party * .inl file in your project, then if this file does not exist, you can write this:

PRJ_EXPORTS

./nk_set.inl / EPOC32 / INCLUDE

So, when compiling, a Perl script will first copy the NK_SET.INL files under your project directory to / EPOC32 / Include directory, and then compile.

Most bld.inf literati need these three markers, there is still a little skill, that is, you can use #if #else to wait for things, such as:

#if Defined (Wins)

...... .// Notice no {}

Else

.......

#ENDIF

Second, the project definition file .MMP

The content of this file is more complicated than bld.inf files.

Let's take a look at the content of the helporldbasic.mmp file:

Target HelloWorldbasic.App

TargetType App

Uid 0x100039ce 0x10005B91

TargetPath / System / Apps / HelloWorldbasic

SourcePath ../src

Source helloworldbasic.cpp

Source HelloWorldBasicApplication.cpp

Source HelloWorldBasicappview.cpp

Source HelloWorldBasicappui.cpp

Source HelloWorldBasicDocument.cpp

Sourcepath ../group

Resource helloworldbasic.rss

Userinclud ../inc

SYSTEMINCLUDE / EPOC32 / INCLUDE

Library Euser.lib

Library apparc.lib

Library cone.liblibrary Eikcore.lib

Library avkon.lib

The .mmp file specifies the properties of the project component with a platform-independent and compiler.

(1) TARGET: The name of the application must have the correct file extension: .exe, .app, .dll, etc.

(2) TargetType: Defined as app (this option determines the value of UID1), which means this is a GUI application, there are many other types, including DLL, EXE, TSY, CSY, and LDD.

(3) UID: Specifies the unique system flag of the GUI application.

(4) TargetPath: The location of the final generated application and its components are always located in / system / apps / below, which is driven relative to the device driver, analog drive disc (for example, C :) or analog ROM (Z :) The root directory of the disk.

(5) SourcePath: The location path of the project source file.

(6) LANG: If the application supports different languages, use this statement. Each supported statement has two digits of code.

(7) Source: Specify the name of the project source file. This statement can be used multiple times and can have multiple file names on each statement.

(8) Resource: Specify the resource file.

(9) Userinclude and systeminclude: Specify the location of the header file unique to the application.

(10) Library: Lists the application framework and graphics library that requires links - these are corresponding to the shared library DLL .lib file, which will call these DLL functions at runtime.

(11) AIF: Specify the application information file (.AIF), which contains icons and other application properties defined in the application resource file.

For project definition files, let's take a look at the detailed explanation of some of the keywords:

(1) UID: The world's unique marker consists of 32-bit binary numbers. In the Symbian OS, through the UID type logo object, the UID type has 3 components Uid: UID1, UID2, UID3.

Uid1: Determine the file is a document or an executable code, it should be seen as a system-level flag, which is used to distinguish the executable file, DLL and other files. The TargetType statement in the .mmp file determines UID1.

UID2: For document files, UID2 determines the document type (application data file or .aif file). For executable code files, UID2 determines the type of executable (.app, .dll ,.tsy). For executables, specify UID2 and UID3 on the UID line in the .mmp file.

UID3: is an application-level flag, the application's UID3 must be different from all other applications. Only Symbian can release these values. Get an email to Symbian, use 0x01000000 ~ 0x0fffffffFFF, but it is no longer used when publishing the experiment.

Symbian OS Use UID to associate documents (data files) and .aif files with their respective applications; UID3 is included in each data file, executable or .aif file head. However, executables and their components still need the correct file extension, otherwise they will not run correctly. When an application creates a document file, the application framework automatically merges all three UIDs and 32-bit checks the top 16 bytes of the header file.

(2) AIF file

Use the .aif file at runtime, and store data about the application. include:

A, two sizes icons

B, various functions, such as document embedding, new file establishment, hide applications, and priorities supported by MIME types.

C. Optionally use the application title (name) that supports language.

If there is no .aif file, the application will use the default icon to use the application name (omitted extension) as a title.

icon:

Grid and list view use 42 × 29 pixels icon, however the appearance panel of the status panel (displayed on the top of the screen when the application has focus).

Providing different icons can help ensure that the system can use the most appropriate size. If only one size is provided, it will be scaled and damage the icon quality.

This bitmap file format is called a multi-position diagram file format (.mbm), there is a corresponding tool AIFBuilder to design this bitmap.

AIF file localization:

If the application provides different icons according to different languages, saving each localized .aif file generated by using the extension .axx, the XX is two digital language code associated with the appropriate area.

title:

Series60 UI and Application Framework AVKON provides an optional feature associated with the title and application - compared to the functionality that is generally passed .AIF files, it should be prioritized. By default, the system will use the title in the .aif file. However, it is very likely that the application creates a separate title file, and the colleague contains normal length headers and short titles - short title for grid views, ordinary titles for list views. Get the title file with the method of creating a normal GUI resource file. For the HelloWorld project, the title source file is HelloWorld_CAption.RSS, using a binary output file for HelloWorld_CAption.RSC at runtime. If necessary, a separate title file can be generated for each language.

Additional rows are added to the application. MMP file:

Resource: helloworld_caption.rss

Third, .pkg file

The PKG file is also the installation package configuration file, which is the core part of making the Symbian OS installer. It contains all information required to make installation files. In order to generate .SIS file, you must write the .pkg file first. Therefore, the process of making the Symbian program installation file is actually mainly the process of writing a PKG file. Like Symbian's resource files, there is a complete syntax system, master the grammar of the PKG file, basically master most of the knowledge of the installation, so familiar with the structure of the PKG file, for the production installer, is very important.

Example (HelloWorld.PKG):

;

; Installation File for HelloWorld APPLICATION

;

Languages

& En

;

Uid is the app's uid

;

# {"HelloWorld"}, (0x0D0A2843), 1, 0, 0

;

Supports Series 60 V 2.0

This Line Indicates That This Installation Is for the Series 60 Platform V2.0

This Line Must Appear_exactly_ as shown Below in the sis file

; If this Line is Missing or IncorRect, The Sis File Will NOT BE ABLE

To be installed on series 60 v2.0 platforms

(0x101f7960), 0, 0, 0, {"series60productid"}

;

Four Files to Install

; Symbols Set Up for the Source Location Are Carbide.c Specific Symbols

"$ (EPOCROOT) EPOC32 / RELEASE / $ (Platform) / $ (Target) / HelloWorld.App" - "!: / System / apps / helloworld / helloworld.app"

"$ (EPOCROOT) EPOC32 / DATA / Z / System / Apps / HelloWorld / HelloWorld.RSC" - "!: / System / apps / helloworld / helloworld.rsc"

"$ (EPOCROOT) EPOC32 / DATA / Z / System / Apps / HelloWorld / HelloWorld_caption.RSC" - "!: / System / apps / helloworld / helloworld_caption.rsc"

"$ (EPOCROOT) EPOC32 / DATA / Z / System / Apps / HelloWorld / HelloWorld.Aif" - "!: / System / apps / helloworld / helloWorld.Aif"

This PKG file is complete, just adjust the file directory, you can use it.

Here are some explanations for each part of this file:

l The line starting with the semicolon is a comment. These annotations are mainly to the developer, and the generator will ignore them.

L & EN indicates the language used by the installer. EN means that the use of American English, the meaning of the specific code can be viewed in the SDK, which is not listed here. The SIS file supports multilingual installation, which can be set here, such as & en, fr, it, indicating that is multilingual. For multilingual installations, some grammar and rules correspond to it, please check the SDK for specific methods. If you just want to make a setup, you can use & en, but you need to ensure that the string part of the back appearance uses English letters.

L # {"HelloWorld"}, (0x0D0A2843), 1, 0, 0. This is the head of the standard Symbian SIS file. All PKG must contain this line and must be behind the language settings. HelloWorld is the name of the program, which may be used during installation. 0x0D0A2843, is the UID of the developer, the specific point is the number of the UID item in the MMP file. The next number is in turn is the main version number, the sub-version number, and the creation number, which are used for version control of the installer.

l (0x101f7960), 0, 0, 0, {"series60productid"}. This sentence explains the components that the program needs to be prepared before installation. It is actually a platform that must be a Series60. If other components are needed, they also need to be described here. 0x101f7960 is the UID of the component. It is actually a platform for S60 2.0. For the platform of S60 2.1, 0x101f9115.0, 0, 0 is the main secondary version number and creation number, Series60ProductID is when it is necessary Description text used to display the user. l The actual statement is the actual operation. The first double quotes are the source location of the file, which is only the location of the compiled file in the PC. You can use absolute positions or use relative positions like examples. The second double quotation is the location of the file in the target machine. "!:" Indicates which drive is selected by the user. If you do not want to specify by the user, you can use "C:", indicating that the C drive installed on the phone is below. The two line statements represent means that files of the specified location are copied to the specified location of the phone. There is also a lot of grammar, please check the SDK of S60.

转载请注明原文地址:https://www.9cbs.com/read-133123.html

New Post(0)