Skip to content

Commit

Permalink
add WITH_PATCHSET into showopts, and clean up default help
Browse files Browse the repository at this point in the history
  • Loading branch information
jeonghanlee committed May 30, 2019
1 parent d83757a commit b7c26ea
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 23 deletions.
60 changes: 40 additions & 20 deletions configure/E3/RULES_ETHERLAB
Original file line number Diff line number Diff line change
Expand Up @@ -23,42 +23,42 @@ help:

default: help

## Install : EtherCAT Master Library, Header Files, and Program
## Install EtherCAT Master Library, Header Files, and Program
install:
$(QUIET) $(SUDOBASH) '$(E3_MODULE_MAKE_CMDS) install'

## Bninstall : EtherCAT Master Library, Header Files, and Program
## Uninstall EtherCAT Master Library, Header Files, and Program
uninstall: conf
$(QUIET) $(SUDOBASH) '$(E3_MODULE_MAKE_CMDS) uninstall'


# Build always the Module with the EPICS_MODULES_TAG
## Build: EtherCAT Master Library and Program
## Build EtherCAT Master Library and Program
build: autoconf
$(QUIET) $(E3_MODULE_MAKE_CMDS) build


## Clean, build, and install the EPICS Module : EtherCAT Master Library, Header Files, and Program
## Clean, build, and install
rebuild: clean build install


## Clean : EtherCAT Master Library, Header Files, and Program
## Clean EtherCAT Master Library, Header Files, and Program
clean: conf
$(QUIET) $(E3_MODULE_MAKE_CMDS) clean

## Distclean : Clean and Remove the Cloned Source
## Distclean
distclean: clean
rm -rf $(E3_MODULE_SRC_PATH)

## modules : EtherCAT Master Kernel Modules Compiliation
## Standard kernel compilation (Please use dkms)
modules: conf
$(QUIET) $(E3_MODULE_MAKE_CMDS) modules


modules_clean:
$(QUIET) $(SUDO2) '$(E3_MODULE_MAKE_CMDS) modules clean'

# always sudo is needed
## modules_install : EtherCAT Master Kernel Modules Installation
modules_install:
$(QUIET) $(SUDO2) '$(E3_MODULE_MAKE_CMDS) modules_install'

Expand All @@ -79,55 +79,75 @@ conf:

.PHONY: dkms_add dkms_remove dkms_build dkms_install dkms_uninstall

#dkms_add: conf
## dkms_add
dkms_add: dkmsconf conf
$(QUIET) $(SUDO2) 'install -m 755 -d /usr/src/$(E3_MODULE_NAME)-$(E3_MODULE_VERSION)'
$(QUIET) $(SUDO2) 'cp -r $(TOP)/$(E3_MODULE_SRC_PATH)/* /usr/src/$(E3_MODULE_NAME)-$(E3_MODULE_VERSION)/'
$(QUIET) $(SUDOBASH) '$(E3_MODULE_MAKE_CMDS) dkms_add'

## dkms_remove
dkms_remove: conf
$(QUIET) $(SUDOBASH) '$(E3_MODULE_MAKE_CMDS) dkms_remove'
ifneq ($(wildcard /usr/src/$(E3_MODULE_NAME)-$(E3_MODULE_VERSION)/.*),)
$(QUIET) $(SUDO2) 'rm -rf /usr/src/$(E3_MODULE_NAME)-$(E3_MODULE_VERSION)/'
endif


## dkms_build
dkms_build:
$(QUIET) $(SUDO2) '$(E3_MODULE_MAKE_CMDS) dkms_build'


## dkms_install
dkms_install:
$(QUIET) $(SUDOBASH) '$(E3_MODULE_MAKE_CMDS) dkms_install'

## dkms_uninstall
dkms_uninstall:
$(QUIET) $(SUDOBASH) '$(E3_MODULE_MAKE_CMDS) dkms_uninstall'



.PHONY: setup setup_clean

## Configuration for EtherCAT Master (systemd, ethercat.conf, and others)
## Configuration for EtherCAT Master (systemd, ethercat.conf, and others)
setup:
$(QUIET) bash $(TOP)/scripts/etherlab_setup.bash -t $(E3_ETHERLAB_INSTALL_LOCATION)

## Clean up the configuration for EtherCAT Master (systemd, ethercat.conf, and others)
## Clean up the configuration for EtherCAT Master (systemd, ethercat.conf, and others)
setup_clean:
$(QUIET) bash $(TOP)/scripts/etherlab_setup_clean.bash


