!*************************** AMUS Program Label ****************************** ! Filename: SS1MAK.DOC Date: 05/30/89 ! Category: UTIL Hash Code: N/A Version: 1.0 ! Initials: DD Name: DAVE DRAKE ! Company: DOUBLE-D SOFTWARE SERVICES Telephone #: (702) 438-2173 ! Related Files: NONE ! Min. Op. Sys.: N/A Expertise Level: INT ! Special: ! Description: Documentation for SS1MAK.BV ! !****************************************************************************! ! ! Double-D Software Services Dave Drake ! 4924 Chantilly (702) 438-2173 ! Las Vegas, Nv. 89110 ! ! NAME: SS1MAK.DOC ! ! DATE CREATED: 05/30/89 ! ! DESCRIPTION: Documentation for SS1MAK.BV ! !****************************************************************************! Make utilities are common in the world of 'C' programming. They allow you to selectively re-compile only those programs effected by a change made in a module. Recently I found myself writing a rather large application (Towing Company Dispatch/Inventory system) that used many routines contained in files that were copied (alpha base for ++include) into programs or into other copy files. The effort needed to figure out what to recompile when a change was made to one of these copy modules prompted this program. The solution this program provides is admittedly limited, but it works well for me at this time. Any enhancements anyone may make would be appreciated. The program may be fairly easily modified to be used on normal basic (BAS) programs using ++INCLUDE type files. The program was written using the enhanced features available with AlphaBASE and Metropolis. If re-written in AlphaBASIC, the functionality of these features would have to be translated. The main enhamcements used are DO loops and IF/THEN/ELSE constructs. SS1MAK requires special information in a commented header. This information consists of a TAG (COPIED INTO:) followed by a list of filenames separated by commas. The filenames must have an extension [xxxxxx.yyy]. The filenames may also optionally have an application designation [xxxxxx.yyy(ap)]. If no application code is given, the program assumes the file is in the current application. If an application code is given, the program will determine the location of the file by using a lookup into the system applications directory. Since the program opens these files for input only, it does not log to the application, but opens it using the device and ppn information read from the applications directory. For an example of the header Double-D Software uses, see the end of this documentation. When the program is run, it asks for the name of a copy file to process. It assumes the extension is .CPY. The copy file is opened for input and a search is made for the tag line. When the tag line is found, it extracts each filename on that line and on following lines until a line containing only a comment (!) character is found. It writes these names to an output file. When the program has extracted all of the file names from the original file, it closes the input and output files and opens the output file for input. It then reads in each of the file names in this file and looks for any file names that have an extension of .CPY. When it finds one, it opens that copy file and extracts the COPIED INTO list from that file. The program continues to process the extracted filename list until it doesn't contain any .CPY files. It then opens a file with an extension of .CMD and writes each filename out with the appropirate command to cause it to be compiled. If a filename has an application code different than the current application, the program will output a LOG command to log to the proper application, compile the program, then LOG back to the 'home' application. When all of this processing has completed, the program will prompt for the name of another CPY file to process. Typeing 'END' will terminate the program. The Command files may then be executed normally from the 'dot' prompt. All intermediate files and the command file created will have the same name as the original copy file entered. The intermediate files have extensions 001,002,003,etc and will automatically deleted by the program. ! Example of Header for Copy files used by Double-D Software ! XXXXXX.CPY (rev) - Description of routine !****************************************************************************! ! ! Double-D Software Services Dave Drake ! 4924 Chantilly (702) 438-2173 ! Las Vegas, Nv. 89110 ! ! ROUTINE NAME: XXXXXX ! ! DATE CREATED: mm-dd-yy ! ! DESCRIPTION: Description of routine ! ! COPIED INTO: XXXXXX.CPY(AP),XXXXXX.BV(AR),XXXXXX.CPY(GL) ! XXXXXX.CPY,XXXXXX.BV ! ! CHANGE HISTORY: ! ! DATE BY DESCRIPTION !****************************************************************************! ! !The MAKE utility looks for a line with 'COPIED INTO:' on it. It will extract !the file names following the COPIED INTO and on all subsequent lines until a !line with only a comment symbol (!) is found. ! !A file containing all of the file names is built. ! !Then that file is processed and any .CPY files contained in it will be !processed and the list of files added to the master list. This continues !until no more .CPY files are found in the master list. If the .CPY file !has an application code [xx], the program will log to that application and !process the file, then log back. ! !When the Master List is Completed, the program builds a .CMD file that will !recompile all of the programs on the list, logging to appropriate !applications as necessary. ! ! NOTE: CURRENT ASSUMPTION IS THAT ALL FILES ARE IN SAME ALPHABASE SYSTEM ! .