PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } grep { !m|^\[\.test\]| } @{$unified_info{programs}}) -}
TESTPROGS={- join(", ", map { "-\n\t".$_.".EXE" } grep { m|^\[\.test\]| } @{$unified_info{programs}}) -}
SCRIPTS={- join(", ", map { "-\n\t".$_ } @{$unified_info{scripts}}) -}
+DEPS={- our @deps = map { (my $x = $_) =~ s|\.o$|\$(DEP_EXT)|; $x; }
+ grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
+ keys %{$unified_info{sources}};
+ join(", ", map { "-\n\t".$_ } @deps); -}
# DESTDIR is for package builders so that they can configure for, say,
# SYS$COMMON:[OPENSSL] and yet have everything installed in STAGING:[USER].
NODEBUG=@
.FIRST :
$(NODEBUG) openssl_inc1 = F$PARSE("[.include.openssl]","A.;",,,"syntax_only") - "A.;"
- $(NODEBUG) openssl_inc2 = F$PARSE("{- catdir($config{sourcedir},"[.include.openssl]") -}","a.;",,,"SYNTAX_ONLY") - "A.;"
+ $(NODEBUG) openssl_inc2 = F$PARSE("{- catdir($config{sourcedir},"[.include.openssl]") -}","A.;",,,"SYNTAX_ONLY") - "A.;"
$(NODEBUG) internal_inc1 = F$PARSE("[.crypto.include.internal]","A.;",,,"SYNTAX_ONLY") - "A.;"
$(NODEBUG) internal_inc2 = F$PARSE("{- catdir($config{sourcedir},"[.include.internal]") -}","A.;",,,"SYNTAX_ONLY") - "A.;"
$(NODEBUG) internal_inc3 = F$PARSE("{- catdir($config{sourcedir},"[.crypto.include.internal]") -}","A.;",,,"SYNTAX_ONLY") - "A.;"
# The main targets ###################################################
-all : descrip.mms, $(LIBS), $(ENGINES), $(PROGRAMS), $(SCRIPTS), $(TESTPROGS)
-
-test tests : $(TESTPROGS), rehash
+all : configdata.pm, -
+ build_libs_nodep, build_engines_nodep, build_apps_nodep, -
+ depend
+
+build_libs : configdata.pm, build_libs_nodep, depend
+build_libs_nodep : $(LIBS)
+build_engines : configdata.pm, build_engines_nodep, depend
+build_engines_nodep : $(ENGINES)
+build_apps : configdata.pm, build_apps_nodep, depend
+build_apps_nodep : $(PROGRAMS), $(SCRIPTS)
+build_tests : configdata.pm, build_tests_nodep, depend
+build_tests_nodep : $(TESTPROGS)
+
+test tests : configdata.pm, -
+ build_apps_nodep, build_engines_nodep, build_tests_nodep, -
+ depend, rehash
SET DEFAULT [.test]{- move("test") -}
DEFINE SRCTOP {- sourcedir() -}
DEFINE BLDTOP {- builddir() -}
- DELETE [.test]*.LOG;*
- DELETE []*.MAP;*
-DCLEAN_CMD=$(PERL) -pe "if (/^# DO NOT DELETE.*/) { exit(0); }"
-dclean :
- $(DCLEAN_CMD) < descrip.mms > descrip.mms.new
- RENAME descrip.mms.new descrip.mms
- PURGE descrip.mms
-
-{- our @deps = map { (my $x = $_) =~ s|\.o$|\$(DEP_EXT)|; $x; }
- grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
- keys %{$unified_info{sources}};
- ""; -}
-depend : {- join(",-\n\t", @deps); -}
- $(DCLEAN_CMD) < descrip.mms > descrip.mms.new
- OPEN/APPEND DESCRIP descrip.mms.new
- WRITE DESCRIP "# DO NOT DELETE THIS LINE -- make depend depends on it."
- {- join("\n\t", map { "TYPE $_ /OUTPUT=DESCRIP:" } @deps); -}
- CLOSE DESCRIP
- RENAME descrip.mms.new descrip.mms
- PURGE descrip.mms
+depend : descrip.mms
+descrip.mms : FORCE
+ @ $(PERL) -pe "if (/^# DO NOT DELETE.*/) { exit(0); }" -
+ < descrip.mms > descrip.mms-new
+ @ OPEN/APPEND DESCRIP descrip.mms-new
+ @ WRITE DESCRIP "# DO NOT DELETE THIS LINE -- make depend depends on it."
+ @ {- join("\n\t", map { "IF F\$SEARCH(\"$_\") .NES. \"\" THEN TYPE $_ /OUTPUT=DESCRIP:" } @deps); -}
+ @ CLOSE DESCRIP
+ @ DIFF/OUTPUT=NLA0: descrip.mms,descrip.mms-new
+ @ IF $SEVERITY .EQ. 3 THEN RENAME descrip.mms-new descrip.mms
+ @ IF F$SEARCH("descrip.mms-new") .NES. "" THEN DELETE descrip.mms-new;*
+ -@ SPAWN/OUTPUT=NLA0: PURGE/NOLOG descrip.mms
# Install helper targets #############################################
@ {- output_off() if $config{no_shared}; "" -} !
{- join("\n ",
map { "COPY/PROT=W:RE $_.EXE ossl_installroot:['arch'.LIB]" }
- map { $unified_info{sharednames}->{$_} || () }
+ map { $unified_info{sharednames}->{$_} || () }
@{$unified_info{libraries}}) -}
- @ {- output_on() -} !
+ @ {- output_on() if $config{no_shared}; "" -} !
install_runtime : check_INSTALLTOP
@ WRITE SYS$OUTPUT "*** Installing runtime files"
@ WRITE SYS$OUTPUT "*** Installing engines"
CREATE/DIR ossl_installroot:['arch'.ENGINES]
COPY/PROT=W:RE [.ENGINES]*.EXE ossl_installroot:['arch'.ENGINES]
- @ {- output_on() -} !
+ @ {- output_on() if $config{no_shared}; "" -} !
install_config : [.VMS]openssl_startup.com [.VMS]openssl_shutdown.com -
check_INSTALLTOP
{- sourcefile("VMS", "openssl_shutdown.com.in") -} -
> [.VMS]openssl_shutdown.com
-vmsconfig.pm : descrip.mms
+vmsconfig.pm : configdata.pm
OPEN/WRITE/SHARE=READ CONFIG []vmsconfig.pm
WRITE CONFIG "package vmsconfig;"
WRITE CONFIG "use strict; use warnings;"
# Helper targets #####################################################
-rehash : [.apps]openssl.exe, copy-certs
+rehash : copy-certs, build_apps_nodep
!MCR [.apps]openssl.exe rehash {- builddir("certs", "demo") -}
$(PERL) [.tools]c_rehash. [.certs.demo]
# Building targets ###################################################
-descrip.mms : {- sourcefile("Configurations", "descrip.mms.tmpl") -} $(SRCDIR)Configure ! $(SRCDIR)config.com
- @ WRITE SYS$OUTPUT "descrip.mms is older than $?."
+configdata.pm : {- sourcefile("Configurations", "descrip.mms.tmpl") -} $(SRCDIR)Configure ! $(SRCDIR)config.com
+ @ WRITE SYS$OUTPUT "Detected changed: $?"
@ WRITE SYS$OUTPUT "Reconfiguring..."
perl $(SRCDIR)Configure reconf
@ WRITE SYS$OUTPUT "*************************************************"
@ WRITE SYS$OUTPUT "*** Please run the same mms command again ***"
@ WRITE SYS$OUTPUT "*** ***"
@ WRITE SYS$OUTPUT "*************************************************"
- @ exit %10000000
+ @ PIPE ( EXIT %X10000000 )
{-
use File::Basename;
use File::Spec::Functions qw/abs2rel rel2abs catfile catdir/;
- sub src2dep {
- my %args = @_;
- my $dep = $args{obj};
- my $deps = join(", -\n\t\t", @{$args{srcs}}, @{$args{deps}});
-
- # Because VMS C isn't very good at combining a /INCLUDE path with
- # #includes having a relative directory (like '#include "../foo.h"),
- # the best choice is to move to the first source file's intended
- # directory before compiling, and make sure to write the object file
- # in the correct position (important when the object tree is other
- # than the source tree).
- my $forward = dirname($args{srcs}->[0]);
- my $backward = abs2rel(rel2abs("."), rel2abs($forward));
- my $depd = abs2rel(rel2abs(dirname($dep)), rel2abs($forward));
- my $depn = basename($dep);
- my $srcs =
- join(", ",
- map { abs2rel(rel2abs($_), rel2abs($forward)) } @{$args{srcs}});
- my $incs =
- "/INCLUDE=(".join(",",
- map {
- file_name_is_absolute($_)
- ? $_ : catdir($backward,$_)
- } @{$args{incs}}).")";
- my $before = $unified_info{before}->{$dep.".OBJ"} || "\@ !";
- my $after = $unified_info{after}->{$dep.".OBJ"} || "\@ !";
-
- return <<"EOF";
-$dep.MMS : $deps
- ${before}
- SET DEFAULT $forward
- \$(CC) \$(CFLAGS)${incs} /MMS=(TARGET=.OBJ)/OBJECT=${depd}${depn}.MMS $srcs
- SET DEFAULT $backward
- ${after}
- - PURGE $dep.MMS
-EOF
- }
sub src2obj {
my %args = @_;
my $obj = $args{obj};
my $after = $unified_info{after}->{$obj.".OBJ"} || "\@ !";
return <<"EOF";
-$obj.OBJ : $deps
+$obj.MMS : $deps
+ ${before}
+ SET DEFAULT $forward
+ \$(CC) \$(CFLAGS)${incs} /MMS=(FILE=${objd}${objn}.MMS,TARGET=$obj.OBJ) /NOOBJECT $srcs
+ SET DEFAULT $backward
+ ${after}
+ - PURGE $obj.MMS
+$obj.OBJ : $obj.MMS
${before}
SET DEFAULT $forward
\$(CC) \$(CFLAGS)${incs} /OBJECT=${objd}${objn}.OBJ /REPOSITORY=$backward $srcs
rel2abs($config{builddir}));
return <<"EOF";
$script : $sources
- \$(PERL) "-I\$(BUILDDIR)" "-Mconfigdata" $dofile $sources > $script
+ \$(PERL) "-I\$(BUILDDIR)" "-Mconfigdata" $dofile -
+ "-o$target{build_file}" $sources > $script
SET FILE/PROT=(S:RWED,O:RWED,G:RE,W:RE) $script
PURGE $script
EOF