![]() | ![]() | ![]() | ![]() | ![]() |
Dependancies |
If you know what a make file does then this is basically the functionality PPWIZARD is trying to supply. Once you have built your output files you don't need to rebuild them unless you modify one of your source files. PPWIZARD actually does a very much better job than any make-file-based process.
Let's consider a very complicated example where:
The whole process might take a while. You really only want to preprocess the above 3 input files to produce the 2 output files if you need to. PPWIZARD stores information in a dependancy file for each compile which will allow it to check whether a build is required or not. It will detect if any input or output files have changed or if they are missing and begin to rebuild the output.
To conditionally make your ".IT" files you could use:
ppwizard *.it /output:out\*.htm /CrLf /DependsOn:Depends\*.dep
This command says to make "*.IT" and put all output into the "OUT" directory and creates a "DEPENDS" directory and places dependancy information in this directory.
Most dependancies can be handled by the preprocessor but sometimes you need to help identify the input and output files. For example, you probably used a REXX linein() command to read from "CONFIG.SYS", you will need to use the #DependsOn command to indicate this one. In a similar manner, the example generates 2 output files; if you used the REXX lineout() command to create these then you would again need to use the #DependsOn command to indicate this output dependancy.
You might wish to have a look at these switches:
Dependancy Filter |
It is possible to tweek the contents of the generated file by creating a rexx macro called "HOOK_DEPENDSON", rexx variables involved are:
Example Filter #1 |
An example of a hook which ensures that no output dependancies are recorded follows:
#DefineRexx 'HOOK_DEPENDSON' ;--- Don't generate any output dependanies ------------------------------- DepOut.0 = 0; ;--- Clear specific input dependancy ------------------------------------- ;;;DepIn.1 = ''; ;;Changing to blank saves having to compress array ;--- Don't create dependancy file after all ------------------------------ ;;;DepDrop = "Changed my Mind"; #DefineRexx
Since in this case PPWIZARD does not know about the output dependancies you can safely manipulate or delete these without ppwizard remaking them. In general I don't recommend this approach but it is another option for you.
Example Filter #2 |
The following code shows how you can ensure that any absolute filenames used in input dependancies are converted into relative directories where they are within the current directory tree.
I needed to do this where the output is generated to a network drive (as is the dependancy file) but the input files are located somewhere on the users drive. If I didn't have the hook, someone else getting the source out of PVCS and making it will always recreate the files whether or not they have "changed".
#NextId #DefineRexx 'HOOK_DEPENDSON' ;--- Clear specific input dependancy ------------------------------------- @@CurrentDir = translate(directory()); @@Len = length(@@CurrentDir); do @@I = 1 to DepIn.0 @@File = DepIn.@@I if left(@@File, 1) <> '*' then do ;--- A "real" file ----------------------------------------------- @@FileU = DepIn.@@I if left(@@FileU, @@Len) = @@CurrentDir then @@File = '.' || substr(@@File, @@Len+1); end; DepIn.@@I = @@File; end; #DefineRexx
![]() | ![]() | ![]() | ![]() | ![]() |