Metacomco MAKE

Reviewed by Matthew Jones

 

Issue 25

Jan/Feb 87

Next Article >>

<< Prev Article

 

 

As I have often said in my language reviews, a typical programming session is a cycle of editing, compiling, linking and running / debugging. Last issue I reviewed Menu + from Metacomco, which is designed to make this cycle easier. By selecting 'edit' in a menu, your editor is loaded and run, automatically loading the file you are interested in. Consecutively selecting 'compile', 'link' and then 'run' allows you to smoothly start each process, but there can be problems with such systems. For instance, if you want to edit multiple files, having to select each in turn can slow you down, and the link option becomes complicated.

Menu driven systems (not just Menu+) are at their best when you are only dealing with one program. For the larger programs Metacomco's MAKE program comes into its own. Operation is very simple, and, when working properly, it should save you much typing, and a fair bit of time. MAKE works by using the date/time-stamp that is put on each file when it is written to (this means that you must always set the time at power-up). When you edit a file, for example 'cmain.c', the date/time-stamp is set to the current time. When MAKE is run, it loads a file known as a MAKEFILE which contains directives which tell MAKE the dependencies of each file.

In the example given, the makefile contains directives telling MAKE that 'cmain.app' depends on 'cmain.bin' and 'csubs.bin', which in turn depend on 'cmain.c' and 'csubs.c' respectively, each of which depend on a single header file 'chead.h'. With this information, MAKE would look at the date/time-stamps of each file, and if 'cmain.app' is older than any of its dependants, it will carry out instructions also held in the makefile on how to update the files. As 'cmain.app' depends on 'cmain.bin' which depends on 'cmain.c' which, due to the edit above, is more recent than 'cmain.app', the instructions required to make 'cmain.bin' from 'cmain.c' will be carried out (in this case the running of a compiler), then those to link 'cmain.bin' and 'csubs.bin' (the linker), until at last 'cmain.app' is up to date. If I had edited the header file, both files would have been compiled, then linked. This may seem a complicated technique, but once you have your makefile set up correctly, the whole process is initiated just by double clicking on MAKE.

Example MAKEFILE

When you are dealing with large numbers of files, this is by far the easiest way to manage them. Firstly you do not have to remember which ones you have edited as MAKE will find out. Secondly, once you have started MAKE you may do something more useful than wait for the compiler to finish to be ready to start the next compilation. If you tell MAKE to sound a bell at the end of the compile / link, it will draw your attention when done. There are dis-advantages to this however as if, for example, you have edited a file but don't really want it compiled, you can get MAKE to sound a bell by running a 'bell ringing' program at the end, however if there is a compile error this does not happen and the procedure will end silently.

The makefile example is an actual file which I have been using myself. It demonstrates several points, first that you can use macros to represent groups of files (the list can spread over more than one line). I found that MAKE will hang (i.e. go to sleep) when I put a macro on either side of a dependency. Also, the dependency using the header file 'chead.h' does not work (I said it did above to illustrate the principle). I have another makefile which has two such header dependencies, one of which works, but the other doesn't, and I can find no explanation. Also worth mentioning is that you can use an 'implicit rule' to compile the. c files, which saves having to define the compile sequence more than once.

The MAKE manual is very technical, and is not particularly easy to read or understand. I must say that I am not sure that all the problems I have had are bugs in MAKE, it may be that I don't fully understand the manual, but the end result is the same.

Two extra programs are included on the disk, the first is a 'TOUCH' utility which is used to set the date/time-stamp of a file to the current date & time. I found this invaluable when I forgot to set the date at power up, and also for forcing recompiles. It seemed to have trouble stamping all the files in a large (50 + files) subdirectory though. 'SETDATE' is a program for your boot disk 'AUTO' folder, and allows you to set the date and time. I found it very frustrating, especially as it is very strict on format (it won't even let you press RETURN to skip it!), and as the date is not only lost on reset, it is effectively worthless. If you want such a program, use EURODATE, a public domain program which is far less strict on format, or something similar.

To conclude, MAKE is very suitable for any programming situation where you are frequently editing more than one file. I have found that once it has been fine tuned it is very reliable, and although there is a slight overhead while it checks the dates of all the files, it saves time which would have been lost typing in the next file to be compiled. The manual is perhaps a little confusing, but at the end of the day it is a worthwhile utility.

MAKE costs 49.95 and is available from: Metacomco plc, 26 Portland Square, Bristol, BS2 8RZ. Telephone (0272) 428781

top