Before you start compiling a program or a series of units, it is important to know where the compiler looks for its source files and other files. In this section we discuss this, and we indicate how to influence this.
Remark: The use of slashes (/) and backslahses ( ) as directory separators is irrelevant, the compiler will convert to whatever character is used on the current operating system. Examples will be given using slashes, since this avoids problems on LINUX.
The file that you specify on the command line, such as in
ppc386 foo.ppwill be looked for ONLY in the current directory. If you specify a directory in the filename, then the compiler will look in that directory:
ppc386 subdir/foo.ppwill look for foo.pp in the subdirectory subdir of the current directory.
Under LINUX, the name of this file is case sensitive, under other operating systems (DOS, WINDOWSNT, OS/2) this is not the case.
When you compile a unit or program that needs other units, the compiler will look for compiled versions of these units in the following way:
On LINUX, the compiler will first convert the filename of a unit to all-lowercase. This is necessary, since Pascal is case-independent, and the statements Uses Unit1; or uses unit1; should have the same effect. Also, unit names that are longer than 8 characters will first be looked for with their full length. If the unit is not found with this name, the name will be truncated to 8 characters, and the compiler will look again in the same directories, but with the truncated name.
For instance, suppose that the file foo.pp needs the unit bar. Then the command
ppc386 -Up.. -Upunits foo.ppwill tell the compiler to look for the unit bar in the following places:
If the compiler finds the unit it needs, it will look for the source file of this unit in the same directory where it found the unit. If it finds the source of the unit, then it will compare the file times. If the source file was modified more recent than the unit file, the compiler will attempt to recompile the unit with this source file.
If the compiler doesn't find a compiled version of the unit, or when the -B option is specified, then the compiler will look in the same manner for the unit source file, and attempt to recompile it.
It is recommended to set the unit search path in the configuration file ppc386.cfg. If you do this, you don't need to specify the unit search path on the command-line every time you want to compile something.