.PHONY: init deinit hg_update_rev

## Cloning the EtherCAT Master Source and Change it to the Specific Revision
ifeq ($(WITH_PATCHSET),NO)
init:
ifneq ($(wildcard $(E3_MODULE_SRC_PATH)/.*),)
#
$(QUIET) echo "$(E3_MODULE_SRC_PATH) exists already."
$(QUIET) echo "Please do make deinit first if one would like to init."
#
else
ifneq (, $(HG_CMD))
hg clone http://hg.code.sf.net/p/etherlabmaster/code $(E3_MODULE_SRC_PATH) -r $(E3_ETHERLAB_BRANCH)
$(QUIET)cd $(E3_MODULE_SRC_PATH) && hg update -r $(EPICS_MODULE_TAG)
$(QUIET)cd $(E3_MODULE_SRC_PATH) && hg id -nib
$(MAKE) patch
else
$(QUIET)echo ""
$(QUIET)echo "-----------------------------------------------------------------------"
$(QUIET)echo ">>>> Please install mercurial, hg is needed to download sources <<<<"
$(QUIET)echo "-----------------------------------------------------------------------"
# -----------------------------------------------------------------------
# >>>> Please install mercurial, hg is needed to download sources <<<<
# -----------------------------------------------------------------------
endif
endif
#
else # ifeq ($(WITH_PATCHSET),NO)
init:
$(QUIET)echo ""
# Please set WITH_PATCHSET=NO within configure/CONFIG_OPTIONS via
# echo "WITH_PATCHSET=NO" >> configure/CONFIG_OPTIONS.local
$(QUIET)echo ""
endif # ifeq ($(WITH_PATCHSET),NO)


## Remove clone source files
deinit:
Expand All @@ -141,7 +161,7 @@ ifneq (, $(HG_CMD))
$(QUIET)cd $(E3_MODULE_SRC_PATH) && hg id -nib
else
$(QUIET)echo ""
$(QUIET)echo "-----------------------------------------------------------------------"
$(QUIET)echo ">>>> Please install mercurial, hg is needed to download sources <<<<"
$(QUIET)echo "-----------------------------------------------------------------------"
# -----------------------------------------------------------------------
# >>>> Please install mercurial, hg is needed to download sources <<<<
# -----------------------------------------------------------------------
endif
12 changes: 9 additions & 3 deletions configure/E3/RULES_VARS
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ E3_MODULES_VARIABLES:=$(sort $(filter-out $(VARS_EXCLUDES) VARS_EXCLUDES,$(.VARI

DEV_OPTS_VARS:=$(filter WITH_DEV_%, $(E3_MODULES_VARIABLES))
ENABLE_OPTS_VARS:=$(filter ENABLE_%, $(E3_MODULES_VARIABLES))
PATCHSET_VARS:=$(filter WITH_PATCHSET, $(E3_MODULES_VARIABLES))

.PHONY: env vars header

Expand All @@ -15,7 +16,7 @@ vars: header
header:
$(QUIET)echo ""
$(QUIET)echo "------------------------------------------------------------"
$(QUIET)echo ">>>> Current Building Envrionment Variables <<<<"
$(QUIET)echo ">>>> Current Building Environment Variables <<<<"
$(QUIET)echo "------------------------------------------------------------"
$(QUIET)echo ""

Expand All @@ -25,8 +26,13 @@ header:
patchsetvars: vars


showopts: optsheader showdevopts showenableopts
showopts: optsheader showpatchset showdevopts showenableopts


showpatchset:
$(foreach v, $(PATCHSET_VARS), $(info $(v) = $($(v)))) @#noop
$(QUIET)echo ""

showdevopts:
$(foreach v, $(DEV_OPTS_VARS), $(info $(v) = $($(v)))) @#noop
$(QUIET)echo ""
Expand All @@ -44,7 +50,7 @@ optsheader:
$(QUIET)echo "$(E3_ETHERLAB_CONF_OPTIONS)"
$(QUIET)echo ""


## Check the configured network driver if it is the generic driver (will be disappeared with a native driver)
show_netdrv:
$(QUIET)grep -r 'DRIVER' /sys/class/net/*/device/uevent | grep -e $(ETHERCAT_MASTER0)

0 comments on commit b7c26ea

Please sign in to comment.