2.3 Initialization Files and Makefiles

omake reads its instructions from an initialization file, which holds instructions used to customize the general operation of omake, and from a makefile, which has instructions for a specific project.

The Initialization File

The initialization file contains instructions for all make programs and is used to customize the operation of omake. omake reads the initialization file, ccase-home-dir\bin\make.ini, whenever it starts up.

The initialization file contains targets, inference rules, and macro definitions that you do not want to duplicate in every makefile, and it is used to customize the operation of omake. The initialization file is processed like a makefile, with the following exceptions:

The Makefile

The makefile has instructions for a specific project. The default name of the makefile is literally makefile, but you can specify a different name with the -f option. The -f file command-line option names the makefile, and several -f options can be given; each makefile is read in the order it appears on the command line. If there are no -f command-line options, omake tries the file named makefile. If it doesn't exist, omake tries makefile.mak.

Continued Lines

Lines in the makefile can be very long; the total makefile line length is limited only by available memory. For easier reading, a long line can be broken up by typing \<ENTER> after part of the line and typing the rest of the logical line on the next physical line of the makefile. For example, the line

first_part_of_line second_part_of_line

is the same as

first_part_of_line \
second_part_of_line

To have the backslash (\) as the last character on the line, use \\<ENTER> or \<SPACE>,<ENTER>.

Comments

The simplest makefile statement is a comment, which begins with the comment character (#). Everything on a makefile line after the # is ignored. Use \# for a literal # character. The following large comment may appear in a makefile to describe its contents:

#
# Makefile for omake
#
# Compiler: Microsoft Visual C++ 5.0
# Linker: Microsoft(R) 32-Bit Incremental Linker Version 5.00.7022a
#

The comment character can also be used at the end of another makefile statement:

some makefile statement # a comment

If \<ENTER> appears on a commented line, the comment acts until the end of the line and the following line is still continued. The following examples are equivalent:

line_one \
line_two # more_line_two \
line_three

line_one line_two line_three

Contents of Initialization Files and Makefiles

With a few exceptions, the initialization file holds the same kind of information as a makefile. Both the initialization file and makefiles consist of these components:

These components are described in the following sections.