Web servers - Chapter 29 . Programming Tools and Utilities 793

Chapter 29 . Programming Tools and Utilities 793 test followed by make install. Most users appreciate the convenience of simple build instructions. Finally, make speeds up the edit-compile-debug process. It minimizes rebuild times because it is smart enough to determine which files have changed, and recompiles only files that have changed. So, how does make accomplish its magical feats? By using a makefile, which contains rules that tell make what to build and how to build it. A rule consists of the following: . Target The thing make ultimately tries to create . Dependencies A list of one or more dependencies (usually files) required to build the target . Commands A list of commands to execute to create the target from the specified dependencies Makefiles constitute a database of dependency information for the programs they build and automatically verify that all of the files necessary for building a program are available. When invoked, GNU make looks for a file named GNUmakefile, makefile, or Makefile, in that order. For some reason, most developers use the last form, Makefile. Makefile rules have the general form target : dependency dependency […] command command […] target is usually the file, such as a binary or object file, to create. dependency is a list of one or more files required as input to create target. Each command is a step such as a compiler invocation or a shell command that is necessary to create target. Unless specified otherwise, make does all of its work in the current working directory. The first character in a command must be the tab character; eight spaces will not suffice. This often catches people unaware, and can be a problem if your preferred editor helpfully translates tabs to eight spaces. If you try to use spaces instead of a tab, make displays the message Missing separator and stops. Listing 29-4 shows a sample makefile for building a text editor imaginatively named editor. Caution
If you are looking for affordable and reliable webhost to host and run your business application visit our ftp web hosting services.

Leave a Reply