5.3 Change an application’s installation path
Build the Chapter 4 application into a separate directory and inspect
how INSTALL_LOCATION and IOCS_APPL_TOP affect files and runtime
paths. These settings do not rebuild the binary distribution.
-
In the
jeonglee_Demo/application root, build with existing settings:makeKeep a copy of any existing
configure/CONFIG_SITE.localbefore replacing its contents in this exercise. -
Select an empty installation directory and set the local override:
INSTALL_DIR="$(mktemp -d)" printf 'INSTALL_LOCATION=%s\n' "$INSTALL_DIR" > configure/CONFIG_SITE.local make clean make ls "$INSTALL_DIR" cat iocBoot/ioctraining-jeonglee_Demo/envPathsProducts include
bin,db,dbd,iocsh, andlib. GeneratedTOPpoints toINSTALL_DIR. Boot scripts remain in the source application’siocBoot; the build does not install that directory. -
Compare cleanup targets:
make clean ls "$INSTALL_DIR/bin/linux-x86_64" make make distclean ls "$INSTALL_DIR" make installcleanremoves intermediate files and leaves installed products.distcleanalso removes installed products; directories can remain.make installrebuilds and installs the products. -
Distinguish the build host’s path from the IOC’s runtime path:
RUNTIME_DIR="$(mktemp -d)" printf 'IOCS_APPL_TOP=%s\n' "$RUNTIME_DIR" >> configure/CONFIG_SITE.local make clean make cat iocBoot/ioctraining-jeonglee_Demo/envPathsProducts remain in
INSTALL_DIR;envPathsusesRUNTIME_DIRforTOP. This describes where files are visible to the IOC. It does not copy them there. Do not start the IOC until that path has its files. -
Restore the application’s default path and rebuild:
printf '' > configure/CONFIG_SITE.local make clean make cat iocBoot/ioctraining-jeonglee_Demo/envPathsIf you had a local configuration, restore its saved copy instead.
TOPmust point to the intended application path. -
Remove the two temporary directories:
rm -rf "$INSTALL_DIR" "$RUNTIME_DIR"
Build option reference
CONFIG_SITE controls build settings; RELEASE selects dependencies.
Use configure/CONFIG_SITE.local for application-specific overrides.
| Setting | Effect |
|---|---|
CHECK_RELEASE | YES checks dependencies; WARN reports conflicts and continues; NO disables the check |
HOST_OPT, CROSS_OPT | Optimization for host and cross builds |
CROSS_COMPILER_TARGET_ARCHS | Cross targets for this application |
USR_CPPFLAGS, USR_CFLAGS, USR_LDFLAGS | Additional preprocessor, C compiler, and linker flags |
INSTALL_LOCATION | Installation directory, normally $(TOP) |
IOCS_APPL_TOP | IOC-visible application path used in boot configuration |
The generator sets CHECK_RELEASE=NO. The installed 1.5.0 Base sets
HOST_OPT=YES and CROSS_OPT=YES; inspect the selected tree rather than
assuming they are disabled. A local HOST_OPT=NO requests a non-optimized
host build for debugging.