@@ -553,7 +553,6 @@ distclean : clean
553
553
- DELETE descrip.mms;*
554
554
555
555
depend : descrip.mms
556
- descrip.mms : FORCE
557
556
@ ! {- output_off() if $disabled{makedepend}; "" -}
558
557
@ $(PERL) {- sourcefile("util", "add-depends.pl") -} "{- $config{makedep_scheme} -}"
559
558
@ ! {- output_on() if $disabled{makedepend}; "" -}
@@ -755,7 +754,16 @@ debug_logicals :
755
754
756
755
# Building targets ###################################################
757
756
758
- configdata.pm : $(SRCDIR)Configure $(SRCDIR)config.com {- join(" ", @{$config{build_file_templates}}, @{$config{build_infos}}, @{$config{conf_files}}) -}
757
+ descrip.mms : configdata.pm {- join(" ", @{$config{build_file_templates}}) -}
758
+ perl configdata.pm
759
+ @ WRITE SYS$OUTPUT "*************************************************"
760
+ @ WRITE SYS$OUTPUT "*** ***"
761
+ @ WRITE SYS$OUTPUT "*** Please run the same mms command again ***"
762
+ @ WRITE SYS$OUTPUT "*** ***"
763
+ @ WRITE SYS$OUTPUT "*************************************************"
764
+ @ PIPE ( EXIT %X10000000 )
765
+
766
+ configdata.pm : $(SRCDIR)Configure $(SRCDIR)config.com {- join(" ", @{$config{build_infos}}, @{$config{conf_files}}) -}
759
767
perl configdata.pm -r
760
768
@ WRITE SYS$OUTPUT "*************************************************"
761
769
@ WRITE SYS$OUTPUT "*** ***"
871
879
return ($filename, $scripture);
872
880
}
873
881
882
+ # On VMS, (some) header file directories include the files
883
+ # __DECC_INCLUDE_EPILOGUE.H and __DECC_INCLUDE_PROLOGUE.H.
884
+ # When header files are generated, and the build directory
885
+ # isn't the same as the source directory, these files must
886
+ # be copied alongside the generated header file, or their
887
+ # effect will be lost.
888
+ # We use the same include file cache as make_includefile
889
+ # to check if the scripture to copy these files has already
890
+ # been generated.
891
+ sub make_decc_include_files {
892
+ my $outd = shift;
893
+ my $ind = shift;
894
+
895
+ # If the build directory and the source directory are the
896
+ # same, there's no need to copy the prologue and epilogue
897
+ # files.
898
+ return ('') if $outd eq $ind;
899
+
900
+ my $outprologue = catfile($outd, '__DECC_INCLUDE_PROLOGUE.H');
901
+ my $outepilogue = catfile($outd, '__DECC_INCLUDE_EPILOGUE.H');
902
+ my $inprologue = catfile($ind, '__DECC_INCLUDE_PROLOGUE.H');
903
+ my $inepilogue = catfile($ind, '__DECC_INCLUDE_EPILOGUE.H');
904
+ my @filenames = ();
905
+ my $scripture = '';
906
+
907
+ if ($includefile_cache{$outprologue}) {
908
+ push @filenames, $outprologue;
909
+ } elsif (-f $inprologue) {
910
+ my $local_scripture .= <<"EOF";
911
+ $outprologue : $inprologue
912
+ COPY $inprologue $outprologue
913
+ EOF
914
+ $includefile_cache{$outprologue} = $local_scripture;
915
+
916
+ push @filenames, $outprologue;
917
+ $scripture .= $local_scripture;
918
+ }
919
+ if ($includefile_cache{$outepilogue}) {
920
+ push @filenames, $outepilogue;
921
+ } elsif (-f $inepilogue) {
922
+ my $local_scripture .= <<"EOF";
923
+ $outepilogue : $inepilogue
924
+ COPY $inepilogue $outepilogue
925
+ EOF
926
+ $includefile_cache{$outepilogue} = $local_scripture;
927
+
928
+ push @filenames, $outepilogue;
929
+ $scripture .= $local_scripture;
930
+ }
931
+
932
+ return (@filenames, $scripture);
933
+ }
934
+
874
935
sub generatetarget {
875
936
my %args = @_;
876
937
my $deps = join(" ", compute_platform_depends(@{$args{deps}}));
@@ -984,12 +1045,18 @@ EOF
984
1045
my @perlmodules = ( 'configdata.pm',
985
1046
grep { $_ =~ m|\.pm$| } @{$args{deps}} );
986
1047
my %perlmoduleincs = map { '"-I'.dirname($_).'"' => 1 } @perlmodules;
987
- $deps = join(' ', $deps, compute_platform_depends(@perlmodules));
1048
+ my @decc_include_data
1049
+ = make_decc_include_files(dirname($args{src}), dirname($gen0));
1050
+ my $decc_include_scripture = pop @decc_include_data;
1051
+ $deps = join(' ', $deps, @decc_include_data,
1052
+ compute_platform_depends(@perlmodules));
988
1053
@perlmodules = map { '"-M'.basename($_, '.pm').'"' } @perlmodules;
989
1054
my $perlmodules = join(' ', '', sort keys %perlmoduleincs, @perlmodules);
1055
+
990
1056
return <<"EOF";
991
1057
$args{src} : $gen0 $deps
992
1058
\$(PERL)$perlmodules $dofile "-o$target{build_file}" $gen0$gen_args > \$\@
1059
+ $decc_include_scripture
993
1060
EOF
994
1061
} elsif (grep { $_ eq $gen0 } @{$unified_info{programs}}) {
995
1062
#
0 commit comments