PRODUCT(2)

Table of Contents

Name

product specifies information about an SDTool product

Synopsis

%product prodname [ -char ] [ arg ] [ file=filename ] [ usage=oneline-message ]
[ %do C code to execute if option is selected ] [ %otherwise C code to execute if option is not selected ]

Description

The product section of a source description file specifies information about an SDTool product. There may be any number of product sections in a source description file. An SDTool will create a file named prodname for each product section. This default can be overridden with the file clause, which specifies a file name for the product. The reserved filename > is used to output a product to standard output.

The SDTool will have a command line option for each product. By default the option character is the first character of the product name, but this can be overridden by the -char clause. If the option has an argument, the keyword arg must be used, and the argument will be stored in the agoptarg array (see OPTION(2) , VERSION(5) ). The default usage message, ``produces prodname'', can be replaced by using the usage clause.

By default an SDTool generates each product by calling a GEN_char(prodname) routine (see GEN_x(5) ). This routine first determines if the product already exists. If it does not, the product is simply generated. If it does exist, the product is generated in a temporary file and then compared with the previously existing version. If the products are identical then the temporary file is removed; otherwise the temporary file is moved to the product file. This conditional generation can be circumvented by using the -3 option or by explicitly selecting the products to be generated by using their command line option characters (see GENconditional in GEN_x(5) ). The default action can also be overridden with the do clause. There is no default otherwise action, but such an action can be added with the otherwise clause. The product description file that specifies the product must be named prodname.pd.

The options and products of an SDTool are processed in the order in which their option and product sections occur in the source description file, not in the order in which their option characters appear on the command line.

Examples

%product doc.mm

In the following example the product is produced in file prog.c. The product description file of prog.c is found in aprog.c.pd, and the product is selected by the -p option. %product aprog.c -p file=prog.c

In the following example the product is sent to standard output.
%product report file=> usage=output report %otherwise
reportinfo("No report printed; use -r option if report is desired\n");

See Also

OPTION(2)
GEN_x(5)
VERSION(5)


© 1990 Lucent Technologies, Inc
© 1998 Harmony Software, Inc