{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

Info icon This 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.
Image of page 1

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

View Full Document Right 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.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern