Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   make.1p    ( 1 )

поддерживать, обновлять и восстанавливать группы программ (РАЗРАБОТКА) (maintain, update, and regenerate groups of programs (DEVELOPMENT))

Примеры (Examples)

1. The following command:

make

makes the first target found in the makefile.

2. The following command:

make junk

makes the target junk.

3. The following makefile says that pgm depends on two files, a.o and b.o, and that they in turn depend on their corresponding source files (a.c and b.c), and a common file incl.h:

.POSIX: pgm: a.o b.o c99 a.o b.o -o pgm a.o: incl.h a.c c99 -c a.c b.o: incl.h b.c c99 -c b.c

4. An example for making optimized .o files from .c files is:

.c.o: c99 -c -O 1 $*.c

or:

.c.o: c99 -c -O 1 $<

5. The most common use of the archive interface follows. Here, it is assumed that the source files are all C-language source:

lib: lib(file1.o) lib(file2.o) lib(file3.o) @echo lib is now up-to-date

The .c.a rule is used to make file1.o, file2.o, and file3.o and insert them into lib.

The treatment of escaped <newline> characters throughout the makefile is historical practice. For example, the inference rule:

.c.o\ :

works, and the macro:

f= bar baz\ biz a: echo ==$f==

echoes "==bar baz biz==".

If $? were:

/usr/include/stdio.h /usr/include/unistd.h foo.h

then $(?D) would be:

/usr/include /usr/include .

and $(?F) would be:

stdio.h unistd.h foo.h

6. The contents of the built-in rules can be viewed by running:

make -p -f /dev/null 2>/dev/null