Previous Section
3.3 Using MASM as default assembler
| Contents | Next Section
Contents

4. The Project File Format


Here is a sample HPR file.
I'll walk through the section one at a time.

[HPR Settings]
mainfile=a-test.hla
flags=0
Project Type=0
Project Version=5

[KHLA Settings]
UseCustomLink=true
GenerateLinkResponse=true
Verbose=false
Map=false
Symbol=false
Test=false
CompileTo=exe
ObjectType=coff
Assembler=fasm
Resource=porc
Linker=polink
Library=polib
LinkSystem=console
CleanTemp=true
ExeName=a-test.exe

[Link]
-heap:0xF4240,0xF4240
-stack:0xF4240,0xF4240
-base:0x4000000
-entry:HLAMain
-fixed
-section:.data,RW
-section:.text,ERW
-machine:ix86
kernel32.lib
user32.lib
gdi32.lib

[HPR Files]
a-test.hla,1
hidelib.lib,3
consoleunit.hla,6
consoleunit.hhf,5
debug.lib,3
comdlg32.lib,3

[BUILD]
#consoleunit.hla
#a-test.hla
#link

[a-test.hla]
@a-test.obj a-test.hla
KHLA -xpf -u:a-test.hpr -c a-test.hla

[link]
KHLA -u:a-test.hpr

[Process Files]
a-test.obj
hidelib.lib
consoleunit.obj
debug.lib
comdlg32.lib

[consoleunit.hla]
@consoleunit.obj consoleunit.hla
KHLA -xpf -u:a-test.hpr -c consoleunit.hla

[Defines]
debug



[HPR Settings]
mainfile=a-test.hla
flags=0
Project Type=0b
Project Version=5

This section gives HIDE some detailes on how to treat this project.

Mainfile
This is typically the first file created in the project and consists of the <project name>.hla

Flags
This variable tells HIDE which folders were created with the project. Messing with this may result in HIDE being unable to find necessary folders such as src, res, units, temp, etc.

Projekt Type
This identifies the Project Type selected during project creation. Usually identifies project as Console PE, Windows PE, library or dll.

Project Version
Automatically updating changes to the project file format.

[KHLA Settings]
UseCustomLink=true
GenerateLinkResponse=true
Verbose=false
Map=false
Symbol=false
Test=false
CompileTo=exe
ObjectType=coff
Assembler=fasm
Resource=porc
Linker=polink
Library=polib
LinkSystem=console
CleanTemp=true
ExeName=a-test.exe

These are settings khla looks for as build options:
UseCustomLink instructs khla to use the [Link] section for generatign a linker response file.
This is followed by various HLA options - these can be set in the Compiler Settings dialog.
Assembler, Resource, Linker und Library determine which 3rd party tools to call for each phase of compilation.
LinkSystem is the output type.
CleanTemp wether or not to keep the temporary intermediate files.
This too can be set from the Compiler Settings dialog.
ExeName is the output name given to the build.


[Link]
-heap:0xF4240,0xF4240
-stack:0xF4240,0xF4240
-base:0x4000000
-entry:HLAMain
-fixed
-section:.data,RW
-section:.text,ERW
-machine:ix86
kernel32.lib
user32.lib
gdi32.lib

The "UseCustomLink=true" above tells khla to generate the linker response file as shown in this section, rather than the default one generated by HLA. Most of these can be set from the "Compiler Settings" "Advanced" dialog.

[HPR Files]
a-test.hla,1
hidelib.lib,3
consoleunit.hla,6
consoleunit.hhf,5
debug.lib,3
comdlg32.lib,3

This section identifies all the files added to the project and the type of file.

[BUILD]
#consoleunit.hla
#a-test.hla
#link

This is the heart of the machine. The section execution order. This tells kmake to run all the commands in the sections listed.

[a-test.hla]
@a-test.obj a-test.hla
KHLA -xpf -u:a-test.hpr -c a-test.hla

This is one of the sections executed. kmake determines if a build is necessary (the '@' command), if so, it runs the next line - to build a-test.hla object file. The command line may appear cryptic: It simply informs khla to ignore the [Process Files] section for this iteration, and to use the [KHLA Settings] in the a-test.hpr file for its options settings.
[link]
KHLA -u:a-test.hpr

[Process Files]
a-test.obj
hidelib.lib
consoleunit.obj
debug.lib
comdlg32.lib

The final step, the [link] section (note lowercase l) informs khla to "use" the [Process Files] section. This links together all the files found here and in the linker response file.

[Defines]
Debug

This section determines what global declarations to send to the HLA compiler. In this case, the setting for "debug" was automatic when the user selects "Debug" as the "Output Version" in the Compiler Settings dialog.