VMS: use BLDDIR rather than BUILDDIR in descrip.mms.tmpl
[openssl.git] / Configurations / descrip.mms.tmpl
index 28231abbad6e2b14b8342f5cc319de21c58d6d13..201bef6c664ae6f70f65e14c5101eb8f5fecc260 100644 (file)
@@ -80,7 +80,11 @@ PLATFORM={- $config{target} -}
 OPTIONS={- $config{options} -}
 CONFIGURE_ARGS=({- join(", ",quotify_l(@{$config{perlargv}})) -})
 SRCDIR={- $config{sourcedir} -}
-BUILDDIR={- $config{builddir} -}
+BLDDIR={- $config{builddir} -}
+
+# Allow both V and VERBOSE to indicate verbosity.  This only applies
+# to testing.
+VERBOSE=$(V)
 
 VERSION={- $config{version} -}
 MAJOR={- $config{major} -}
@@ -109,6 +113,12 @@ DEPS={- our @deps = map { (my $x = $_) =~ s|\.o$|\$(DEP_EXT)|; $x; }
                     keys %{$unified_info{sources}};
         join(", ", map { "-\n\t".$_ } @deps); -}
 {- output_on() if $disabled{makedepend}; "" -}
+GENERATED_MANDATORY={- join(",", @{$unified_info{depends}->{""}} ) -}
+
+{- output_off() if $disabled{apps}; "" -}
+BIN_SCRIPTS=[.tools]c_rehash.pl
+MISC_SCRIPTS=[.apps]CA.pl, [.apps]tsget.pl
+{- output_on() if $disabled{apps}; "" -}
 
 # DESTDIR is for package builders so that they can configure for, say,
 # SYS$COMMON:[OPENSSL] and yet have everything installed in STAGING:[USER].
@@ -137,6 +147,9 @@ CFLAGS_Q=$(CFLAGS)
 DEPFLAG= /DEFINE=({- join(",", @{$config{depdefines}}) -})
 LDFLAGS= {- $target{lflags} -}
 EX_LIBS= {- $target{ex_libs} ? ",".$target{ex_libs} : "" -}{- $config{ex_libs} ? ",".$config{ex_libs} : "" -}
+LIB_CFLAGS={- $target{lib_cflags} || "" -}
+DSO_CFLAGS={- $target{dso_cflags} || "" -}
+BIN_CFLAGS={- $target{bin_cflags} || "" -}
 
 PERL={- $config{perl} -}
 
@@ -210,20 +223,22 @@ NODEBUG=@
 
 # The main targets ###################################################
 
-all : configdata.pm, -
+all : build_generated, -
       build_libs_nodep, build_engines_nodep, build_apps_nodep, -
       depend
 
-build_libs : configdata.pm, build_libs_nodep, depend
+build_libs : build_generated, build_libs_nodep, depend
 build_libs_nodep : $(LIBS)
-build_engines : configdata.pm, build_engines_nodep, depend
+build_engines : build_generated, build_engines_nodep, depend
 build_engines_nodep : $(ENGINES)
-build_apps : configdata.pm, build_apps_nodep, depend
+build_apps : build_generated, build_apps_nodep, depend
 build_apps_nodep : $(PROGRAMS), $(SCRIPTS)
-build_tests : configdata.pm, build_tests_nodep, depend
+build_tests : build_generated, build_tests_nodep, depend
 build_tests_nodep : $(TESTPROGS)
 
-test tests : configdata.pm, -
+build_generated : $(GENERATED_MANDATORY)
+
+test tests : build_generated, -
              build_apps_nodep, build_engines_nodep, build_tests_nodep, -
              depend
         @ ! {- output_off() if $disabled{tests}; "" -}
@@ -231,6 +246,7 @@ test tests : configdata.pm, -
         DEFINE SRCTOP {- sourcedir() -}
         DEFINE BLDTOP {- builddir() -}
         DEFINE OPENSSL_ENGINES {- builddir("engines") -}
+        IF "$(VERBOSE)" .NES. "" THEN DEFINE VERBOSE "$(VERBOSE)"
         $(PERL) {- sourcefile("test", "run_tests.pl") -} $(TESTS)
         DEASSIGN OPENSSL_ENGINES
         DEASSIGN BLDTOP
@@ -280,6 +296,7 @@ install : install_sw install_docs
 uninstall : uninstall_docs uninstall_sw
 
 clean : libclean
+        - DELETE {- join(",", map { "$_;*" } @{$unified_info{depends}->{""}} ) -}
         - DELETE []OSSL$LIB*.EXE;*,OSSL$LIB*.MAP;*,OSSL$LIB*.OPT;*
         - DELETE [.engines...]LIB*.EXE;*,LIB*.MAP;*,LIB*.OPT;*
         - DELETE [.apps]*.EXE;*,*.MAP;*,*.OPT;*
@@ -289,6 +306,10 @@ clean : libclean
         - DELETE [.test]*.LOG;*
         - DELETE []*.MAP;*
 
+distclean : clean
+        - DELETE configdata.pm;*
+        - DELETE descrip.mms;*
+
 depend : descrip.mms
 descrip.mms : FORCE
        @ ! {- output_off() if $disabled{makedepend}; "" -}
@@ -332,14 +353,15 @@ install_dev : check_INSTALLTOP
         @ {- output_on() if $disabled{shared}; "" -} !
 
 install_runtime : check_INSTALLTOP
+        @ ! {- output_off() if $disabled{apps}; "" -}
         @ WRITE SYS$OUTPUT "*** Installing runtime files"
         @ ! Install the main program
         - CREATE/DIR ossl_installroot:[EXE.'arch']
         COPY/PROT=W:RE [.APPS]openssl.EXE ossl_installroot:[EXE.'arch']
         @ ! Install scripts
         - CREATE/DIR ossl_installroot:[EXE]
-        COPY/PROT=W:RE [.APPS]CA.pl ossl_installroot:[EXE]
-        COPY/PROT=W:RE [.TOOLS]c_rehash. ossl_installroot:[EXE]c_rehash.pl
+        COPY/PROT=W:RE $(BIN_SCRIPTS) ossl_installroot:[EXE]
+        @ ! {- output_on() if $disabled{apps}; "" -}
         @ ! Install configuration file
         - CREATE/DIR ossl_dataroot:[000000]
         COPY/PROT=W:RE {- sourcefile("apps", "openssl-vms.cnf") -} -
@@ -360,6 +382,8 @@ install_config : [.VMS]openssl_startup.com [.VMS]openssl_shutdown.com -
                 CREATE/DIR/PROT=(S:RWED,O:RWE,G:RE,W:RE) OSSL_DATAROOT:[CERTS]
         IF F$SEARCH("OSSL_DATAROOT:[000000]PRIVATE.DIR;1") .EQS. "" THEN -
                 CREATE/DIR/PROT=(S:RWED,O:RWE,G,W) OSSL_DATAROOT:[PRIVATE]
+        IF F$SEARCH("OSSL_DATAROOT:[000000]MISC.DIR;1") .EQS. "" THEN -
+                CREATE/DIR/PROT=(S:RWED,O:RWE,G,W) OSSL_DATAROOT:[MISC]
         - CREATE/DIR ossl_installroot:[SYS$STARTUP]
         COPY/PROT=W:RE -
                 [.VMS]openssl_startup.com,openssl_shutdown.com -
@@ -367,14 +391,15 @@ install_config : [.VMS]openssl_startup.com [.VMS]openssl_shutdown.com -
         COPY/PROT=W:RE -
                 {- sourcefile("VMS", "openssl_utils.com") -} -
                 ossl_installroot:[SYS$STARTUP]
+        COPY/PROT=W:RE $(MISC_SCRIPTS) OSSL_DATAROOT:[MISC]
 
-[.VMS]openssl_startup.com : vmsconfig.pm
+[.VMS]openssl_startup.com : vmsconfig.pm {- sourcefile("VMS", "openssl_startup.com.in") -}
         - CREATE/DIR [.VMS]
         $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
                 {- sourcefile("VMS", "openssl_startup.com.in") -} -
                 > [.VMS]openssl_startup.com
 
-[.VMS]openssl_shutdown.com : vmsconfig.pm
+[.VMS]openssl_shutdown.com : vmsconfig.pm {- sourcefile("VMS", "openssl_shutdown.com.in") -}
         - CREATE/DIR [.VMS]
         $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
                 {- sourcefile("VMS", "openssl_shutdown.com.in") -} -
@@ -395,7 +420,10 @@ vmsconfig.pm : configdata.pm
         WRITE CONFIG "  OPENSSLDIR => '$(OPENSSLDIR)',"
         WRITE CONFIG "  pointersize => '","{- $target{pointersize} -}","',"
         WRITE CONFIG "  shared_libs => ["
-        {- join("\n        ", map { "WRITE CONFIG \"    '$_'," } map { $unified_info{sharednames}->{$_} || () } @{$unified_info{libraries}}) || "\@ !" -}
+        {- $disabled{shared}
+           ? "\@ !"
+           : join("\n        ", map { "WRITE CONFIG \"    '$_'," } map { $unified_info{sharednames}->{$_} || () } @{$unified_info{libraries}})
+        -}
         WRITE CONFIG "  ],"
         WRITE CONFIG ");"
         WRITE CONFIG "our %target = ();"
@@ -405,6 +433,10 @@ vmsconfig.pm : configdata.pm
         WRITE CONFIG "1;"
         CLOSE CONFIG
 
