Add Perl include path mechanism (by Andrew)

This commit is contained in:
Ralph Lange
2017-08-01 11:36:27 +02:00
parent f2a899b92b
commit a27d7440f3
2 changed files with 21 additions and 0 deletions
+6
View File
@@ -328,6 +328,12 @@ $(MODNAME): %$(MODEXT): %$(EXE)
@$(RM) $@
$(LINK.mod)
#---------------------------------------------------------------
# Generate Perl include path module
%ModuleDirs.pm: $(wildcard $(TOP)/configure/RELEASE*)
@$(MKDIR) $(dir $@)
$(CONVERTRELEASE) -T $(TOP) $@
#---------------------------------------------------------------
# Automated testing
+15
View File
@@ -83,6 +83,7 @@ for ($outfile) {
m/releaseTops/ and do { releaseTops(); last; };
m/dllPath\.bat/ and do { dllPath(); last; };
m/relPaths\.sh/ and do { relPaths(); last; };
m/ModuleDirs\.pm/ and do { moduleDirs(); last; };
m/cdCommands/ and do { cdCommands(); last; };
m/envPaths/ and do { envPaths(); last; };
m/checkRelease/ and do { checkRelease(); last; };
@@ -99,6 +100,7 @@ Usage: convertRelease.pl [-a arch] [-T top] [-t ioctop] outfile
releaseTops - lists the module names defined in RELEASE*s
dllPath.bat - path changes for cmd.exe to find Windows DLLs
relPaths.sh - path changes for bash to add RELEASE bin dir's
*ModuleDirs.pm - generate a perl module adding lib/perl paths
cdCommands - generate cd path strings for vxWorks IOCs
envPaths - generate epicsEnvSet commands for other IOCs
checkRelease - checks consistency with support modules
@@ -147,6 +149,19 @@ sub binDirs {
return @path;
}
sub moduleDirs {
my @deps = grep !m/^ (TOP | RULES | TEMPLATE_TOP) $/x, @apps;
my @dirs = grep {-d $_}
map { AbsPath("$macros{$_}/lib/perl") } @deps;
unlink $outfile;
open(OUT, ">$outfile") or die "$! creating $outfile";
print OUT "# This is a generated file, do not edit!\n\n",
"use lib qw(\n",
map { " $_\n"; } @dirs;
print OUT ");\n\n1;\n";
close OUT;
}
#
# Generate cdCommands file with cd path strings for vxWorks IOCs and
# RTEMS IOCs using CEXP (need parentheses around command arguments).