diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index b431a578b..0adabdbc7 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -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 diff --git a/src/tools/convertRelease.pl b/src/tools/convertRelease.pl index e2f13a556..556abd826 100644 --- a/src/tools/convertRelease.pl +++ b/src/tools/convertRelease.pl @@ -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).