File timestamps are used to check what has changed, so if you want to force one of the sets of rules to be run, you can simply touch one of the dependencies and rerun make. Make is very clever in that it examines the whole build tree before it does anything, so that rules are followed all the way back to see which need to be run, the they're run all the way forward so that they happen (a) only if necessary and (b) in the right order. Then when you say "make" the first target in your Makefile, and anything it depends on too, is rebuilt. You build a whole series of sets of targets, dependencies and rules with the target of one set of rules - the name of the output file from a set of rules - being amongst the dependencies (inputs) at the next level. You specify a target (the file you want to build), some dependencies (the files which - if changed - necessitate a rebuild) and a set of rules for making the target. The make system - with makefiles - is the usual way to do this (in the case of C and C++ programs anyway - in the Java world, Ant is the more usual approach). Coding projects (and their open source distributions) require build scripts - files of commands that convert the source code into executable programs, that install the various resultant files into place, and that can clean up the build area for a fresh build or for redistribution.
0 Comments
Leave a Reply. |