Unix Makefiles

Unix Makefiles - Dr David A Gaitros The “make” utility in Unix is one of the original tools designed by S I Fieldman of AT&T Bell labs

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Dr. David A. Gaitros The “make” utility in Unix is one of the original tools designed by S. I. Fieldman of AT&T Bell labs circa 1977. There are many version. What is “make”?: The tool is designed to allow programmers to efficiently compile large complex programs with many components easily. You can place the commands to compile a program in a Unix script but this will cause ALL modules to be compiled every time. The “make” utility allows us to only compile those that have changed and the modules that depend upon them. In Unix, when you type the command “make” the operating system looks for a file called either “makefile” or “Makefile”. ◦ There are exceptions to this but we will assume that you will always have the “makefile” or “Makefile” file resident in the directory of where your program resides. This file contains a series of directives that tell the “make” utility how to compile your program and in what order. Each file will be associated with a list of other files by which it is dependent. This is called a dependency line. If any of the associated files have been recently modified, the make utility will execute a directive command just below the dependency line. The “make” utility is recursive. For instance, if a very low level utility is the only thing changed, it could cause all of the modules within a program to be re-compiled. After the utility finishes the file, it goes through and checks all of the dependencies again to make sure all are up to date. hello: main.o factorial.o hello.o g++ main.o factorial.o hello.o -o hellog++ main....
View Full Document

This note was uploaded on 11/07/2011 for the course COP 3014 taught by Professor Tyson during the Fall '10 term at FSU.

Page1 / 17

Unix Makefiles - Dr David A Gaitros The “make” utility in Unix is one of the original tools designed by S I Fieldman of AT&T Bell labs

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

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