Added envPaths functionality, and using these variables in st.cmd files
This commit is contained in:
@ -15,7 +15,7 @@ install: buildInstall
|
||||
|
||||
buildInstall: $(TARGETS)
|
||||
|
||||
cdCommands: $(wildcard $(TOP)/configure/RELEASE*) \
|
||||
envPaths cdCommands: $(wildcard $(TOP)/configure/RELEASE*) \
|
||||
$(TOP)/configure/CONFIG $(TOP)/bin
|
||||
@$(RM) $@
|
||||
ifeq ($(IOCS_APPL_TOP),)
|
||||
|
@ -59,7 +59,8 @@ unless (@ARGV == 1) {
|
||||
print "Usage: convertRelease.pl [-a arch] [-h hostarch] [-t ioctop] outfile\n";
|
||||
print " where outfile is be one of:\n";
|
||||
print "\tcheckRelease - checks consistency with support apps\n";
|
||||
print "\tcdCommands - generate cd path strings for IOC use\n";
|
||||
print "\tcdCommands - generate cd path strings for vxWorks IOCs\n";
|
||||
print "\tenvPaths - generate epicsEnvSet commands for other IOCs\n";
|
||||
print "\tCONFIG_APP_INCLUDE - additional build variables\n";
|
||||
print "\tRULES_INCLUDE - supports installable build rules\n";
|
||||
exit 2;
|
||||
@ -87,6 +88,7 @@ for ($outfile) {
|
||||
/CONFIG_APP_INCLUDE/ and do { &configAppInclude; last; };
|
||||
/RULES_INCLUDE/ and do { &rulesInclude; last; };
|
||||
/cdCommands/ and do { &cdCommands; last; };
|
||||
/envPaths/ and do { &envPaths; last; };
|
||||
/checkRelease/ and do { &checkRelease; last; };
|
||||
die "Output file type \'$outfile\' not supported";
|
||||
}
|
||||
@ -237,6 +239,26 @@ sub cdCommands {
|
||||
}
|
||||
close OUT;
|
||||
}
|
||||
sub envPaths {
|
||||
die "Architecture not set (use -a option)" unless ($arch);
|
||||
@includes = grep !/^TEMPLATE_TOP$/, @apps;
|
||||
|
||||
unlink($outfile);
|
||||
open(OUT,">$outfile") or die "$! creating $outfile";
|
||||
|
||||
$ioc = $cwd;
|
||||
$ioc =~ s/^.*\///;
|
||||
|
||||
print OUT "epicsEnvSet(ARCH,\"$arch\")\n";
|
||||
print OUT "epicsEnvSet(IOC,\"$ioc\")\n";
|
||||
|
||||
foreach $app (@includes) {
|
||||
$iocpath = $path = $macros{$app};
|
||||
$iocpath =~ s/^$root/$iocroot/ if ($opt_t);
|
||||
print OUT "epicsEnvSet($app,\"$iocpath\")\n" if (-d $path);
|
||||
}
|
||||
close OUT;
|
||||
}
|
||||
sub checkRelease {
|
||||
$status = 0;
|
||||
delete $macros{TOP};
|
||||
|
@ -1,4 +1,5 @@
|
||||
TOP = ../..
|
||||
include $(TOP)/configure/CONFIG
|
||||
#nothing to do
|
||||
ARCH = _ARCH_
|
||||
TARGETS = envPaths
|
||||
include $(TOP)/configure/RULES.ioc
|
||||
|
@ -3,20 +3,25 @@
|
||||
## You may have to change _APPNAME_ to something else
|
||||
## everywhere it appears in this file
|
||||
|
||||
< envPaths
|
||||
|
||||
cd ${TOP}
|
||||
|
||||
## Register all support components
|
||||
dbLoadDatabase("../../dbd/_APPNAME_.dbd",0,0)
|
||||
dbLoadDatabase("dbd/_APPNAME_.dbd",0,0)
|
||||
_APPNAME__registerRecordDeviceDriver(pdbbase)
|
||||
|
||||
## Load record instances
|
||||
dbLoadRecords("../../db/dbExample1.db","user=_USER_Host")
|
||||
dbLoadRecords("../../db/dbExample2.db","user=_USER_Host,no=1,scan=1 second")
|
||||
dbLoadRecords("../../db/dbExample2.db","user=_USER_Host,no=2,scan=2 second")
|
||||
dbLoadRecords("../../db/dbExample2.db","user=_USER_Host,no=3,scan=5 second")
|
||||
dbLoadRecords("../../db/dbSubExample.db","user=_USER_Host")
|
||||
dbLoadRecords("db/dbExample1.db","user=_USER_Host")
|
||||
dbLoadRecords("db/dbExample2.db","user=_USER_Host,no=1,scan=1 second")
|
||||
dbLoadRecords("db/dbExample2.db","user=_USER_Host,no=2,scan=2 second")
|
||||
dbLoadRecords("db/dbExample2.db","user=_USER_Host,no=3,scan=5 second")
|
||||
dbLoadRecords("db/dbSubExample.db","user=_USER_Host")
|
||||
|
||||
## Set this to see messages from mySub
|
||||
#var mySubDebug 1
|
||||
|
||||
cd ${TOP}/iocBoot/${IOC}
|
||||
iocInit()
|
||||
|
||||
## Start any sequence programs
|
||||
|
@ -3,6 +3,8 @@
|
||||
## You may have to change _APPNAME_ to something else
|
||||
## everywhere it appears in this file
|
||||
|
||||
#< envPaths
|
||||
|
||||
## Register all support components
|
||||
dbLoadDatabase("dbd/_APPNAME_.dbd",0,0)
|
||||
_APPNAME__registerRecordDeviceDriver(pdbbase)
|
||||
|
@ -1,4 +1,5 @@
|
||||
TOP = ../..
|
||||
include $(TOP)/configure/CONFIG
|
||||
# nothing to do
|
||||
ARCH = _ARCH_
|
||||
TARGETS = envPaths
|
||||
include $(TOP)/configure/RULES.ioc
|
||||
|
@ -3,13 +3,18 @@
|
||||
## You may have to change _APPNAME_ to something else
|
||||
## everywhere it appears in this file
|
||||
|
||||
< envPaths
|
||||
|
||||
cd ${TOP}
|
||||
|
||||
## Register all support components
|
||||
dbLoadDatabase("../../dbd/_APPNAME_.dbd",0,0)
|
||||
dbLoadDatabase("dbd/_APPNAME_.dbd",0,0)
|
||||
_APPNAME__registerRecordDeviceDriver(pdbbase)
|
||||
|
||||
## Load record instances
|
||||
#dbLoadRecords("../../db/xxx.db","user=_USER_Host")
|
||||
#dbLoadRecords("db/xxx.db","user=_USER_Host")
|
||||
|
||||
cd ${TOP}/iocBoot/${IOC}
|
||||
iocInit()
|
||||
|
||||
## Start any sequence programs
|
||||
|
@ -3,6 +3,8 @@
|
||||
## You may have to change _APPNAME_ to something else
|
||||
## everywhere it appears in this file
|
||||
|
||||
#< envPaths
|
||||
|
||||
## Register all support components
|
||||
dbLoadDatabase("dbd/_APPNAME_.dbd",0,0)
|
||||
_APPNAME__registerRecordDeviceDriver(pdbbase)
|
||||
|
Reference in New Issue
Block a user