Harbour · hbmk2

Harbour hbmk2 Configuration Files

Automatic processing of hbmk.hbc and hbmk.hbm

This document explains how hbmk2 processes the two configuration files hbmk.hbc and hbmk.hbm when they are present. The descriptions below follow the behavior and location information provided for these files.

1hbmk.hbc: Standard .hbc configuration file

hbmk.hbc is the standard .hbc configuration file. It is processed automatically if it exists in one of the possible locations listed below.

Possible locations, in the stated order of precedence:

  1. %APPDATA%\.harbour
  2. <hbmk2 directory>

When hbmk2 finds this standard configuration file in the applicable location, it processes the file automatically as part of its configuration handling.

2hbmk.hbm: Optional current-working-directory configuration

hbmk.hbm is an optional .hbm file located in the current working directory. If this file exists in that directory, hbmk2 processes it automatically before other options.

The current working directory is the directory from which the hbmk2 process is running. It is not necessarily the directory containing the .hbp file: that depends on how hbmk2 was launched.

3When the files are in the project folder

Consider a project folder containing the following files:

MyProject\
  MyProject.hbp
  hbmk.hbc
  hbmk.hbm
  main.prg

If hbmk2 is started with MyProject as its current working directory, the hbmk.hbm file in that folder is automatically processed before the other options. The hbmk.hbc file is processed automatically only if its location matches one of the applicable hbmk.hbc search locations listed in Section 1.

If hbmk2 is started from a different current working directory, the presence of hbmk.hbm beside the .hbp file does not, by itself, establish that hbmk2 will process that particular file. The working directory used for the hbmk2 process is the relevant location for hbmk.hbm.

4Summary

FileWhere hbmk2 looksProcessing behavior
hbmk.hbc%APPDATA%\.harbour; <hbmk2 directory>Standard .hbc file; processed automatically if it exists in an applicable location.
hbmk.hbmCurrent working directoryOptional .hbm file; processed automatically before other options.
Important distinction. The two files are discovered through different location rules. hbmk.hbc uses the stated standard configuration locations, while hbmk.hbm is associated with hbmk2's current working directory and is processed before other options.
Scope note: This document describes only the automatic discovery and processing behavior stated above. It does not specify how individual options from these files interact with, override, or combine with options from an .hbp file or command line.