summaryrefslogtreecommitdiffstats
path: root/Configurations/descrip.mms.tmpl
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-02-18 19:41:57 +0100
committerRichard Levitte <levitte@openssl.org>2016-02-18 23:48:52 +0100
commitc058fcd79877530f18a288664ea71def012c405a (patch)
treec8e1152ce7e5ab69df39528ccab5d8c9eb4de3e3 /Configurations/descrip.mms.tmpl
parentdf302cdce7bd9b27bb4745674abc06d3310dde33 (diff)
Automatic 'make depend' for the unified build scheme
This isn't the fully featured combination of compiler generated dependency files and Makefile include directives, but a cheaper variant of the same. The dependency files are generated automatically, but then we have the usual "depend" target. However, we depend on it in the bigger phony targets that are the most likely to be used. That make this feature automatic enough. A side effect is that we can't use the build file's timestamp to check if reconfiguring might be in order. In its place, we use a flag file that depends on Configure and the build file template and depend on it in spots where it makes sense to check for the need to reconfigure. Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'Configurations/descrip.mms.tmpl')
-rw-r--r--Configurations/descrip.mms.tmpl71
1 files changed, 41 insertions, 30 deletions
diff --git a/Configurations/descrip.mms.tmpl b/Configurations/descrip.mms.tmpl
index 2798b19916..065d5a3394 100644
--- a/Configurations/descrip.mms.tmpl
+++ b/Configurations/descrip.mms.tmpl
@@ -105,6 +105,10 @@ ENGINES={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{engines}}) -}
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].
@@ -200,14 +204,22 @@ NODEBUG=@
# The main targets ###################################################
-all : descrip.mms, build_libs, build_engines, build_apps
-
-build_libs : $(LIBS)
-build_engines : $(ENGINES)
-build_apps : $(PROGRAMS), $(SCRIPTS)
-build_tests : $(TESTPROGS)
-
-test tests : build_apps, build_engines, build_tests, rehash
+all : config.timestamp, -
+ build_libs_nodep, build_engines_nodep, build_apps_nodep, -
+ depend
+
+build_libs : config.timestamp, build_libs_nodep, depend
+build_libs_nodep : $(LIBS)
+build_engines : config.timestamp, build_engines_nodep, depend
+build_engines_nodep : $(ENGINES)
+build_apps : config.timestamp, build_apps_nodep, depend
+build_apps_nodep : $(PROGRAMS), $(SCRIPTS)
+build_tests : config.timestamp, build_tests_nodep, depend
+build_tests_nodep : $(TESTPROGS)
+
+test tests : config.timestamp, -
+ build_apps_nodep, build_engines_nodep, build_tests_nodep, -
+ depend, rehash
SET DEFAULT [.test]{- move("test") -}
DEFINE SRCTOP {- sourcedir() -}
DEFINE BLDTOP {- builddir() -}
@@ -242,24 +254,18 @@ clean : libclean
- 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 #############################################
@@ -345,7 +351,7 @@ install_config : [.VMS]openssl_startup.com [.VMS]openssl_shutdown.com -
{- sourcefile("VMS", "openssl_shutdown.com.in") -} -
> [.VMS]openssl_shutdown.com
-vmsconfig.pm : descrip.mms
+vmsconfig.pm : config.timestamp
OPEN/WRITE/SHARE=READ CONFIG []vmsconfig.pm
WRITE CONFIG "package vmsconfig;"
WRITE CONFIG "use strict; use warnings;"
@@ -377,7 +383,7 @@ check_INSTALLTOP :
# 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]
@@ -396,8 +402,8 @@ debug_logicals :
# Building targets ###################################################
-descrip.mms : {- sourcefile("Configurations", "descrip.mms.tmpl") -} $(SRCDIR)Configure ! $(SRCDIR)config.com
- @ WRITE SYS$OUTPUT "descrip.mms is older than $?."
+config.timestamp : {- 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 "*************************************************"
@@ -405,6 +411,11 @@ descrip.mms : {- sourcefile("Configurations", "descrip.mms.tmpl") -} $(SRCDIR)Co
@ WRITE SYS$OUTPUT "*** Please run the same mms command again ***"
@ WRITE SYS$OUTPUT "*** ***"
@ WRITE SYS$OUTPUT "*************************************************"
+ @ IF F$SEARCH("config.timestamp",1) .NES. "" THEN -
+ OPEN/APPEND TIMESTAMP "config.timestamp"
+ @ IF F$SEARCH("config.timestamp",2) .EQS. "" THEN -
+ OPEN/WRITE TIMESTAMP "config.timestamp"
+ @ close TIMESTAMP
@ exit %10000000
{-