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 make also has built-in pseudo-target names that modify its operation. The pseudotarget name ".IGNO RE" causes make to ignore errors during execution of commands, allowing make to continue after an error. This is the same as the -i option. (make also ignores errors for a given command if the command string begins with a hyphen (-).) The pseudo-target name ".DEFAULT" defines the commands to be executed when no built-in rule or user-defined dependency line exists for the given target. You may give any number of commands with this name. If ".DEFAULT" is not used and an undefined target is given, make prints a message and stops. The pseudo-target name ".PRECIOUS" prevents dependents of the current target from being deleted when make is terminated using the INTERRUPT or QUIT key, and the pseudo-target name ".SILENT" has the same effect as the -s option. Using Macros An important feature of a makefile is that it can contain macros. A macro is a short name that represents a file name or command option. The macros can be defined when you invoke make or in the makefile itself. A macro definition is a line containing an equal sign not preceded by a colon or a tab. The name (string of letters and digits) to the left of the equal sign (trailing blanks and tabs are stripped) is assigned the string of characters following the equal sign (leading blanks and tabs are stripped). The following are valid macro definitions: 2 = xyz abc = -II -ly LIBES = The last definition assigns "LIBES" the null string. A macro that is never explicitly defined has the null string as its value. A macro is invoked by preceding the name by a dollar sign; macro names longer than one character must be placed in parentheses. The name of the macro is either the single character after the dollar sign or a name inside parentheses. The following are valid macro invocations: $(CFLAGS) $2 $(xy) $Z $(Z) The last two invocations are identical. 4-5
make: Program Maintainer XENIX Programming Macros are typically used as placeholders for values that may change from time to time. For example, the following makefile uses two macros for the names of object files to be linked and for the name of the library. OBJECTS = x.o y.o z.o LIBES = -lin prog: $(OBJECTS) cc $(OBJECTS) $(LIBES) -o prog If this makefile is invoked with the command make it will link the three object files with the lex library specified with the -lin switch. You may include a macro definition in a command line. A macro definition argument has the same form as a macro definition in a makefile. Macros in a command line override corresponding definitions found in the makefile. For example, the command make "LIBES = -lin -lm" assigns the library options -lin and -lm to LIBES. (It is necessary to quote argu ments with embedded blanks in XENIX commands.) You can modify all or part of the value generated from a macro invocation without changing the macro itself by using the substitution sequence. The sequence has the form name : st1 = [ st2 1 where name is the name of the macro whose value is to be modified, stl is the character or characters to be modified, and st2 is the character or characters to replace the modified characters. If st2 is not given, st l is replaced by a null character. The substitution sequence is typically used to allow user-defined metacharacters in a makefile. For example, suppose that ".x" is to be used as a metacharacter for a prefix and suppose that a makefile contains the definition Fl LES = prog 1.x prog2.x prog3.x Then the macro invocation $(FILES : .x = .o) generates the value prog1.o prog2.o prog3.o The actual value of FILES remains unchanged. 4-6
- 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 and 54: make: Program Maintainer XENIX Prog
- Page 55: 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
- Page 104 and 105: XENIX Programming adb: Program Debu
make: Program Maintainer <strong>XENIX</strong> Programming<br />
Macros are typically used as placeholders for values that may change from time to time.<br />
For example, the following makefile uses two macros for the names of object files to be<br />
linked and for the name of the library.<br />
OBJECTS = x.o y.o z.o<br />
LIBES = -lin<br />
prog: $(OBJECTS)<br />
cc $(OBJECTS) $(LIBES) -o prog<br />
If this makefile is invoked with the command<br />
make<br />
it will link the three object files with the lex library specified with the -lin swi<strong>tc</strong>h.<br />
You may include a macro definition in a command line. A macro definition argument<br />
has the same form as a macro definition in a makefile. Macros in a command line<br />
override corresponding definitions found in the makefile. For example, the command<br />
make "LIBES = -lin -lm"<br />
assigns the library options -lin and -lm to LIBES. (It is necessary to quote argu ments<br />
with embedded blanks in <strong>XENIX</strong> commands.)<br />
You can modify all or part of the value generated from a macro invocation without<br />
changing the macro itself by using the substitution sequence. The sequence has the<br />
form<br />
name : st1 = [ st2 1<br />
where name is the name of the macro whose value is to be modified, stl is the character<br />
or characters to be modified, and st2 is the character or characters to replace the<br />
modified characters. If st2 is not given, st l is replaced by a null character.<br />
The substitution sequence is typically used to allow user-defined metacharacters in a<br />
makefile. For example, suppose that ".x" is to be used as a metacharacter for a prefix<br />
and suppose that a makefile contains the definition<br />
Fl LES = prog 1.x prog2.x prog3.x<br />
Then the macro invocation<br />
$(FILES : .x = .o)<br />
generates the value<br />
prog1.o prog2.o prog3.o<br />
The actual value of FILES remains unchanged.<br />
4-6