Intel XENIX 286 Programmers Guide (86) - Tenox.tc
Intel XENIX 286 Programmers Guide (86) - Tenox.tc Intel XENIX 286 Programmers Guide (86) - Tenox.tc
XENIX Programming make: Program Maintainer Invoking make Once you have a makefile and wish to update and modify one or more target files in the directory, you can invoke make by typing its name and optional arguments. The invocation has the form make [ option ] ... [ macdef] ... [ target] ... where option is a program option used to modify program operation, macdef is a macro definition used to give a macro a value or meaning, and target is the file name of a file to be updated. target must correspond to one of the target names in the makefile. All arguments are optional. If you give more than one argument, you must separate them with spaces. You can direct make to update the first target file in the makefile by typing just the program name "make". In this case, make searches for one of the files makefile, Makefile, s.makefile, or s. Makefile in the current directory and uses the first one it finds as the makefile. For example, assume that the current makefile contains the dependency lines given in the last section. Then the com mand make compares the modification dates of the prog program and each of the object files x.o, y.o, and z.o and recreates prog if any changes have been made to any object file since prog was last created. It also compares the modified dates of the object files with those of the four source files, x.c, y.c, z.c, and defs, and recreates the object files if the source files have changed. It does this before recreating prog so that the recreated object files can be used to recreate prog. If none of the source or object files has been altered since the last time prog was made, make announces this fact and stops. No files are changed. You can direct make to update a given target file by giving the file name of the target. For example, make x.o causes make to recompile the x.o file if the x.c or defs files have changed since the object file was last created. Sim ilarly, the command make x.o z.o causes make to recompile x.o and z.o if the corresponding dependents have been modified. make processes target names from the command line in a left-to-right order. You can specify the name of the makefile you wish make to use by giving the -f option in the invocation. The option has the form -f filename where filename is the name of the makefile. You must supply a full path name if the file is not in the current directory. For example, the command make -f makeprog 4-3
make: Program Maintainer XENIX Programming reads the dependency lines of the makefile named makeprog found in the current directory. You can direct make to read dependency lines from the standard input by giving "- " as the file name. make will read the standard input until end-of-file is encountered. You may use program options to modify the operation of the make program. The following list describes some of the options: -p Prints the complete set of macro definitions and dependency lines in a makefile. -i Ignores errors returned by XENIX commands. -k Abandons work on the current entry but continues on other branches that do not depend on that entry. -s Executes commands without displaying them. -r Ignores the built-in rules. -n Displays commands but does not execute them. make -n even displays lines beginning with the at sign (@). -e Ignores any macro definitions that attempt to assign new values to the shell's environment variables. -t Changes the modification date of each target file without recreating the files. Note that make executes each command in the makefile by passing it to a separate invocation of a shell. Because each command line is passed to a separate invocation of the shell, care must be taken with certain commands (e.g., cd and shell control commands) that have meaning only within a single shell process; the results are forgotten before the next line is executed. If an error occurs, make norm ally stops the command. Using Pseudo-Target Names It is often useful to include dependency lines that have pseudo-target names, i.e., names for which no files actually exist or are produced. Pseudo-target names allow make to perform tasks not directly connected with the creation of a program, such as deleting old files or printing copies of source files. For example, the following dependency line removes old copies of the given object files when the pseudo-target name "cleanup" is given in the invocation of make. cleanup : rm x.o y.o z.o Since no file exists for a given pseudo-target name, the target is always assumed to be out of date. Thus the associated command is always executed. 4-4
- Page 3 and 4: The information in this document is
- Page 5 and 6: Table of Contents CONTENTS Compiler
- Page 7 and 8: Table of Contents CONTENTS Using Ot
- Page 9 and 10: Table of Contents CONTENTS Assemble
- Page 11 and 12: Table of Contents CONTENTS CHAPTER
- Page 13 and 14: Table of Contents TABLES TABLE TITL
- Page 15 and 16: Introduction XENIX Programming 10.
- Page 17 and 18: cc: C Compiler XENIX Programming Cr
- Page 19 and 20: cc: C Compiler XENIX Programming Th
- Page 21 and 22: cc: C Compiler XENIX Programming Th
- Page 23 and 24: cc: C Compiler XENIX Programming Cr
- Page 25 and 26: cc: C Compiler XENIX Programming Th
- Page 27 and 28: cc: C Compiler XENIX Programming Co
- Page 29 and 30: cc: C Compiler XENIX Programming Sa
- Page 31 and 32: cc: C Compiler XENIX Programming Us
- Page 33 and 34: cc: C Compiler XENIX Programming Wh
- Page 35 and 36: cc: C Compiler XENIX Programming Co
- Page 37 and 38: cc: C Compiler XENIX Programming d
- Page 39 and 40: cc: C Compiler XENIX Programming Se
- Page 41 and 42: lint: C Program Checker XENIX Progr
- Page 43 and 44: lint: C Program Checker XENIX Progr
- Page 45 and 46: lint: C Program Checker XENIX Progr
- Page 47 and 48: lint: C Program Checker XENIX Progr
- Page 49 and 50: lint: C Program Checker XENIX Progr
- Page 51 and 52: lint: C Program Checker XENIX Progr
- Page 53: make: Program Maintainer XENIX Prog
- Page 57 and 58: make: Program Maintainer XENIX Prog
- Page 59 and 60: make: Program Maintainer XENIX Prog
- Page 61 and 62: make: Program Maintainer XENIX Prog
- Page 63 and 64: make: Program Maintainer XENIX Prog
- Page 65 and 66: make: Program Maintainer print: $(F
- Page 67 and 68: SCCS: Source Code Control System XE
- Page 69 and 70: SCCS: Source Code Control System XE
- Page 71 and 72: SCCS: Source Code Control System XE
- Page 73 and 74: SCCS: Source Code Control System XE
- Page 75 and 76: SCCS: Source Code Control System XE
- Page 77 and 78: SCCS: Source Code Control System XE
- Page 79 and 80: SCCS: Source Code Control System XE
- Page 81 and 82: SCCS: Source Code Control System XE
- Page 83 and 84: SCCS: Source Code Control System XE
- Page 85 and 86: SCCS: Source Code Control System XE
- Page 87 and 88: SCCS: Source Code Control System XE
- Page 89 and 90: SCCS: Source Code Control System XE
- Page 91 and 92: SCCS: Source Code Control System XE
- Page 93 and 94: SCCS: Source Code Control System XE
- Page 95 and 96: SCCS: Source Code Control System XE
- Page 98 and 99: CHAPTER 6 adb: PROGRAM DEBUGGER adb
- Page 100 and 101: XENIX Programming adb: Program Debu
- Page 102 and 103: XENIX Programming adb: Program Debu
make: Program Maintainer <strong>XENIX</strong> Programming<br />
reads the dependency lines of the makefile named makeprog found in the current<br />
directory. You can direct make to read dependency lines from the standard input by<br />
giving "- " as the file name. make will read the standard input until end-of-file is<br />
encountered.<br />
You may use program options to modify the operation of the make program. The<br />
following list describes some of the options:<br />
-p Prints the complete set of macro definitions and dependency lines in a makefile.<br />
-i Ignores errors returned by <strong>XENIX</strong> commands.<br />
-k Abandons work on the current entry but continues on other branches that do not<br />
depend on that entry.<br />
-s Executes commands without displaying them.<br />
-r Ignores the built-in rules.<br />
-n Displays commands but does not execute them. make -n even displays lines<br />
beginning with the at sign (@).<br />
-e Ignores any macro definitions that attempt to assign new values to the shell's<br />
environment variables.<br />
-t Changes the modification date of each target file without recreating the files.<br />
Note that make executes each command in the makefile by passing it to a separate<br />
invocation of a shell. Because each command line is passed to a separate invocation of<br />
the shell, care must be taken with certain commands (e.g., cd and shell control<br />
commands) that have meaning only within a single shell process; the results are<br />
forgotten before the next line is executed. If an error occurs, make norm ally stops the<br />
command.<br />
Using Pseudo-Target Names<br />
It is often useful to include dependency lines that have pseudo-target names, i.e., names<br />
for which no files actually exist or are produced. Pseudo-target names allow make to<br />
perform tasks not directly connected with the creation of a program, such as deleting<br />
old files or printing copies of source files. For example, the following dependency line<br />
removes old copies of the given object files when the pseudo-target name "cleanup" is<br />
given in the invocation of make.<br />
cleanup :<br />
rm x.o y.o z.o<br />
Since no file exists for a given pseudo-target name, the target is always assumed to be<br />
out of date. Thus the associated command is always executed.<br />
4-4