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.
clearmake –C gnu supports most of the single-character and long-form spellings of GNU make command options, as follows:
–b
Disables GNU's built-in rules (equivalent to gnumake –R).
– –directory=dir
Change to the specified directory before reading the makefiles.
–d – –debug
Prints debugging information in addition to normal processing messages.
–e – –environment-override
Gives variables taken from the environment precedence over variables from makefiles.
–f file – –file=file – –makefile=file
Reads file as a makefile.
–I dir
Specifies a directory dir to search for included makefiles.
–i – –ignore-errors
Ignores all errors in commands executed to remake files.
– –include-dir=dir
Specifies a directory in which to search for included makefiles.
–k – –keep-going
Continues as much as possible after an error.
– –no-builtin-variables
Eliminate use of built-in, rule-specific variables.
– –-no-print-directory
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.
–p – –print-data-base
Prints the database (rules and variable values) that results from reading the makefiles, then executes as usual or as otherwise specified.
–q – –question
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.
–r – –no-builtin-rules
Eliminates use of the built-in implicit rules.
–s – –silent – –quiet
Silent operation. Does not print the commands as they are executed.
– –warn-undefined-variables
Issues a warning whenever a reference to an undefined variable is found. Null warnings for VPATH and SHELLare suppressed by default; null warnings for these can be displayed using the clearmake options –v or –d.
–w – –print-directory
Prints a message containing the working directory both before and after executing the makefile.
The following options are not supported:
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
y := $(x) bar
test: test#footest/#foo:
echo $@test: test#footest/#foo:
echo $@
generates a Don't know how to make error.
${VAR:PATTERN_1=PATTERN_2}
$(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)
Note: clearmake searches only in the current view. For more information, see the makefile_ccase reference page.
%.o : %.c
COMMANDS
...
TARGETS ...: TARGET-PATTERN: DEP-PATTERNS ...
COMMANDS
...
$@ $* $< $% $? $^ $+
Also, their file-name and directory-name variants. For example:
$(@F) $(@D) ...
define VAR
TEXT
...
endef
target ... : variable-assignment
or
target ... : override variable-assignment
The following features are not supported: