09.06.2013 Views

Intel XENIX 286 Programmers Guide (86) - Tenox.tc

Intel XENIX 286 Programmers Guide (86) - Tenox.tc

Intel XENIX 286 Programmers Guide (86) - Tenox.tc

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>XENIX</strong> Programm ing<br />

.s Assembler source file<br />

.y Yacc-C source grammar<br />

.yr Yacc-Ratfor source grammar<br />

.1 Lex source grammar<br />

make: Program Maintainer<br />

For example, if the file x.o is needed and there is an x.c in the description or directory,<br />

x.c is compiled. If there is also an x.l, that grammar would be run through lex before<br />

compiling the result.<br />

The built-in rules are designed to reduce the size of your makefiles. They provide the<br />

rules for creating common files from typical dependents. Reconsider the example given<br />

in the section "Creating a Makefile." In this example, the program prog depended on<br />

three object files, x.o, y.o, and z.o. These files in turn depended on the C language<br />

source files x.c, y.c, and z.c. The files x.c and y.c also depended on the include file<br />

defs. In the original example each dependency and corresponding command sequence<br />

was explicitly given. Many of these dependency lines were unnecessary, since the builtin<br />

rules could have been used instead. The following is all that is needed to show the<br />

relationships between these files:<br />

prog: x.o y.o z.o<br />

cc x.o y.o z.o -o prog<br />

x.o y.o: defs<br />

In this makefile, prog depends on three object files, and an explicit com mand is given<br />

showing how to update prog. However, the second line merely shows that two object<br />

files depend on the include file defs. No explicit command sequence is given on how to<br />

update these files if necessary. Instead, make uses the built-in rules to locate the<br />

desired C source files, compile these files, and create the necessary object files.<br />

Changing the Built-In Rules<br />

You can change the built-in rules by redefining the macros used in these lines or by<br />

redefining the commands associated with the rules. You can display a complete list of<br />

the built-in rules and the macros used in the rules by typing<br />

make -fp - 2 >ldev/null

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!