
ti® Apple® A/UX™ Programming Languages and Tools, Volume 2 Copyright Limited Warranty on Media and Replacement This material contains trade secrets and confidential and proprietary information of If you discover physical defects in the manu­ Apple Computer, Inc., and UniSoft Coipora­ als distributed with an Apple product or in the tion. Use of this copyright notice is precau­ media on which a software product is distri­ tionary only and does not imply publication. buted, Apple will replace the media or manu­ Copyright© 1985, 1986, 1987, Apple Com­ als at no charge to you, provided you return puter, Inc., and UniSoft Coiporation. All the item to be replaced with proof of purchase rights reserved. Portions of this document to Apple or an authorized Apple dealer during have been previously copyrighted by AT&T the 90-day period after you purchased the Information Systems and the Regents of the software. In addition, Apple will replace dam­ University of California and are reproduced aged software media and manuals for as long with permission. Under the copyright laws, as the software product is included in Apple's this manual or the software may not be Media Exchange Program. While not an copied, in whole or part, without written con­ upgrade or update method, this program sent of Apple or UniSoft, except in the normal offers additional protection for up to two use of the software or to make a backup copy years or more from the date of your original of the software. The same proprietary and purchase. See your authorized Apple dealer copyright notices must be affixed to any per­ for program coverage and details. In some mitted copies as were affixed to the original. countries the replacement period may be dif­ This exception does not allow copies to be ferent; check with your authorized Apple made for others, whether or not sold, but all dealer. of the material purchased (with all backup ALL IMPLIED WARRANTIES ON THE copies) may be sold, given, or loaned to MEDIA AND MANUALS, INCLUDING another person. Under the law, copying IMPLIED WARRANTIES OF MER­ includes translating into another language or CHANTABILITY AND FITNESS FOR A format. You may use the software on any PARTICULAR PURPOSE, ARE LIM­ computer owned by you, but extra copies can­ ITED IN DURATION TO NINETY (90) not be made for this puipose. DAYS FROM THE DATE OF THE ORI­ Apple Computer, Inc. GINAL RETAIL PURCHASE OF THIS 20525 Mariani Ave. PRODUCT. Cupertino, California 95014 Even though Apple has tested the software (408) 996-1010 and reviewed the documentation, APPLE Apple, the Apple logo, ImageWriter, Laser­ AND ITS SOFTWARE SUPPLIER MAKE Writer, and Macintosh are registered trade­ NO WARRANTIES OR REPRESENTA­ marks of Apple Computer, Inc. TIONS, EITHER EXPRESS OR IMPLIED, WITH RESPECT TO A/UX is a trademark of Apple Computer, Inc. SOFTWARE, ITS QUALITY, PERFOR­ UNIX is a registered trademark of AT&T MANCE, MERCHANTABILITY, OR Information Systems. FITNESS FOR A PARTICULAR PUR­ POSE. AS A RESULT, THIS SOFTWARE IS SOLD AS IS, AND YOU THE PUR­ CHASER ARE ASSUMING THE ENTIRE RISK AS TO ITS QUALITY AND PER­ FORMANCE. IN NO EVENT WILL APPLE OR ITS SOFTWARE SUPPLIER BE LIABLE FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT IN THE SOFTWARE OR ITS DOCUMENTATION, even if advised of the possibility of such damages. In particular, Apple and its software supplier shall have no liability for any programs or data stored in or used with Apple products, including the costs of recovering such programs or data. THE WARRANTY AND REMEDIES SET FORTH ABOVE ARE EXCLUSIVE AND IN LIEU OF ALL OTHERS, ORAL OR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer, agent, or employee is author­ ized to make any modification, extension, or addition to this warranty. Some states do not allow the exclusion or lim­ itation of implied warranties or liability for incidental or consequential damages, so the above limitation or exclusion may not apply to you. This warranty gives you specific legal rights, and you may also have other rights which vary from state to state. A/UX Programming Languages and Tools Volume 2 Contents Preface Chapter 16 make Reference Chapter 17 SCCS Reference Chapter 18 awk Reference Chapter 19 lex Reference Chapter 20 yacc Reference Chapter 21 be Reference Chapter22 de Reference Chapter 23 m4 Reference Chapter 24 curses Reference Chapter 25 Other Programming Tools Appendix A Additional Reading Preface Conventions Used in This Manual Throughout the A/UX manuals, words that must be typed exactly as shown or that would actually appear on the screen are in Courier type. Words that you must replace with actual values appear in italics (for example, user-name might have an actual value of j oe). Key names appear in CAPS (for example, RETURN). Special terms are in bold type when they are introduced; many of these terms are also defined in the glossary in the A!UX System Overview. Syntax notation All A/UX manuals use the following conventions to represent command syntax. A typical A/UX command has the form command fjlag-option] [argument] ... where: command Command name (the name of an executable file). flag-option One or more flag options. Historically, flag options have the form -[opt ... ] where opt is a letter representing an option. The form of flag options varies from program to program. Note that with respect to flag options, the notation [-a][-b][-c] means you can select one or more letters from the list enclosed in brackets. If you select more than one letter you use only one hyphen, for example, -ab. argument Represents an argument to the command, in this context usually a filename or symbols representing one or more filenames. [] Surround an optional item. Follows an argument that may be repeated any number of times. Courier type anywhere in the syntax diagram indicates that characters must be typed literally as shown. italics for an argument name indicates that a value must be supplied for that argument. Other conventions used in this manual are: <CR> indicates that the RETURN key must be pressed. An abbreviation for CONTROL-x, where x may be any key. cmd(sect) A cross-reference to an A/UX reference manual. cmd is the name of a command, program, or other facility, and sect is the section number where the entry resides. For example, cat(l). Chapter 16 make Reference Contents 1. make: a file production tool 1 2. Using make . 1 2.1 Writing a makefile 2 2.2 make command syntax 4 2.2.1 Flag options 5 2.2.2 Using make on individual files 6 3. The description file • • . 6 3.1 Makefile entries 6 3.1.1 Targets vs. rules 7 3.1.2 Fake targets 7 3.1.3 Dependency statements 8 3.1.4 Commands 9 3.2 Comments . • 10 3.3 inc1ude lines 10 3.4 Macro definitions 10 3.4.1 Internal macros 12 3.4.2 Dynamic dependency parameters 13 3 .5 Options • • • • • • • • . • 15 3.5.1 Suppressing printing of commands 15 3.5.2 Ignoring errors • • • 15 3.5.3 Combining commands 16 3.5.4 Default commands 17 3.5.5 Saving files • . • • • 17 3.5.6 Use of selected flag options 17 4. Suffixes and rules 18 4.1 Suffixes • • • • • • • • • 18 4.2 Transformation rules • • • • 19 4.2.1 The default macro settings 24 - i - 4.3 Changing default suffixes and rules 25 4.3.1 The default suffix list • 25 4.3.2 The default rules 25 5. Operation • • • • • • • 26 5.1 Environment variables 26 5.2 Precedence • • 27 5.3 Archive libraries . • 29 5.4 secs files . • • • • 32 5.4.1 SCCS filename prefixes • 32 5.4.2 SCCS filename suffixes 32 5.4.3 SCCS transformation rules 32 5.4.4 SCCS makefiles 33 6. Advanced topics . • • . • • 33 6.1 Walking the directory tree 33 6.2 The make predecessor tree . 35 6.3 The makefile as shell script • 36 6.3.1 Unintended targets 36 6.3.2 Mnemonic targets . 36 6.3.3 Macro translation . 37 6.4 A warning for system administrators 38 Figures Figure 16-1. A simple makefile 3 Figure 16-2. A makefile with multiple objects and defs .h file • • • • • • • • • • 3 Figure 16-3. Sample listing of default rules file 21 Figure 16-4. Replacing a default rule 26 Tables Table 16-1. Default suffix list • • • • • • 19 Table 16-2. Macro names and default compilers 24 - ii - Chapter 16 make Reference 1. make: a file production tool The make program automates the production of related sets of files. It simplifies the task of administering libraries, functions, related source and object files, and so on, that must reflect a change when you update one file in the set. Although make is normally used to maintain program code, it can also be used for other batch data processing activities (for example, make is often used to produce technical manuals with troff). make keeps track of program file dependencies; when you change one part of a program, make recompiles related files with a minimum amount of effort The required information is maintained by the make program itself (which has built-in "rules" for recompilation), by using certain system information such as the timestamp on the files, and by the description of operations kept in a file called the "description file" or "makefile." Once you have set up a makefile for a large project, make keeps track of your files for you and frees you to concentrate on programming or other tasks. 2. Using make The simplest use of make is make filel where a file named filel.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages370 Page
-
File Size-