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> Programming make: Program Maintainer<br />

If a change to a file is absolutely certain to be benign (e.g., adding a new definition to<br />

an include file), the -t (touch) option can save a lot of time: instead of issuing a large<br />

nu mber of superfluous recompilations, make updates the modification times on the<br />

affected file. Thus, the command<br />

make -ts<br />

which stands for touch silently, causes the relevant files to appear up to date.<br />

The debugging option -d causes make to print out a very detailed description of what it<br />

is doing, including the file times. The output is verbose and is recommended only as a<br />

last resort.<br />

Using make: An Example<br />

As an example of the use of make, examine the makefile used to maintain the make<br />

program itself. The code for make is spread over a number of C source files and a yacc<br />

grammar.<br />

#Description fi le for the make command<br />

# Macro definiti ons below<br />

P = lpr<br />

FILES = Makefile vers.c defs main.c doname.c misc.c files.c dosys.c\<br />

gram.y lex.c<br />

OBJECTS = vers.o main.o ... dosys.o gram.o<br />

LIBES =<br />

LINT = lint -p<br />

CFLAGS = -0<br />

#targets: dependents<br />

##ITAB > actions<br />

make: ${OBJECTS)<br />

cc $(CFLAGS) $(OBJECTS) $(LIBES) -o make<br />

size make<br />

${OBJECTS): defs<br />

gram.o: lex.c<br />

cleanup:<br />

-rm *.o gram.c<br />

-du<br />

install:<br />

@size make /usr/bin/make<br />

cp make /usr/bin/make ; rm make<br />

4-13

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

Saved successfully!

Ooh no, something went wrong!