Forked from
ESS EPICS Environment / wrappers / e3-require
1459 commits behind the upstream repository.
-
Simon Rose authoredSimon Rose authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
CONFIG_SUDO 1.05 KiB
# IF EPICS_BASE is not WRITABLE, SUDO and SUDOBASH should be used
# SUDO_INFO 1 : SUDO is needed (NOT writable)
# SUDO_INFO 0 : SUDO is not needed
SUDO_INFO := $(shell test -w $(EPICS_BASE) 1>&2 2> /dev/null; echo $$?)
SUDO_CMD := $(shell which sudo)
# For CentOS, devtoolset-{7,8} has -E option within sudo shell
# So we have to remove -E option as well if we would like to use devtoolset
#
ifeq "$(SUDO_INFO)" "1"
ifneq (,$(findstring devtoolset,$(SUDO_CMD)))
SUDO = $(SUDO_CMD)
else
SUDO = $(SUDO_CMD) -E
endif
SUDOBASH := $(SUDO) bash -c
else
SUDO :=
SUDOBASH = bash -c
endif
# Valid for only Development Mode, because we clone/remove them
# See RULES_DEV
# E3_MODULE_SRC_PATH_INFO 1 : the directory is not there
# E3_MODULE_SRC_PATH_INFO 0 : the directory is there
E3_MODULE_SRC_PATH_INFO := $(shell test -d $(E3_MODULE_SRC_PATH) 1>&2 2> /dev/null; echo $$?)
ifeq "$(E3_MODULE_SRC_PATH_INFO)" "1"
INIT_E3_MODULE_SRC = 1
endif
VARS_EXCLUDES+=SUDO
VARS_EXCLUDES+=SUDOBASH
VARS_EXCLUDES+=SUDO_INFO
VARS_EXCLUDES+=SUDO_CMD
VARS_EXCLUDES+=E3_MODULE_SRC_PATH_INFO