BUILDING HMG APPLICATIONS

 Build.Bat / HMG-IDE

 

 

 

- BUILD.BAT

 

      The easiest way is to use the Build.Bat file located at HMG root folder.

 

      Usage:

 

             Build [ /n ] [ /d ] [ /c ] <program.prg> | <project.hbp> [<hbmk2 params>]

 

                [/n] :  No run after build

                [/d] :  Enabled debugger

                [/c] :  Console mode

 

 

      <program.prg>  : A main text file containing your source code.

     

      <filelist.hbp> : A text file with .hbp extension containing a source list.

     

      <hbmk2 params> : A text file with configuration parameters as additional libs, include paths and lib paths.

This is also informed the .hbc file of your project.

 

                       For example:

                              incpaths = incpath1 incpath2 ... incpathn

                              libpaths = libpath1 libpath2 ... libpathn

                              libs = lib1 lib2 ... libn

                              mt = 'yes' (multi-threading support)

 

 

See sample at: ..\SAMPLES\Basics\MULTIPRG

 

Notes:

 

·         Library names must not include 'lib' prefix nor '.a' extension.

 

·         Build.bat will create an error.log file in the app folder when build process ends with an error condition.

 

·         If in case of no parameter has been informed, any action is going to happen using the main Build.bat at HMG folder. Some Build.bat at C:\HMG..\SAMPLES will accept to compile even without any parameter because it will acts according all hbp files in the current folder. In this case, all files in the current folder are automatically be processed.

 

·         To build projects with long names option.

Spaces at folders and prg files names normally is not required, but sometimes we would like to use in that way. Since on hmg 3.3.0 version, have been implemented for Build.bat and this works perfectly.

 

Example at dot command (see below in red color example):

 

Build "My Project" (must be in quoted)

 

§  This is regarding being possible for: hbp file, prg file or project folder names.

 

§  Not only used for your main prg, also for others prgs files with spaces.

 

§  But all files/folders with long names, must be always in quoted and saved at hbp file.

 

For hbp file: "My Project.hbp"

For prg file: "My Main.prg"

For project folder: "My Main"

 

§  For old projects will still keep it original names at least you want to change with spaces on it and re-build it with adding quotation marks.

 

§  Executable files with long names (spaces included) is created normally and also at project folder with long name.

 

§  This feature is not yet workable at IDE building because IDE needs to adjust for hbp creation with quotation marks.

 

 

·         To Build apps making executable file copy in a second place.

 

When we compile our application we do it in an appropriate folder where we keep the source code of the project. But we often need to copy the executable that was generated for the right system folder (in use), i.e. where the data files are placed. So in that case we will need to use Windows Explorer to copy/paste the executable in that one.

 

To simplify this procedure we can automatize by edting your <Project_name>.hbc file and add this:

 

instpaths="c:\In other place\Sys\" (with slash bar at end of full path)

 

This is a hbc directives from Harbour to copy the target to <path>. If <path> is a directory, must end with path separator. This can be specified multiple times.

  

 

- HMG IDE

 

This programming environment allows visual form editing and application build.

 

Environment settings (HMG Folder, Program Editor, etc.) are stored in '.ini' files, located at IDE folder.

You can interactively change default settings (Main Menu->Tools->Preferences).

 

In IDE, all build customizations must be handled by the user from 'Configuration' (project browser) tab. It is direct edit of the project .hbc file.

Look at hbmk2 help for details. By default two gt drivers are ALWAYS linked:

 

·         GTGUI (as default) and GTWIN (Windows console)

 

·         You can compile pure console adding gui='no' (in quotes)

 

 

 

·           To Build apps making executable file copy in a second place at IDE, you will need write instpaths="¦ in Project Browser/Configuration as follows:

 

 

·         To create apps console/mixed mode, you only need to add this followinq command (red color):

REQUEST  HB_GT_WIN_DEFAULT (at top of your main prg file).

 

See example:

 

REQUEST HB_GT_WIN_DEFAULT
 
Function Main()
SetMode(25,80)
 
Cls
?
@ 10,10 Say 'Hello'
 
Alert('Hello')
Return Nil
   

 

Screenshot

1

 

Tip:

 

When upgrading HMG, please clean previous build data from your projects using incremental building, use

the 'Reset project incremental data' option from the project menu.