make - make Utility This chapter describes the make...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
143 make Utility 4 This chapter describes the make utility, which includes: Hidden dependency checking Command dependency checking Pattern-matching rules Automatic retrieval of SCCS files This version of the make utility runs successfully with makefiles written for previous versions of make . Makefiles that rely on enhancements may not be compatible with other versions of this utility (see Appendix A, “System V make” for more information on previous versions of make). Refer to “make Enhancements Summary” on page 216 for a complete summary of enhancements and compatibility issues. make streamlines the process of generating and maintaining object files and executable programs. It helps you to compile programs consistently and eliminates unnecessary recompilation of modules that are unaffected by source code changes. make provides features that simplify compilations. You can also use it to automate any complicated or repetitive task that is not interactive. You can use make to update and maintain object libraries, to run test suites, and to install files onto a filesystem or tape. In conjunction with SCCS, you can use make to ensure that a large software project is built from the desired versions in an entire hierarchy of source files.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
144 Programming Utilities Guide November 1995 4 make reads a file that you create, called a makefile , which contains information about what files to build and how to build them. Once you write and test the makefile, you can forget about the processing details; make takes care of them. Dependency Checking: make vs. Shell Scripts While it is possible to use a shell script to assure consistency in trivial cases, scripts to build software projects are often inadequate. On the one hand, you don’t want to wait for a simpleminded script to compile every single program or object module when only one of them has changed. On the other hand, having to edit the script for each iteration can defeat the goal of consistency. Although it is possible to write a script of sufficient complexity to recompile only those modules that require it, make does this job better. make allows you to write a simple, structured listing of what to build and how to build it. It uses the mechanism of dependency checking to compare each module with the source or intermediate files it derives from. make only rebuilds a module if one or more of these prerequisite files, called dependency files , has changed since the module was last built. To determine whether a derived file is out of date with respect to its sources, make compares the modification time of the (existing) module with that of its dependency file. If the module is missing, or if it is older than the dependency file, make considers it to be out of date, and issues the commands necessary to rebuild it. A module can be treated as out of date if the commands used to build it have changed.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/25/2010 for the course ALL 0204 taught by Professor 79979 during the Spring '10 term at National Chiao Tung University.

Page1 / 84

make - make Utility This chapter describes the make...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online