+install_html_docs : check_INSTALLTOP
+        @ $(PERL) {- sourcefile("util", "process_docs.pl") -} -
+                --destdir=ossl_installroot:[HTML] --type=html
+
 check_INSTALLTOP :
         @ IF "$(INSTALLTOP)" .EQS. "" THEN -
                 WRITE SYS$ERROR "INSTALLTOP should not be empty"
@@ -416,9 +448,7 @@ check_INSTALLTOP :
 # Developer targets ##################################################
 
 debug_logicals :
-        SH LOGICAL/PROC openssl,internal,ossl_installroot
-        IF "$(DESTDIR)" .EQS. "" THEN -
-                SH LOGICAL/PROC ossl_dataroot
+        SH LOGICAL/PROC openssl,internal,ossl_installroot,ossl_dataroot
 
 # Building targets ###################################################
 
@@ -439,13 +469,25 @@ configdata.pm : {- join(" ", sourcefile("Configurations", "descrip.mms.tmpl"), s
   sub generatesrc {
       my %args = @_;
       my $generator = join(" ", @{$args{generator}});
-      my $deps = join(", -\n\t\t", @{$args{deps}});
+      my $generator_incs = join("", map { ' "-I'.$_.'"' } @{$args{generator_incs}});
+      my $deps = join(", -\n\t\t", @{$args{generator_deps}}, @{$args{deps}});
 
       if ($args{src} !~ /\.[sS]$/) {
-          return <<"EOF";
+          if ($args{generator}->[0] =~ m|^.*\.in$|) {
+             my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
+                                                   "util", "dofile.pl")),
+                                   rel2abs($config{builddir}));
+              return <<"EOF";
+$args{src} : $args{generator}->[0] $deps
+       \$(PERL) "-I\$(BLDDIR)" "-Mconfigdata" $dofile \\
+           "-o$target{build_file}" $generator > \$@
+EOF
+         } else {
+              return <<"EOF";
 $args{src} : $args{generator}->[0] $deps
-       \$(PERL) $generator > \$@
+       \$(PERL)$generator_incs $generator > \$@
 EOF
+         }
       } else {
           die "No method to generate assembler source present.\n";
       }
@@ -469,6 +511,9 @@ EOF
       my $srcs =
           join(", ",
                map { abs2rel(rel2abs($_), rel2abs($forward)) } @{$args{srcs}});
+      my $ecflags = { lib => '$(LIB_CFLAGS)',
+                      dso => '$(DSO_CFLAGS)',
+                      bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
       my $incs_on = "\@ !";
       my $incs_off = "\@ !";
       my $incs = "";
@@ -499,7 +544,7 @@ $obj.OBJ : $deps
         ${before}
         SET DEFAULT $forward
         $incs_on
-        \$(CC) \$(CFLAGS)${incs}${depbuild} /OBJECT=${objd}${objn}.OBJ /REPOSITORY=$backward $srcs
+        \$(CC) \$(CFLAGS)${ecflags}${incs}${depbuild} /OBJECT=${objd}${objn}.OBJ /REPOSITORY=$backward $srcs
         $incs_off
         SET DEFAULT $backward
         ${after}
@@ -546,7 +591,7 @@ $shlib.EXE : $lib.OLB $deps $ordinalsfile
         IF "$mkdef_key" .EQS. "ssl" .OR. "$mkdef_key" .EQS. "crypto" THEN -
            \$(PERL) $mkdef_pl "$mkdef_key" "VMS" > $shlib.SYMVEC-tmp
         IF "$mkdef_key" .EQS. "ssl" .OR. "$mkdef_key" .EQS. "crypto" THEN -
-           \$(PERL) $translatesyms_pl \$(BUILDDIR)CXX\$DEMANGLER_DB. < $shlib.SYMVEC-tmp > $shlib.SYMVEC
+           \$(PERL) $translatesyms_pl \$(BLDDIR)CXX\$DEMANGLER_DB. < $shlib.SYMVEC-tmp > $shlib.SYMVEC
         OPEN/WRITE/SHARE=READ OPT_FILE $shlib.OPT
         WRITE OPT_FILE "IDENTIFICATION=""V$config{version}"""
         IF "$mkdef_key" .NES. "ssl" .AND. "$mkdef_key" .NES. "crypto" THEN -
@@ -654,7 +699,7 @@ EOF
                            rel2abs($config{builddir}));
       return <<"EOF";
 $script : $sources
-        \$(PERL) "-I\$(BUILDDIR)" "-Mconfigdata" $dofile -
+        \$(PERL) "-I\$(BLDDIR)" "-Mconfigdata" $dofile -
            "-o$target{build_file}" $sources > $script
         SET FILE/PROT=(S:RWED,O:RWED,G:RE,W:RE) $script
         PURGE $script