f9fc6d928d851b0dc79c7ef997b88e8aaf75f654
[openssl.git] / Configurations / descrip.mms.tmpl
1 ## descrip.mms to build OpenSSL on OpenVMS
2 ##
3 ## {- join("\n## ", @autowarntext) -}
4 {-
5   use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
6
7   # Our prefix, claimed when speaking with the VSI folks Tuesday
8   # January 26th 2016
9   our $osslprefix = 'OSSL$';
10   (our $osslprefix_q = $osslprefix) =~ s/\$/\\\$/;
11
12   our $sover = sprintf "%02d%02d", $config{shlib_major}, $config{shlib_minor};
13   our $osslver = sprintf "%02d%02d", split(/\./, $config{version});
14
15   our $sourcedir = $config{sourcedir};
16   our $builddir = $config{builddir};
17   sub sourcefile {
18       catfile($sourcedir, @_);
19   }
20   sub buildfile {
21       catfile($builddir, @_);
22   }
23   sub sourcedir {
24       catdir($sourcedir, @_);
25   }
26   sub builddir {
27       catdir($builddir, @_);
28   }
29   sub tree {
30       (my $x = shift) =~ s|\]$|...]|;
31       $x
32   }
33   sub move {
34       my $f = catdir(@_);
35       my $b = abs2rel(rel2abs("."),rel2abs($f));
36       $sourcedir = catdir($b,$sourcedir)
37           if !file_name_is_absolute($sourcedir);
38       $builddir = catdir($b,$builddir)
39           if !file_name_is_absolute($builddir);
40       "";
41   }
42
43   # Because we need to make two computations of these data,
44   # we store them in arrays for reuse
45   our @libs =
46       map { (my $x = $_) =~ s/\.a$//; $x }
47       @{$unified_info{libraries}};
48   our @shlibs =
49       map { $unified_info{sharednames}->{$_} || () }
50       grep(!/\.a$/, @{$unified_info{libraries}});
51   our @install_libs =
52       map { (my $x = $_) =~ s/\.a$//; $x }
53       @{$unified_info{install}->{libraries}};
54   our @install_shlibs =
55       map { $unified_info{sharednames}->{$_} || () }
56       grep(!/\.a$/, @{$unified_info{install}->{libraries}});
57   our @generated = ( ( map { (my $x = $_) =~ s|\.S$|\.s|; $x }
58                        grep { defined $unified_info{generate}->{$_} }
59                        map { @{$unified_info{sources}->{$_}} }
60                        grep { /\.o$/ } keys %{$unified_info{sources}} ),
61                      ( grep { /\.h$/ } keys %{$unified_info{generate}} ) );
62
63   # This is a horrible hack, but is needed because recursive inclusion of files
64   # in different directories does not work well with HP C.
65   my $sd = sourcedir("crypto", "async", "arch");
66   foreach (grep /\[\.crypto\.async\.arch\].*\.o$/, keys %{$unified_info{sources}}) {
67       (my $x = $_) =~ s|\.o$|.OBJ|;
68       $unified_info{before}->{$x}
69           = qq(arch_include = F\$PARSE("$sd","A.;",,,"SYNTAX_ONLY") - "A.;"
70         define arch 'arch_include');
71       $unified_info{after}->{$x}
72           = qq(deassign arch);
73   }
74   my $sd1 = sourcedir("ssl","record");
75   my $sd2 = sourcedir("ssl","statem");
76   my @ssl_locl_users = grep(/^\[\.(?:ssl\.(?:record|statem)|test)\].*\.o$/,
77                             keys %{$unified_info{sources}});
78   foreach (@ssl_locl_users) {
79       (my $x = $_) =~ s|\.o$|.OBJ|;
80       $unified_info{before}->{$x}
81           = qq(record_include = F\$PARSE("$sd1","A.;",,,"SYNTAX_ONLY") - "A.;"
82         define record 'record_include'
83         statem_include = F\$PARSE("$sd2","A.;",,,"SYNTAX_ONLY") - "A.;"
84         define statem 'statem_include');
85       $unified_info{after}->{$x}
86           = qq(deassign statem
87         deassign record);
88   }
89   # This makes sure things get built in the order they need
90   # to. You're welcome.
91   sub dependmagic {
92       my $target = shift;
93
94       return "$target : build_generated\n\t\pipe \$(MMS) depend && \$(MMS) _$target\n_$target";
95   }
96   #use Data::Dumper;
97   #print STDERR "DEBUG: before:\n", Dumper($unified_info{before});
98   #print STDERR "DEBUG: after:\n", Dumper($unified_info{after});
99   "";
100 -}
101 PLATFORM={- $config{target} -}
102 OPTIONS={- $config{options} -}
103 CONFIGURE_ARGS=({- join(", ",quotify_l(@{$config{perlargv}})) -})
104 SRCDIR={- $config{sourcedir} -}
105 BLDDIR={- $config{builddir} -}
106
107 # Allow both V and VERBOSE to indicate verbosity.  This only applies
108 # to testing.
109 VERBOSE=$(V)
110
111 VERSION={- $config{version} -}
112 MAJOR={- $config{major} -}
113 MINOR={- $config{minor} -}
114 SHLIB_VERSION_NUMBER={- $config{shlib_version_number} -}
115 SHLIB_VERSION_HISTORY={- $config{shlib_version_history} -}
116 SHLIB_MAJOR={- $config{shlib_major} -}
117 SHLIB_MINOR={- $config{shlib_minor} -}
118 SHLIB_TARGET={- $target{shared_target} -}
119
120 EXE_EXT=.EXE
121 LIB_EXT=.OLB
122 SHLIB_EXT=.EXE
123 OBJ_EXT=.OBJ
124 DEP_EXT=.D
125
126 LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @libs) -}
127 SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @shlibs) -}
128 ENGINES={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{engines}}) -}
129 PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{programs}}) -}
130 SCRIPTS={- join(", ", map { "-\n\t".$_ } @{$unified_info{scripts}}) -}
131 {- output_off() if $disabled{makedepend}; "" -}
132 DEPS={- our @deps = map { (my $x = $_) =~ s|\.o$|\$(DEP_EXT)|; $x; }
133                     grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
134                     keys %{$unified_info{sources}};
135         join(", ", map { "-\n\t".$_ } @deps); -}
136 {- output_on() if $disabled{makedepend}; "" -}
137 GENERATED_MANDATORY={- join(", ", map { "-\n\t".$_ } @{$unified_info{depends}->{""}} ) -}
138 GENERATED={- join(", ", map { "-\n\t".$_ } @generated) -}
139
140 INSTALL_LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @install_libs) -}
141 INSTALL_SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @install_shlibs) -}
142 INSTALL_ENGINES={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{install}->{engines}}) -}
143 INSTALL_PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{install}->{programs}}) -}
144 {- output_off() if $disabled{apps}; "" -}
145 BIN_SCRIPTS=[.tools]c_rehash.pl
146 MISC_SCRIPTS=[.apps]CA.pl, [.apps]tsget.pl
147 {- output_on() if $disabled{apps}; "" -}
148
149 APPS_OPENSSL={- use File::Spec::Functions;
150                 catfile("apps","openssl") -}
151
152 # DESTDIR is for package builders so that they can configure for, say,
153 # SYS$COMMON:[OPENSSL] and yet have everything installed in STAGING:[USER].
154 # In that case, configure with --prefix=SYS$COMMON:[OPENSSL] and then run
155 # MMS with /MACROS=(DESTDIR=STAGING:[USER]).  The result will end up in
156 # STAGING:[USER.OPENSSL].
157 # Normally it is left empty.
158 DESTDIR=
159
160 # Do not edit this manually. Use Configure --prefix=DIR to change this!
161 INSTALLTOP={- our $installtop =
162                   catdir($config{prefix}) || "SYS\$COMMON:[OPENSSL]";
163               $installtop -}
164 SYSTARTUP={- catdir($installtop, '[.SYS$STARTUP]'); -}
165 # This is the standard central area to store certificates, private keys...
166 OPENSSLDIR={- catdir($config{openssldir}) or
167               $config{prefix} ? catdir($config{prefix},"COMMON")
168                               : "SYS\$COMMON:[OPENSSL-COMMON]" -}
169 # The same, but for C
170 OPENSSLDIR_C={- $osslprefix -}DATAROOT:[000000]
171 # Where installed engines reside, for C
172 ENGINESDIR_C={- $osslprefix -}ENGINES{- $sover.$target{pointer_size} -}:
173
174 CC= {- $target{cc} -}
175 CFLAGS= /DEFINE=({- join(",", @{$target{defines}}, @{$config{defines}},"OPENSSLDIR=\"\"\"\$(OPENSSLDIR_C)\"\"\"","ENGINESDIR=\"\"\"\$(ENGINESDIR_C)\"\"\"") -}) {- $target{cflags} -} {- $config{cflags} -}
176 CFLAGS_Q=$(CFLAGS)
177 DEPFLAG= /DEFINE=({- join(",", @{$config{depdefines}}) -})
178 LDFLAGS= {- $target{lflags} -}
179 EX_LIBS= {- $target{ex_libs} ? ",".$target{ex_libs} : "" -}{- $config{ex_libs} ? ",".$config{ex_libs} : "" -}
180 LIB_CFLAGS={- $target{lib_cflags} // "" -}
181 DSO_CFLAGS={- $target{dso_cflags} // "" -}
182 BIN_CFLAGS={- $target{bin_cflags} // "" -}
183 NO_INST_LIB_CFLAGS={- $target{no_inst_lib_cflags} // '$(LIB_CFLAGS)' -}
184 NO_INST_DSO_CFLAGS={- $target{no_inst_dso_cflags} // '$(DSO_CFLAGS)' -}
185 NO_INST_BIN_CFLAGS={- $target{no_inst_bin_cflags} // '$(BIN_CFLAGS)' -}
186
187 PERL={- $config{perl} -}
188
189 # We let the C compiler driver to take care of .s files. This is done in
190 # order to be excused from maintaining a separate set of architecture
191 # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
192 # gcc, then the driver will automatically translate it to -xarch=v8plus
193 # and pass it down to assembler.
194 AS={- $target{as} -}
195 ASFLAG={- $target{asflags} -}
196
197 # .FIRST and .LAST are special targets with MMS and MMK.
198 # The defines in there are for C.  includes that look like
199 # this:
200 #
201 #    #include <openssl/foo.h>
202 #    #include "internal/bar.h"
203 #
204 # will use the logical names to find the files.  Expecting
205 # DECompHP C to find files in subdirectories of whatever was
206 # given with /INCLUDE is a fantasy, unfortunately.
207 NODEBUG=@
208 .FIRST :
209         $(NODEBUG) openssl_inc1 = F$PARSE("[.include.openssl]","A.;",,,"syntax_only") - "A.;"
210         $(NODEBUG) openssl_inc2 = F$PARSE("{- catdir($config{sourcedir},"[.include.openssl]") -}","A.;",,,"SYNTAX_ONLY") - "A.;"
211         $(NODEBUG) internal_inc1 = F$PARSE("[.crypto.include.internal]","A.;",,,"SYNTAX_ONLY") - "A.;"
212         $(NODEBUG) internal_inc2 = F$PARSE("{- catdir($config{sourcedir},"[.include.internal]") -}","A.;",,,"SYNTAX_ONLY") - "A.;"
213         $(NODEBUG) internal_inc3 = F$PARSE("{- catdir($config{sourcedir},"[.crypto.include.internal]") -}","A.;",,,"SYNTAX_ONLY") - "A.;"
214         $(NODEBUG) DEFINE openssl 'openssl_inc1','openssl_inc2'
215         $(NODEBUG) DEFINE internal 'internal_inc1','internal_inc2','internal_inc3'
216         $(NODEBUG) staging_dir = "$(DESTDIR)"
217         $(NODEBUG) staging_instdir = ""
218         $(NODEBUG) staging_datadir = ""
219         $(NODEBUG) IF staging_dir .NES. "" THEN -
220                 staging_instdir = F$PARSE("A.;",staging_dir,"[]",,"SYNTAX_ONLY")
221         $(NODEBUG) IF staging_instdir - "]A.;" .NES. staging_instdir THEN -
222                 staging_instdir = staging_instdir - "]A.;" + ".OPENSSL-INSTALL]"
223         $(NODEBUG) IF staging_instdir - "A.;" .NES. staging_instdir THEN -
224                 staging_instdir = staging_instdir - "A.;" + "[OPENSSL-INSTALL]"
225         $(NODEBUG) IF staging_dir .NES. "" THEN -
226                 staging_datadir = F$PARSE("A.;",staging_dir,"[]",,"SYNTAX_ONLY")
227         $(NODEBUG) IF staging_datadir - "]A.;" .NES. staging_datadir THEN -
228                 staging_datadir = staging_datadir - "]A.;" + ".OPENSSL-COMMON]"
229         $(NODEBUG) IF staging_datadir - "A.;" .NES. staging_datadir THEN -
230                 staging_datadir = staging_datadir - "A.;" + "[OPENSSL-COMMON]"
231         $(NODEBUG) !
232         $(NODEBUG) ! Installation logical names
233         $(NODEBUG) !
234         $(NODEBUG) installtop = F$PARSE(staging_instdir,"$(INSTALLTOP)","[]A.;",,"SYNTAX_ONLY,NO_CONCEAL") - ".][000000" - "[000000." - "][" - "]A.;" + ".]"
235         $(NODEBUG) datatop = F$PARSE(staging_datadir,"$(OPENSSLDIR)","[]A.;",,"SYNTAX_ONLY,NO_CONCEAL") - ".][000000" - "[000000." - "][" - "]A.;" + ".]"
236         $(NODEBUG) DEFINE ossl_installroot 'installtop'
237         $(NODEBUG) DEFINE ossl_dataroot 'datatop'
238         $(NODEBUG) !
239         $(NODEBUG) ! Figure out the architecture
240         $(NODEBUG) !
241         $(NODEBUG) arch = f$edit( f$getsyi( "arch_name"), "upcase")
242         $(NODEBUG) !
243         $(NODEBUG) ! Set up logical names for the libraries, so LINK and
244         $(NODEBUG) ! running programs can use them.
245         $(NODEBUG) !
246         $(NODEBUG) {- join("\n\t\$(NODEBUG) ", map { "DEFINE ".uc($_)." 'F\$ENV(\"DEFAULT\")'".uc($_)."\$(SHLIB_EXT)" } @shlibs) || "!" -}
247
248 .LAST :
249         $(NODEBUG) {- join("\n\t\$(NODEBUG) ", map { "DEASSIGN ".uc($_) } @shlibs) || "!" -}
250         $(NODEBUG) DEASSIGN ossl_dataroot
251         $(NODEBUG) DEASSIGN ossl_installroot
252         $(NODEBUG) DEASSIGN internal
253         $(NODEBUG) DEASSIGN openssl
254 .DEFAULT :
255         @ ! MMS cannot handle no actions...
256
257 # The main targets ###################################################
258
259 {- dependmagic('all'); -} : build_libs_nodep, build_engines_nodep, build_programs_nodep
260 {- dependmagic('build_libs'); -} : build_libs_nodep
261 {- dependmagic('build_engines'); -} : build_engines_nodep
262 {- dependmagic('build_programs'); -} : build_programs_nodep
263
264 build_generated : $(GENERATED_MANDATORY)
265 build_libs_nodep : $(LIBS), $(SHLIBS)
266 build_engines_nodep : $(ENGINES)
267 build_programs_nodep : $(PROGRAMS), $(SCRIPTS)
268
269 # Kept around for backward compatibility
270 build_apps build_tests : build_programs
271
272 test : tests
273 {- dependmagic('tests'); -} : build_programs_nodep, build_engines_nodep
274         @ ! {- output_off() if $disabled{tests}; "" -}
275         SET DEFAULT [.test]{- move("test") -}
276         DEFINE SRCTOP {- sourcedir() -}
277         DEFINE BLDTOP {- builddir() -}
278         DEFINE OPENSSL_ENGINES {- builddir("engines") -}
279         DEFINE OPENSSL_DEBUG_MEMORY "on"
280         IF "$(VERBOSE)" .NES. "" THEN DEFINE VERBOSE "$(VERBOSE)"
281         $(PERL) {- sourcefile("test", "run_tests.pl") -} $(TESTS)
282         DEASSIGN OPENSSL_DEBUG_MEMORY
283         DEASSIGN OPENSSL_ENGINES
284         DEASSIGN BLDTOP
285         DEASSIGN SRCTOP
286         SET DEFAULT [-]{- move("..") -}
287         @ ! {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
288         @ WRITE SYS$OUTPUT "Tests are not supported with your chosen Configure options"
289         @ ! {- output_on() if !$disabled{tests}; "" -}
290
291 list-tests :
292         @ ! {- output_off() if $disabled{tests}; "" -}
293         @ DEFINE SRCTOP {- sourcedir() -}
294         @ $(PERL) {- sourcefile("test", "run_tests.pl") -} list
295         @ DEASSIGN SRCTOP
296         @ ! {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
297         @ WRITE SYS$OUTPUT "Tests are not supported with your chosen Configure options"
298         @ ! {- output_on() if !$disabled{tests}; "" -}
299
300 install : install_sw install_ssldirs install_docs
301         @ WRITE SYS$OUTPUT ""
302         @ WRITE SYS$OUTPUT "######################################################################"
303         @ WRITE SYS$OUTPUT ""
304         @ IF "$(DESTDIR)" .EQS. "" THEN -
305              PIPE ( WRITE SYS$OUTPUT "Installation complete" ; -
306                     WRITE SYS$OUTPUT "" ; -
307                     WRITE SYS$OUTPUT "Run @$(SYSTARTUP)openssl_startup{- $osslver -} to set up logical names" ; -
308                     WRITE SYS$OUTPUT "then run @$(SYSTARTUP)openssl_utils{- $osslver -} to define commands" ; -
309                     WRITE SYS$OUTPUT "" )
310         @ IF "$(DESTDIR)" .NES. "" THEN -
311              PIPE ( WRITE SYS$OUTPUT "Staging installation complete" ; -
312                     WRITE SYS$OUTPUT "" ; -
313                     WRITE SYS$OUTPUT "Finish or package in such a way that the contents of the directory tree" ; -
314                     WRITE SYS$OUTPUT staging_instdir ; -
315                     WRITE SYS$OUTPUT "ends up in $(INSTALLTOP)," ; -
316                     WRITE SYS$OUTPUT "and that the contents of the contents of the directory tree" ; -
317                     WRITE SYS$OUTPUT staging_datadir ; -
318                     WRITE SYS$OUTPUT "ends up in $(OPENSSLDIR)" ; -
319                     WRITE SYS$OUTPUT "" ; -
320                     WRITE SYS$OUTPUT "When in its final destination," ; -
321                     WRITE SYS$OUTPUT "Run @$(SYSTARTUP)openssl_startup{- $osslver -} to set up logical names" ; -
322                     WRITE SYS$OUTPUT "then run @$(SYSTARTUP)openssl_utils{- $osslver -} to define commands" ; -
323                     WRITE SYS$OUTPUT "" )
324
325 check_install :
326         spawn/nolog @ossl_installroot:[SYSTEST]openssl_ivp{- $osslver -}.com
327
328 uninstall : uninstall_docs uninstall_sw
329
330 # Because VMS wants the generation number (or *) to delete files, we can't
331 # use $(LIBS), $(PROGRAMS), $(GENERATED) and $(ENGINES)directly.
332 libclean :
333         {- join("\n\t", map { "- DELETE $_.OLB;*" } @libs) || "@ !" -}
334         {- join("\n\t", map { "- DELETE $_.EXE;*,$_.MAP;*,$_.OPT;*" } @shlibs) || "@ !" -}
335
336 clean : libclean
337         {- join("\n\t", map { "- DELETE $_.EXE;*,$_.OPT;*" } @{$unified_info{programs}}) || "@ !" -}
338         {- join("\n\t", map { "- DELETE $_.EXE;*,$_.OPT;*" } @{$unified_info{engines}}) || "@ !" -}
339         {- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{scripts}}) || "@ !" -}
340         {- join("\n\t", map { "- DELETE $_;*" } @generated) || "@ !" -}
341         - DELETE [...]*.MAP;*
342         - DELETE [...]*.D;*
343         - DELETE [...]*.OBJ;*,*.LIS;*
344         - DELETE []CXX$DEMANGLER_DB.;*
345         - DELETE [.VMS]openssl_startup.com;*
346         - DELETE [.VMS]openssl_shutdown.com;*
347         - DELETE []vmsconfig.pm;*
348
349 distclean : clean
350         - DELETE configdata.pm;*
351         - DELETE descrip.mms;*
352
353 depend : descrip.mms
354 descrip.mms : FORCE
355         @ ! {- output_off() if $disabled{makedepend}; "" -}
356         @ $(PERL) -pe "if (/^# DO NOT DELETE.*/) { exit(0); }" -
357                 < descrip.mms > descrip.mms-new
358         @ OPEN/APPEND DESCRIP descrip.mms-new
359         @ WRITE DESCRIP "# DO NOT DELETE THIS LINE -- make depend depends on it."
360         {- join("\n\t", map { "\@ IF F\$SEARCH(\"$_\") .NES. \"\" THEN TYPE $_ /OUTPUT=DESCRIP:" } @deps); -}
361         @ CLOSE DESCRIP
362         @ PIPE ( $(PERL) -e "use File::Compare qw/compare_text/; my $x = compare_text(""descrip.mms"",""descrip.mms-new""); exit(0x10000000 + ($x == 0));" || -
363                  RENAME descrip.mms-new descrip.mms )
364         @ IF F$SEARCH("descrip.mms-new") .NES. "" THEN DELETE descrip.mms-new;*
365         -@ SPAWN/OUTPUT=NLA0: PURGE/NOLOG descrip.mms
366         @ ! {- output_on() if $disabled{makedepend}; "" -}
367
368 # Install helper targets #############################################
369
370 install_sw : all install_shared _install_dev_ns -
371              install_engines _install_runtime_ns -
372              install_startup install_ivp
373
374 uninstall_sw : uninstall_shared _uninstall_dev_ns -
375                uninstall_engines _uninstall_runtime_ns -
376                uninstall_startup uninstall_ivp
377
378 install_docs : install_html_docs
379
380 uninstall_docs : uninstall_html_docs
381
382 install_ssldirs : check_INSTALLTOP
383         - CREATE/DIR/PROT=(S:RWED,O:RWE,G:RE,W:RE) OSSL_DATAROOT:[000000]
384         IF F$SEARCH("OSSL_DATAROOT:[000000]CERTS.DIR;1") .EQS. "" THEN -
385                 CREATE/DIR/PROT=(S:RWED,O:RWE,G:RE,W:RE) OSSL_DATAROOT:[CERTS]
386         IF F$SEARCH("OSSL_DATAROOT:[000000]PRIVATE.DIR;1") .EQS. "" THEN -
387                 CREATE/DIR/PROT=(S:RWED,O:RWE,G,W) OSSL_DATAROOT:[PRIVATE]
388         IF F$SEARCH("OSSL_DATAROOT:[000000]MISC.DIR;1") .EQS. "" THEN -
389                 CREATE/DIR/PROT=(S:RWED,O:RWE,G,W) OSSL_DATAROOT:[MISC]
390         COPY/PROT=W:RE $(MISC_SCRIPTS) OSSL_DATAROOT:[MISC]
391         @ ! Install configuration file
392         COPY/PROT=W:R {- sourcefile("apps", "openssl-vms.cnf") -} -
393                 ossl_dataroot:[000000]openssl.cnf-dist
394         IF F$SEARCH("OSSL_DATAROOT:[000000]openssl.cnf") .EQS. "" THEN -
395                 COPY/PROT=W:R {- sourcefile("apps", "openssl-vms.cnf") -} -
396                         ossl_dataroot:[000000]openssl.cnf
397         @ ! Install CTLOG configuration file
398         COPY/PROT=W:R {- sourcefile("apps", "ct_log_list.cnf") -} -
399                 ossl_dataroot:[000000]ct_log_list.cnf-dist
400         IF F$SEARCH("OSSL_DATAROOT:[000000]ct_log_list.cnf") .EQS. "" THEN -
401                 COPY/PROT=W:R {- sourcefile("apps", "ct_log_list.cnf") -} -
402                         ossl_dataroot:[000000]ct_log_list.cnf
403
404 install_shared : check_INSTALLTOP
405         @ {- output_off() if $disabled{shared}; "" -} !
406         @ WRITE SYS$OUTPUT "*** Installing shareable images"
407         @ ! Install shared (runtime) libraries
408         - CREATE/DIR ossl_installroot:[LIB.'arch']
409         {- join("\n        ",
410                 map { "COPY/PROT=W:R $_.EXE ossl_installroot:[LIB.'arch']" }
411                 @install_shlibs) -}
412         @ {- output_on() if $disabled{shared}; "" -} !
413
414 _install_dev_ns : check_INSTALLTOP
415         @ WRITE SYS$OUTPUT "*** Installing development files"
416         @ ! Install header files
417         - CREATE/DIR ossl_installroot:[include.openssl]
418         COPY/PROT=W:R openssl:*.h ossl_installroot:[include.openssl]
419         @ ! Install static (development) libraries
420         - CREATE/DIR ossl_installroot:[LIB.'arch']
421         {- join("\n        ",
422                 map { "COPY/PROT=W:R $_.OLB ossl_installroot:[LIB.'arch']" }
423                 @install_libs) -}
424
425 install_dev : install_shared _install_dev_ns
426
427 _install_runtime_ns : check_INSTALLTOP
428         @ ! Install the main program
429         - CREATE/DIR ossl_installroot:[EXE.'arch']
430         COPY/PROT=W:RE [.APPS]openssl.EXE -
431                 ossl_installroot:[EXE.'arch']openssl{- $osslver -}.EXE
432         @ ! Install scripts
433         COPY/PROT=W:RE $(BIN_SCRIPTS) ossl_installroot:[EXE]
434         @ ! {- output_on() if $disabled{apps}; "" -}
435
436 install_runtime : install_shared _install_runtime_ns
437
438 install_engines : check_INSTALLTOP
439         @ {- output_off() unless scalar @{$unified_info{engines}}; "" -} !
440         @ WRITE SYS$OUTPUT "*** Installing engines"
441         - CREATE/DIR ossl_installroot:[ENGINES{- $sover.$target{pointer_size} -}.'arch']
442         {- join("\n        ",
443                 map { "COPY/PROT=W:RE $_.EXE ossl_installroot:[ENGINES$sover$target{pointer_size}.'arch']" }
444                 @{$unified_info{install}->{engines}}) -}
445         @ {- output_on() unless scalar @{$unified_info{engines}}; "" -} !
446
447 install_startup : [.VMS]openssl_startup.com [.VMS]openssl_shutdown.com -
448                  [.VMS]openssl_utils.com, check_INSTALLTOP
449         - CREATE/DIR ossl_installroot:[SYS$STARTUP]
450         COPY/PROT=W:RE [.VMS]openssl_startup.com -
451                 ossl_installroot:[SYS$STARTUP]openssl_startup{- $osslver -}.com
452         COPY/PROT=W:RE [.VMS]openssl_shutdown.com -
453                 ossl_installroot:[SYS$STARTUP]openssl_shutdown{- $osslver -}.com
454         COPY/PROT=W:RE [.VMS]openssl_utils.com -
455                 ossl_installroot:[SYS$STARTUP]openssl_utils{- $osslver -}.com
456
457 install_ivp : [.VMS]openssl_ivp.com check_INSTALLTOP
458         - CREATE/DIR ossl_installroot:[SYSTEST]
459         COPY/PROT=W:RE [.VMS]openssl_ivp.com -
460                 ossl_installroot:[SYSTEST]openssl_ivp{- $osslver -}.com
461
462 [.VMS]openssl_startup.com : vmsconfig.pm {- sourcefile("VMS", "openssl_startup.com.in") -}
463         - CREATE/DIR [.VMS]
464         $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
465                 {- sourcefile("VMS", "openssl_startup.com.in") -} -
466                 > [.VMS]openssl_startup.com
467
468 [.VMS]openssl_utils.com : vmsconfig.pm {- sourcefile("VMS", "openssl_utils.com.in") -}
469         - CREATE/DIR [.VMS]
470         $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
471                 {- sourcefile("VMS", "openssl_utils.com.in") -} -
472                 > [.VMS]openssl_utils.com
473
474 [.VMS]openssl_shutdown.com : vmsconfig.pm {- sourcefile("VMS", "openssl_shutdown.com.in") -}
475         - CREATE/DIR [.VMS]
476         $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
477                 {- sourcefile("VMS", "openssl_shutdown.com.in") -} -
478                 > [.VMS]openssl_shutdown.com
479
480 [.VMS]openssl_ivp.com : vmsconfig.pm {- sourcefile("VMS", "openssl_ivp.com.in") -}
481         - CREATE/DIR [.VMS]
482         $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
483                 {- sourcefile("VMS", "openssl_ivp.com.in") -} -
484                 > [.VMS]openssl_ivp.com
485
486 vmsconfig.pm : configdata.pm
487         OPEN/WRITE/SHARE=READ CONFIG []vmsconfig.pm
488         WRITE CONFIG "package vmsconfig;"
489         WRITE CONFIG "use strict; use warnings;"
490         WRITE CONFIG "use Exporter;"
491         WRITE CONFIG "our @ISA = qw(Exporter);"
492         WRITE CONFIG "our @EXPORT = qw(%config %target %withargs %unified_info %disabled);"
493         WRITE CONFIG "our %config = ("
494         WRITE CONFIG "  target => '","{- $config{target} -}","',"
495         WRITE CONFIG "  version => '","{- $config{version} -}","',"
496         WRITE CONFIG "  shlib_major => '","{- $config{shlib_major} -}","',"
497         WRITE CONFIG "  shlib_minor => '","{- $config{shlib_minor} -}","',"
498         WRITE CONFIG "  no_shared => '","{- $disabled{shared} -}","',"
499         WRITE CONFIG "  INSTALLTOP => '$(INSTALLTOP)',"
500         WRITE CONFIG "  OPENSSLDIR => '$(OPENSSLDIR)',"
501         WRITE CONFIG "  pointer_size => '","{- $target{pointer_size} -}","',"
502         WRITE CONFIG ");"
503         WRITE CONFIG "our %target = ();"
504         WRITE CONFIG "our %disabled = ();"
505         WRITE CONFIG "our %withargs = ();"
506         WRITE CONFIG "our %unified_info = ();"
507         WRITE CONFIG "1;"
508         CLOSE CONFIG
509
510 install_html_docs : check_INSTALLTOP
511         sourcedir = F$PARSE("{- $sourcedir -}A.;","[]") - "]A.;" + ".DOC]"
512         $(PERL) {- sourcefile("util", "process_docs.pl") -} -
513                 --sourcedir='sourcedir' --destdir=ossl_installroot:[HTML] -
514                 --type=html
515
516 check_INSTALLTOP :
517         @ IF "$(INSTALLTOP)" .EQS. "" THEN -
518                 WRITE SYS$ERROR "INSTALLTOP should not be empty"
519         @ IF "$(INSTALLTOP)" .EQS. "" THEN -
520                 EXIT %x10000002
521
522 # Helper targets #####################################################
523
524 # Developer targets ##################################################
525
526 debug_logicals :
527         SH LOGICAL/PROC openssl,internal,ossl_installroot,ossl_dataroot
528
529 # Building targets ###################################################
530
531 configdata.pm : $(SRCDIR)Configure $(SRCDIR)config.com {- join(" ", @{$config{build_file_templates}}, @{$config{build_infos}}, @{$config{conf_files}}) -}
532         @ WRITE SYS$OUTPUT "Reconfiguring..."
533         perl $(SRCDIR)Configure reconf
534         @ WRITE SYS$OUTPUT "*************************************************"
535         @ WRITE SYS$OUTPUT "***                                           ***"
536         @ WRITE SYS$OUTPUT "***   Please run the same mms command again   ***"
537         @ WRITE SYS$OUTPUT "***                                           ***"
538         @ WRITE SYS$OUTPUT "*************************************************"
539         @ PIPE ( EXIT %X10000000 )
540
541 {-
542   use File::Basename;
543   use File::Spec::Functions qw/abs2rel rel2abs catfile catdir/;
544
545   # Helper function to figure out dependencies on libraries
546   # It takes a list of library names and outputs a list of dependencies
547   sub compute_lib_depends {
548       if ($disabled{shared}) {
549           return map { $_ =~ /\.a$/ ? $`.".OLB" : $_.".OLB" } @_;
550       }
551       return map { $_ =~ /\.a$/
552                    ? $`.".OLB"
553                    : $unified_info{sharednames}->{$_}.".EXE" } @_;
554   }
555
556   sub generatesrc {
557       my %args = @_;
558       my $generator = join(" ", @{$args{generator}});
559       my $generator_incs = join("", map { ' "-I'.$_.'"' } @{$args{generator_incs}});
560       my $deps = join(", -\n\t\t", @{$args{generator_deps}}, @{$args{deps}});
561
562       if ($args{src} !~ /\.[sS]$/) {
563           if ($args{generator}->[0] =~ m|^.*\.in$|) {
564               my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
565                                                    "util", "dofile.pl")),
566                                    rel2abs($config{builddir}));
567               return <<"EOF";
568 $args{src} : $args{generator}->[0] $deps
569         \$(PERL) "-I\$(BLDDIR)" "-Mconfigdata" $dofile \\
570             "-o$target{build_file}" $generator > \$@
571 EOF
572           } else {
573               return <<"EOF";
574 $args{src} : $args{generator}->[0] $deps
575         \$(PERL)$generator_incs $generator > \$@
576 EOF
577           }
578       } else {
579           die "No method to generate assembler source present.\n";
580       }
581   }
582
583   sub src2obj {
584       my %args = @_;
585       my $obj = $args{obj};
586       my $deps = join(", -\n\t\t", @{$args{srcs}}, @{$args{deps}});
587
588       # Because VMS C isn't very good at combining a /INCLUDE path with
589       # #includes having a relative directory (like '#include "../foo.h"),
590       # the best choice is to move to the first source file's intended
591       # directory before compiling, and make sure to write the object file
592       # in the correct position (important when the object tree is other
593       # than the source tree).
594       my $forward = dirname($args{srcs}->[0]);
595       my $backward = abs2rel(rel2abs("."), rel2abs($forward));
596       my $objd = abs2rel(rel2abs(dirname($obj)), rel2abs($forward));
597       my $objn = basename($obj);
598       my $srcs =
599           join(", ",
600                map { abs2rel(rel2abs($_), rel2abs($forward)) } @{$args{srcs}});
601       my $ecflags;
602       if ($args{installed}) {
603           $ecflags = { lib => '$(LIB_CFLAGS)',
604                        dso => '$(DSO_CFLAGS)',
605                        bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
606       } else {
607           $ecflags = { lib => '$(NO_INST_LIB_CFLAGS)',
608                        dso => '$(NO_INST_DSO_CFLAGS)',
609                        bin => '$(NO_INST_BIN_CFLAGS)' } -> {$args{intent}};
610       }
611       my $incs_on = "\@ !";
612       my $incs_off = "\@ !";
613       my $incs = "";
614       my @incs = ();
615       push @incs, @{$args{incs}} if @{$args{incs}};
616       unless ($disabled{zlib}) {
617           # GNV$ZLIB_INCLUDE is the standard logical name for later zlib
618           # incarnations.
619           push @incs, ($withargs{zlib_include} || 'GNV$ZLIB_INCLUDE:');
620       }
621       if (@incs) {
622           $incs_on =
623               "DEFINE tmp_includes "
624               .join(",-\n\t\t\t", map {
625                                       file_name_is_absolute($_)
626                                       ? $_ : catdir($backward,$_)
627                                   } @incs);
628           $incs_off = "DEASSIGN tmp_includes";
629           $incs = " /INCLUDE=(tmp_includes:)";
630       }
631       my $before = $unified_info{before}->{$obj.".OBJ"} || "\@ !";
632       my $after = $unified_info{after}->{$obj.".OBJ"} || "\@ !";
633       my $depbuild = $disabled{makedepend} ? ""
634           : " /MMS=(FILE=${objd}${objn}.tmp-D,TARGET=$obj.OBJ)";
635
636       return <<"EOF";
637 $obj.OBJ : $deps
638         ${before}
639         SET DEFAULT $forward
640         $incs_on
641         \$(CC) \$(CFLAGS)${ecflags}${incs}${depbuild} /OBJECT=${objd}${objn}.OBJ /REPOSITORY=$backward $srcs
642         $incs_off
643         SET DEFAULT $backward
644         ${after}
645         \@ PIPE ( \$(PERL) -e "use File::Compare qw/compare_text/; my \$x = compare_text(""$obj.D"",""$obj.tmp-D""); exit(0x10000000 + (\$x == 0));" || -
646                  RENAME $obj.tmp-D $obj.d )
647         \@ IF F\$SEARCH("$obj.tmp-D") .NES. "" THEN DELETE $obj.tmp-D;*
648         - PURGE $obj.OBJ
649 EOF
650   }
651   sub libobj2shlib {
652       my %args = @_;
653       my $lib = $args{lib};
654       my $shlib = $args{shlib};
655       my $libd = dirname($lib);
656       my $libn = basename($lib);
657       (my $mkdef_key = $libn) =~ s/^${osslprefix_q}lib([^0-9]*)\d*/$1/i;
658       my @deps = compute_lib_depends(@{$args{deps}});
659       my $deps = join(", -\n\t\t", @deps);
660       my $shlib_target = $disabled{shared} ? "" : $target{shared_target};
661       my $ordinalsfile = defined($args{ordinals}) ? $args{ordinals}->[1] : "";
662       my $engine_opt = abs2rel(rel2abs(catfile($config{sourcedir},
663                                                "VMS", "engine.opt")),
664                                rel2abs($config{builddir}));
665       my $mkdef_pl = abs2rel(rel2abs(catfile($config{sourcedir},
666                                              "util", "mkdef.pl")),
667                              rel2abs($config{builddir}));
668       my $translatesyms_pl = abs2rel(rel2abs(catfile($config{sourcedir},
669                                                      "VMS", "translatesyms.pl")),
670                                      rel2abs($config{builddir}));
671       # The "[]" hack is because in .OPT files, each line inherits the
672       # previous line's file spec as default, so if no directory spec
673       # is present in the current line and the previous line has one that
674       # doesn't apply, you're in for a surprise.
675       my $write_opt =
676           join("\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
677                              $x =~ s|(\.EXE)|$1/SHARE|;
678                              $x =~ s|(\.OLB)|$1/LIB|;
679                              "WRITE OPT_FILE \"$x\"" } @deps)
680           || "\@ !";
681       return <<"EOF"
682 $shlib.EXE : $lib.OLB $deps $ordinalsfile
683         \$(PERL) $mkdef_pl "$mkdef_key" "VMS" > $shlib.SYMVEC-tmp
684         \$(PERL) $translatesyms_pl \$(BLDDIR)CXX\$DEMANGLER_DB. < $shlib.SYMVEC-tmp > $shlib.SYMVEC
685         DELETE $shlib.SYMVEC-tmp;*
686         OPEN/WRITE/SHARE=READ OPT_FILE $shlib.OPT
687         WRITE OPT_FILE "IDENTIFICATION=""V$config{version}"""
688         TYPE $shlib.SYMVEC /OUTPUT=OPT_FILE:
689         WRITE OPT_FILE "$lib.OLB/LIBRARY"
690         $write_opt
691         CLOSE OPT_FILE
692         LINK \$(LDFLAGS)/SHARE=\$\@ $shlib.OPT/OPT \$(EX_LIBS)
693         DELETE $shlib.SYMVEC;*
694         PURGE $shlib.EXE,$shlib.OPT,$shlib.MAP
695 EOF
696         . ($config{target} =~ m|alpha| ? "" : <<"EOF"
697         SET IMAGE/FLAGS=(NOCALL_DEBUG) \$\@
698 EOF
699         );
700   }
701   sub obj2dso {
702       my %args = @_;
703       my $lib = $args{lib};
704       my $libd = dirname($lib);
705       my $libn = basename($lib);
706       (my $libn_nolib = $libn) =~ s/^lib//;
707       my @objs = map { "$_.OBJ" } @{$args{objs}};
708       my @deps = compute_lib_depends(@{$args{deps}});
709       my $deps = join(", -\n\t\t", @objs, @deps);
710       my $shlib_target = $disabled{shared} ? "" : $target{shared_target};
711       my $engine_opt = abs2rel(rel2abs(catfile($config{sourcedir},
712                                                "VMS", "engine.opt")),
713                                rel2abs($config{builddir}));
714       # The "[]" hack is because in .OPT files, each line inherits the
715       # previous line's file spec as default, so if no directory spec
716       # is present in the current line and the previous line has one that
717       # doesn't apply, you're in for a surprise.
718       my $write_opt1 =
719           join(",-\"\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
720                                  "WRITE OPT_FILE \"$x" } @objs).
721           "\"";
722       my $write_opt2 =
723           join("\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
724                              $x =~ s|(\.EXE)|$1/SHARE|;
725                              $x =~ s|(\.OLB)|$1/LIB|;
726                              "WRITE OPT_FILE \"$x\"" } @deps)
727           || "\@ !";
728       return <<"EOF"
729 $lib.EXE : $deps
730         OPEN/WRITE/SHARE=READ OPT_FILE $lib.OPT
731         TYPE $engine_opt /OUTPUT=OPT_FILE:
732         $write_opt1
733         $write_opt2
734         CLOSE OPT_FILE
735         LINK \$(LDFLAGS)/SHARE=\$\@ $lib.OPT/OPT \$(EX_LIBS)
736         - PURGE $lib.EXE,$lib.OPT,$lib.MAP
737 EOF
738         . ($config{target} =~ m|alpha| ? "" : <<"EOF"
739         SET IMAGE/FLAGS=(NOCALL_DEBUG) \$\@
740 EOF
741         );
742   }
743   sub obj2lib {
744       my %args = @_;
745       (my $lib = $args{lib}) =~ s/\.a$//;
746       my $objs = join(", -\n\t\t", map { $_.".OBJ" } (@{$args{objs}}));
747       my $fill_lib = join("\n\t", (map { "LIBRARY/REPLACE $lib.OLB $_.OBJ" }
748                                     @{$args{objs}}));
749       return <<"EOF";
750 $lib.OLB : $objs
751         LIBRARY/CREATE/OBJECT $lib.OLB
752         $fill_lib
753         - PURGE $lib.OLB
754 EOF
755   }
756   sub obj2bin {
757       my %args = @_;
758       my $bin = $args{bin};
759       my $bind = dirname($bin);
760       my $binn = basename($bin);
761       my @objs = map { "$_.OBJ" } @{$args{objs}};
762       my $objs = join(",", @objs);
763       my @deps = compute_lib_depends(@{$args{deps}});
764       my $deps = join(", -\n\t\t", @objs, @deps);
765
766       my $olb_count = scalar grep(m|\.OLB$|, @deps);
767       my $analyse_objs = "@ !";
768       if ($olb_count > 0) {
769           my $analyse_quals =
770               $config{target} =~ m|alpha| ? "/GSD" : "/SECTIONS=SYMTAB";
771           $analyse_objs = "- pipe ANALYSE/OBJECT$analyse_quals $objs | SEARCH SYS\$INPUT \"\"\"main\"\"\" ; nomain = \$severity .NE. 1"
772       }
773       # The "[]" hack is because in .OPT files, each line inherits the
774       # previous line's file spec as default, so if no directory spec
775       # is present in the current line and the previous line has one that
776       # doesn't apply, you're in for a surprise.
777       my $write_opt1 =
778           join(",-\"\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
779                                  "\@ WRITE OPT_FILE \"$x" } @objs).
780           "\"";
781       my $write_opt2 =
782           join("\n\t", map { my @lines = ();
783                              my $x = $_ =~ /\[/ ? $_ : "[]".$_;
784                              if ($x =~ m|\.EXE$|) {
785                                  push @lines, "\@ WRITE OPT_FILE \"$x/SHARE\"";
786                              } elsif ($x =~ m|\.OLB$|) {
787                                  (my $l = $x) =~ s/\W/_/g;
788                                  push @lines, 
789                                      "\@ IF nomain THEN WRITE OPT_FILE \"$x/LIB\$(INCLUDE_MAIN_$l)\"",
790                                      "\@ IF .NOT. nomain THEN WRITE OPT_FILE \"$x/LIB\""
791                              }
792                              @lines
793                            } @deps)
794           || "\@ !";
795       # The linking commands looks a bit complex, but it's for good reason.
796       # When you link, say, foo.obj, bar.obj and libsomething.exe/share, and
797       # bar.obj happens to have a symbol that also exists in libsomething.exe,
798       # the linker will warn about it, loudly, and will then choose to pick
799       # the first copy encountered (the one in bar.obj in this example).
800       # On Unix and on Windows, the corresponding maneuvre goes through
801       # silently with the same effect.
802       # With some test programs, made for checking the internals of OpenSSL,
803       # we do this kind of linking deliberately, picking a few specific object
804       # files from within [.crypto] or [.ssl] so we can reach symbols that are
805       # otherwise unreachable (since the shareable images only exports the
806       # symbols listed in [.util]*.num), and then with the shared libraries
807       # themselves.  So we need to silence the warning about multiply defined
808       # symbols, to mimic the way linking work on Unix and Windows, and so
809       # the build isn't interrupted (MMS stops when warnings are signaled,
810       # by default), and so someone building doesn't have to worry where it
811       # isn't necessary.  If there are other warnings, however, we show them
812       # and let it break the build.
813       return <<"EOF"
814 $bin.EXE : $deps
815         $analyse_objs
816         @ OPEN/WRITE/SHARE=READ OPT_FILE $bin.OPT
817         $write_opt1
818         $write_opt2
819         @ CLOSE OPT_FILE
820         TYPE $bin.opt ! For debugging
821         - pipe SPAWN/WAIT/NOLOG/OUT=$bin.LINKLOG -
822                     LINK \$(LDFLAGS)/EXEC=\$\@ $bin.OPT/OPT \$(EX_LIBS) ; -
823                link_status = \$status ; link_severity = link_status .AND. 7
824         @ search_severity = 1
825         -@ IF link_severity .EQ. 0 THEN -
826                 pipe SEARCH $bin.LINKLOG "%","-"/MATCH=AND | -
827                      SPAWN/WAIT/NOLOG/OUT=NLA0: -
828                           SEARCH SYS\$INPUT: "-W-MULDEF,"/MATCH=NOR ; -
829                      search_severity = \$severity
830         @ ! search_severity is 3 when the last search didn't find any matching
831         @ ! string: %SEARCH-I-NOMATCHES, no strings matched
832         @ ! If that was the result, we pretend linking got through without
833         @ ! fault or warning.
834         @ IF search_severity .EQ. 3 THEN link_severity = 1
835         @ ! At this point, if link_severity shows that there was a fault
836         @ ! or warning, make sure to restore the linking status.
837         -@ IF .NOT. link_severity THEN TYPE $bin.LINKLOG
838         -@ DELETE $bin.LINKLOG;*
839         @ IF .NOT. link_severity THEN SPAWN/WAIT/NOLOG EXIT 'link_status'
840         - PURGE $bin.EXE,$bin.OPT
841 EOF
842       . ($config{target} =~ m|alpha| ? "" : <<"EOF"
843         SET IMAGE/FLAGS=(NOCALL_DEBUG) \$\@
844 EOF
845         );
846   }
847   sub in2script {
848       my %args = @_;
849       my $script = $args{script};
850       return "" if grep { $_ eq $script } @{$args{sources}}; # No overwrite!
851       my $sources = join(" ", @{$args{sources}});
852       my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
853                                            "util", "dofile.pl")),
854                            rel2abs($config{builddir}));
855       return <<"EOF";
856 $script : $sources
857         \$(PERL) "-I\$(BLDDIR)" "-Mconfigdata" $dofile -
858             "-o$target{build_file}" $sources > $script
859         SET FILE/PROT=(S:RWED,O:RWED,G:RE,W:RE) $script
860         PURGE $script
861 EOF
862   }
863   ""    # Important!  This becomes part of the template result.
864 -}