732 Part VI . Programming in Linux three (Web hosting contract)
732 Part VI . Programming in Linux three files must exist to build editor. The second line in the first rule is the command that make must execute to create editor: gcc -o editor editor.o screen.o keyboard.o. It builds the executable from the three object files, editor.o, screen.o, and keyboard.o. The next three rules tell make how to build the individual object files. Each rule consists of a one-object file target (editor.o, screen,o, keyboard.o); one source code file dependency (editor.c, screen.c, keyboard.c); and a rule that defines how to build that target. The fifth rule defines a target named clean with no dependencies. When a target has no dependencies, its commands are executed whenever the target is invoked. In this case, clean deletes the constituent object files (*.o), plus any core files (core) as well as any Emacs backup files (*~) from previous builds. The sixth rule defines a target named realclean. It uses the fifth rule as one of its dependencies. This causes make to build the clean target and then to remove the editor binary. Here is where make s value becomes evident: Ordinarily, if you tried to build editor using the command from the second line, gcc would complain loudly and ceremoniously quit if the dependencies did not exist. Make, on the other hand, after determining that editor requires these files, first verifies that they exist and, if they don t, executes the commands to create them. After creating the dependencies, make returns to the first rule to create the editor executable. Of course, if the dependencies for the components, editor.c, screen.c, or keyboard.c, don t exist, make will give up because it lacks targets named, in this case, editor.c, screen.c, or keyboard.c (that is, no rules are defined in the makefile for creating editor.c, screen.c, and keyboard.c). All well and good, you are probably thinking, but how does make know when to build or rebuild a file? The answer is simple: If a specified target does not exist in a place where make can find it, make builds or rebuilds it. If the target does exist, make compares the timestamp on the target to the timestamp on the dependencies. If one or more of the dependencies are newer than the target, make rebuilds that target, assuming that the newer dependency implies some code change that must be incorporated into the target. Library Utilities Programming libraries are collections of code that can be reused across multiple software projects. Libraries are a classic example of software development s ardent goal, code reuse. They collect frequently used programming routines and utility code into a single location. The standard C libraries, for example, contain hundreds of
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.