Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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.

  1. In the jeonglee_Demo/ application root, build with existing settings:

    make
    

    Keep a copy of any existing configure/CONFIG_SITE.local before replacing its contents in this exercise.

  2. 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/envPaths
    

    Products include bin, db, dbd, iocsh, and lib. Generated TOP points to INSTALL_DIR. Boot scripts remain in the source application’s iocBoot; the build does not install that directory.

  3. Compare cleanup targets:

    make clean
    ls "$INSTALL_DIR/bin/linux-x86_64"
    make
    make distclean
    ls "$INSTALL_DIR"
    make install
    

    clean removes intermediate files and leaves installed products. distclean also removes installed products; directories can remain. make install rebuilds and installs the products.

  4. 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/envPaths
    

    Products remain in INSTALL_DIR; envPaths uses RUNTIME_DIR for TOP. 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.

  5. Restore the application’s default path and rebuild:

    printf '' > configure/CONFIG_SITE.local
    make clean
    make
    cat iocBoot/ioctraining-jeonglee_Demo/envPaths
    

    If you had a local configuration, restore its saved copy instead. TOP must point to the intended application path.

  6. 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.

SettingEffect
CHECK_RELEASEYES checks dependencies; WARN reports conflicts and continues; NO disables the check
HOST_OPT, CROSS_OPTOptimization for host and cross builds
CROSS_COMPILER_TARGET_ARCHSCross targets for this application
USR_CPPFLAGS, USR_CFLAGS, USR_LDFLAGSAdditional preprocessor, C compiler, and linker flags
INSTALL_LOCATIONInstallation directory, normally $(TOP)
IOCS_APPL_TOPIOC-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.