diff --git a/configure/RULES.ioc b/configure/RULES.ioc index 1024fcb22..da314a406 100644 --- a/configure/RULES.ioc +++ b/configure/RULES.ioc @@ -24,11 +24,15 @@ else clean$(DIVIDER)$(ARCH) clean: endif -cdCommands envPaths dllPath.bat relPaths.sh: \ +cdCommands dllPath.bat relPaths.sh: \ $(wildcard $(TOP)/configure/RELEASE*) \ - $(wildcard $(TOP)/configure/CONFIG_SITE*) $(INSTALL_BIN) + $(wildcard $(TOP)/configure/CONFIG_SITE*) | $(INSTALL_BIN) $(CONVERTRELEASE) -a $(ARCH) -t $(IOCS_APPL_TOP) $@ +envPaths: $(wildcard $(TOP)/configure/RELEASE*) \ + $(wildcard $(TOP)/configure/CONFIG_SITE*) | $(INSTALL_BIN) + $(CONVERTRELEASE) -t $(IOCS_APPL_TOP) $@ + realclean: $(RM) cdCommands envPaths dllPath.bat relPaths.sh diff --git a/src/ioc/misc/iocshRegisterCommon.c b/src/ioc/misc/iocshRegisterCommon.c index 0341dfbd6..9e0936e2b 100644 --- a/src/ioc/misc/iocshRegisterCommon.c +++ b/src/ioc/misc/iocshRegisterCommon.c @@ -7,6 +7,7 @@ * in file LICENSE that is included with this distribution. \*************************************************************************/ +#include "envDefs.h" #include "iocsh.h" #include "libComRegister.h" @@ -24,6 +25,11 @@ void iocshRegisterCommon(void) { iocshPpdbbase = &pdbbase; + const char *targetArch = envGetConfigParamPtr(&EPICS_TARGET_ARCH); + + if (targetArch) { + epicsEnvSet("ARCH", targetArch); + } dbStaticIocRegister(); registryIocRegister(); diff --git a/src/template/base/top/exampleBoot/ioc/Makefile@Common b/src/template/base/top/exampleBoot/ioc/Makefile@Common index 64a3e8bf7..e064d7344 100644 --- a/src/template/base/top/exampleBoot/ioc/Makefile@Common +++ b/src/template/base/top/exampleBoot/ioc/Makefile@Common @@ -1,5 +1,4 @@ TOP = ../.. include $(TOP)/configure/CONFIG -ARCH = _ARCH_ TARGETS = envPaths include $(TOP)/configure/RULES.ioc diff --git a/src/template/base/top/iocBoot/ioc/Makefile@Common b/src/template/base/top/iocBoot/ioc/Makefile@Common index 64a3e8bf7..e064d7344 100644 --- a/src/template/base/top/iocBoot/ioc/Makefile@Common +++ b/src/template/base/top/iocBoot/ioc/Makefile@Common @@ -1,5 +1,4 @@ TOP = ../.. include $(TOP)/configure/CONFIG -ARCH = _ARCH_ TARGETS = envPaths include $(TOP)/configure/RULES.ioc diff --git a/src/tools/convertRelease.pl b/src/tools/convertRelease.pl index abf63c3ec..f4eb3f798 100644 --- a/src/tools/convertRelease.pl +++ b/src/tools/convertRelease.pl @@ -134,6 +134,7 @@ sub relPaths { } sub binDirs { + die "Architecture not set (use -a option)\n" unless ($arch); my @includes = grep !m/^ (RULES | TEMPLATE_TOP) $/x, @apps; my @path; foreach my $app (@includes) { @@ -165,7 +166,6 @@ sub cdCommands { my $ioc = $cwd; $ioc =~ s/^.*\///; # iocname is last component of directory name - print OUT "putenv(\"ARCH=$arch\")\n"; print OUT "putenv(\"IOC=$ioc\")\n"; foreach my $app (@includes) { @@ -188,7 +188,6 @@ sub cdCommands { # Include parentheses anyway in case CEXP users want to use this. # sub envPaths { - die "Architecture not set (use -a option)" unless ($arch); my @includes = grep !m/^ (RULES | TEMPLATE_TOP) $/x, @apps; unlink($outfile); @@ -197,7 +196,6 @@ sub envPaths { my $ioc = $cwd; $ioc =~ s/^.*\///; # iocname is last component of directory name - print OUT "epicsEnvSet(\"ARCH\",\"$arch\")\n"; print OUT "epicsEnvSet(\"IOC\",\"$ioc\")\n"; foreach my $app (@includes) {