Clearmake主要適用於使用UNIX型的makefile的用戶,它本身兼容GNU make。 在執行建立腳本期間,clearmake在ClearCase的多版本文件系統下執行一個建立追蹤,它會記錄每個派生對象被構建時的信息。
使用Clearmake的優勢:
1). 它可以和clearcase配合,將生成的目標文件,庫文件和二進制文件(DO)共享;
2). 支持並行構建和分佈式構建,並行構建能夠同時執行多重編譯,分佈式構建允許用戶使用多臺機器完整構建步驟;
3). 可以生成配置記錄(config record),作審計用。
clearmake provides partial compatibility with GNU make. This section provides the details.
Supported GNU make Command Options
clearmake –C gnu supports most of the single-character and long-form spellings of GNU make command options, as follows:
Disables GNU's built-in rules (equivalent to gnumake –R).
Change to the specified directory before reading the makefiles.
Prints debugging information in addition to normal processing messages.
Gives variables taken from the environment precedence over variables from makefiles.
–f file – –file=file – –makefile=file
Reads file as a makefile.
Specifies a directory dir to search for included makefiles.
Ignores all errors in commands executed to remake files.
Specifies a directory in which to search for included makefiles.
Continues as much as possible after an error.
Eliminate use of built-in, rule-specific variables.
Disables printing of the working directory under –w.
–n – –just-print – –dry-run – –-recon
Prints the commands that would be executed, but does not execute them.
Prints the database (rules and variable values) that results from reading the makefiles, then executes as usual or as otherwise specified.
Question mode. Does not run any commands or print anything. Returns an exit status of 0 if the specified targets are already up to date, or 1 if any remaking is required.
Eliminates use of the built-in implicit rules.
Silent operation. Does not print the commands as they are executed.
Issues a warning whenever a reference to an undefined variable is found. Null warnings for VPATH and SHELL are suppressed by default; null warnings for these can be displayed using the clearmake options –v or –d.
Prints a message containing the working directory both before and after executing the makefile.
Unsupported GNU make Command-Line Options
The following options are not supported:
- -m
- -C dir
- -h --help
- -I dir
- -j [jobs] --jobs[=jobs]
- -l [load] --load-average[=load] --max-load[=load]
- -o file --old-file=file --assume-old=file
- -R (this is supported as –b)
- -S --no-keep-going --stop
- -t --touch
- -v --version
- -W file --what-if=file --new-file=file --assume-new=file
Supported GNU make Features
The following features are enabled with –C gnu (see the GNU make documentation):
ifeq ($(CC),gcc)
$(CC) -o foo $(objects) $(libs_for_gcc)
else
$(CC) -o foo $(objects) $(normal_libs)
endif
- Simply expanded variables in which the RHS is expanded once when the assignment is first scanned. For example:
- The += syntax to append to the value of a variable.
- The ?= macro operator.
- The use of $$ in target names as an equivalent to a literal $.
- Special characters ()<>;!=&|$#:”{}/ (UNIX) or ()<>;!=&|$#:” (Windows) within macro names
- Escaping special characters in target names by preceding them with a /. Note that the escaping must be consistent within the makefile. For example,
test: test#footest/#foo:
echo $@test: test#footest/#foo:
echo $@
generates a Don't know how to make error.
- Stripping leading sequences of ./ (UNIX) or ./ (Windows) from file names, so that (for example) ./file and file are considered the same target
- Variable references using pattern substitution:
- Text-manipulation functions:
$(subst FROM,TO,TEXT)
$(patsubst PATTERN,REPLACEMENT,TEXT)
$(strip STRING)
$(findstring FIND,IN)
$(filter PATTERN...,TEXT)
$(filter-out PATTERN...,TEXT)
$(sort LIST)
$(dir NAMES...)
$(notdir NAMES...)
$(suffix NAMES...)
$(basename NAMES...)
$(addsuffix SUFFIX,NAMES...)
$(addprefix PREFIX,NAMES...)
$(join LIST1,LIST2)
$(word N,TEXT)
$(words TEXT)
$(wordlist START, END, TEXT)
$(firstword NAMES...)
$(wildcard PATTERN)
$(foreach VAR,LIST,TEXT)
$(origin VARIABLE)
$(shell COMMAND)
- The VPATH variable for specifying a search path for every dependency.
Note: clearmake searches only in the current view. For more information, see the makefile_ccase reference page.
- The MAKECMDGOALS variable for specifying the targets given on the command line.
- The vpath statement for specifying a search path for a specified class of names.
- The export statement.
- The unexport directive.
- The .PHONY target declaration.
- All of GNU make's built-in implicit rules.
- Pattern rules. For example:
- Static pattern rules:
TARGETS ...: TARGET-PATTERN: DEP-PATTERNS ...
COMMANDS
...
- The automatic variables:
Also, their file-name and directory-name variants. For example:
- Multiline variable definition:
- Target-specific variable values:
target ... : variable-assignment
or
target ... : override variable-assignment
Unsupported GNU make Features
The following features are not supported:
- Automatic remaking of any makefiles that are declared as targets (you must explicitly rebuild them).
- The declarations .DELETE_ON_ERROR, .INTERMEDIATE, .SECONDARY.
- Automatic makefile regeneration and restart if the makefile and included makefile fragments are targets in the makefile itself.
- Automatic deletion of intermediate results of a chain of implicit-rules.
- Special search method for library dependencies written in the form -lNAME. For each directory on the VPATH/vpath list, GNU make searches in DIR/lib .
- When MAKEFILES is defined, GNU make considers its value as a list of names of additional makefiles to be read before the others, as though they were implicitly included.
- The following functions: