Skip to content
Snippets Groups Projects
Commit 0d845b96 authored by Simon Rose's avatar Simon Rose
Browse files

Cosmetic changes

parent e9193a26
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,10 @@ M_SSCAN:=$(COMMUNITY_EPICS_MODULES)/sscan
M_SNCSEQ:=$(COMMUNITY_EPICS_MODULES)/seq
M_IP:=$(COMMUNITY_EPICS_MODULES)/ip
M_IPAC:=$(COMMUNITY_EPICS_MODULES)/ipac
M_ADSUPPORT:=$(COMMUNITY_EPICS_MODULES)/adsupport
M_ADCORE:=$(COMMUNITY_EPICS_MODULES)/adcore
M_OPCUA:=$(COMMUNITY_EPICS_MODULES)/opcua
export M_AUTOSAVE
......@@ -34,8 +38,9 @@ export M_SSCAN
export M_SNCSEQ
export M_IP
export M_IPAC
export M_ADSUPPORT
export M_ADCORE
export M_OPCUA
### Exclude the following variables to display
VARS_EXCLUDES+=COMMUNITY_EPICS_MODULES
......@@ -55,3 +60,7 @@ VARS_EXCLUDES+=M_SSCAN
VARS_EXCLUDES+=M_SNCSEQ
VARS_EXCLUDES+=M_IP
VARS_EXCLUDES+=M_IPAC
VARS_EXCLUDES+=M_ADSUPPORT
VARS_EXCLUDES+=M_ADCORE
VARS_EXCLUDES+=M_OPCUA
......@@ -2,11 +2,13 @@
# 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"
SUDO_CMD := $(shell which sudo)
ifneq (,$(findstring devtoolset,$(SUDO_CMD)))
# Found, devtoolset-{7,8} has -E option within sudo shell
SUDO = $(SUDO_CMD)
else
SUDO = $(SUDO_CMD) -E
......@@ -15,7 +17,7 @@ SUDOBASH := $(SUDO) bash -c
else
SUDO :=
SUDOBASH = bash -c
endif
endif
# Valid for only Development Mode, because we clone/remove them
......@@ -30,10 +32,8 @@ endif
VARS_EXCLUDES+=SUDO
VARS_EXCLUDES+=SUDOBASH
VARS_EXCLUDES+=SUDO_INFO
VARS_EXCLUDES+=SUDO_CMD
VARS_EXCLUDES+=E3_MODULE_SRC_PATH_INFO
......@@ -5,11 +5,12 @@
.PHONY: help default install uninstall build rebuild clean conf all
default: help
# # help is defined in
# # https://gist.github.com/rcmachado/af3db315e31383502660
help:
$(info --------------------------------------- )
$(info --------------------------------------- )
$(info Available targets)
$(info --------------------------------------- )
$(QUIET) awk '/^[a-zA-Z\-\_0-9]+:/ { \
......@@ -22,20 +23,15 @@ help:
print $$1 "\t" helpMsg; \
} \
{ helpMsg = $$0 }' \
$(MAKEFILE_LIST) | column -ts:
$(MAKEFILE_LIST) | column -ts:
default: help
## Install : $(E3_MODULE_NAME)
install: uninstall requireconf
$(QUIET) $(SUDOBASH) '$(E3_MODULE_MAKE_CMDS) install'
## Uninstall : $(E3_MODULE_NAME)
uninstall: conf
$(QUIET) $(SUDOBASH) '$(E3_MODULE_MAKE_CMDS) uninstall'
......@@ -50,12 +46,12 @@ build: conf checkout
## Clean, build, and install the EPICS Module : $(E3_MODULE_NAME)
rebuild: clean build install
all: init patch rebuild
## Clean : $(E3_MODULE_NAME)
clean: conf
$(QUIET) $(E3_MODULE_MAKE_CMDS) clean
all: init patch rebuild
## Copy $(E3_MODULE_MAKEFILE) into $(E3_MODULE_SRC_PATH)
conf:
......@@ -66,7 +62,8 @@ conf:
.PHONY: init git-submodule-sync $(E3_MODULE_SRC_PATH) checkout
## Initialize : $(E3_MODULE_SRC_PATH)
init: git-submodule-sync $(E3_MODULE_SRC_PATH) checkout
init: git-submodule-sync $(E3_MODULE_SRC_PATH) checkout
git-submodule-sync:
$(QUIET) git submodule sync
......@@ -75,6 +72,7 @@ git-submodule-sync:
$(E3_MODULE_SRC_PATH):
$(QUIET) $(git_update)
checkout:
cd $(E3_MODULE_SRC_PATH) && git checkout $(EPICS_MODULE_TAG)
......
# Extra rules to expand .dbd files. Taken from $(EPICS_BASE)/configure/RULES.Db
#
#
DBDCAT_SOURCES += $(foreach file, $($*_DBD), $(DBDCAT_SOURCE) )
DBDCAT_SOURCE = $(firstword $(wildcard $(file) $(foreach dir, \
$(DBD_SEARCH_DIRS),$(addsuffix /$(file),$(dir)))) \
$(COMMON_DIR)/$(file))
DBDCAT_COMMAND = $(if $(DBDCAT_SOURCES),\
$(CAT) $(DBDCAT_SOURCES) > $(notdir $@),\
@echo "No input files for $(notdir $@)")
INSTALL_DBDS += $(addprefix $(INSTALL_DBD)/,$(DBDCAT))
define DBDCAT_template
$$(COMMON_DIR)/$(1).dbd: ../Makefile $$(foreach file, $$($(1)_DBD),$$(DBDCAT_SOURCE) )
endef
$(foreach name,$(subst .dbd,,$(DBDCAT)), $(eval $(call DBDCAT_template,$(name))))
$(DBDCAT):$(COMMON_DIR)/%.dbd:
$(ECHO) "Creating dbd file $(notdir $@)"
@$(RM) $(notdir $@)
$(DBDCAT_COMMAND)
@$(MV) $(notdir $@) $@
$(COMMON_DIR)/%.dbd:
$(ECHO) "Creating dbd file $(notdir $@)"
@$(RM) $(notdir $@)
$(DBEXPAND) $(DBDFLAGS) -o $(notdir $@) $($*_DBD)
@$(MV) $(notdir $@) $@
\ No newline at end of file
......@@ -36,6 +36,7 @@ nonexists:
$(QUIET)echo ""
else
devdebug: debug
devbuild: build
devclean: clean
devinstall: install
......
......@@ -10,7 +10,7 @@ default: help
# # help is defined in
# # https://gist.github.com/rcmachado/af3db315e31383502660
help:
$(info --------------------------------------- )
$(info --------------------------------------- )
$(info Available targets)
$(info --------------------------------------- )
$(QUIET) awk '/^[a-zA-Z\-\_0-9]+:/ { \
......@@ -23,7 +23,7 @@ help:
print $$1 "\t" helpMsg; \
} \
{ helpMsg = $$0 }' \
$(MAKEFILE_LIST) | column -ts:
$(MAKEFILE_LIST) | column -ts:
......@@ -66,7 +66,7 @@ clean: conf
all: init patch rebuild
## Copy $(E3_MODULE_MAKEFILE) into $(E3_MODULE_SRC_PATH)
conf:
conf:
$(QUIET) install -m 644 $(TOP)/$(E3_MODULE_MAKEFILE) $(E3_MODULE_SRC_PATH)/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment