Makefile (modules-5.1.1.tar.bz2) | : | Makefile (modules-5.2.0.tar.bz2) | ||
---|---|---|---|---|
.PHONY: dist-win install install-testconfig uninstall-testconfig uninstall \ | .PHONY: dist-win install install-testconfig uninstall-testconfig uninstall \ | |||
clean | clean | |||
# use bash shell to correctly expand the $'' syntax used in translate-in-script | # use bash shell to correctly expand the $'' syntax used in translate-in-script | |||
SHELL = /usr/bin/env bash | SHELL = /usr/bin/env bash | |||
# commands to install files | ||||
INSTALL = install | ||||
INSTALL_DIR = $(INSTALL) -d -m 755 | ||||
INSTALL_DATA = $(INSTALL) -m 644 | ||||
SH_LIKE = sh ksh bash zsh profile.sh | SH_LIKE = sh ksh bash zsh profile.sh | |||
CSH_LIKE = csh tcsh tcsh_completion profile.csh | CSH_LIKE = csh tcsh tcsh_completion profile.csh | |||
OTHER = perl.pm python.py ruby.rb lisp tcl fish cmake r.R | OTHER = perl.pm python.py ruby.rb lisp tcl fish cmake r.R | |||
# example modulefiles to install | # example modulefiles to install | |||
EXAMPLE_MODFILES_SRCDIR := ../contrib/modulefiles | EXAMPLE_MODFILES_SRCDIR := ../contrib/modulefiles | |||
EXAMPLE_MODFILES = dot module-git module-info modules null use.own | EXAMPLE_MODFILES = dot module-git module-info modules null use.own | |||
EXAMPLE_WIN_MODFILES = module-git module-info null | EXAMPLE_WIN_MODFILES = module-git module-info null | |||
EXAMPLE_TESTCONFIG_MODFILES = null | EXAMPLE_TESTCONFIG_MODFILES = null | |||
# source definitions shared across the Makefiles of this project | # source definitions shared across the Makefiles of this project | |||
ifneq ($(wildcard ../Makefile.inc),../Makefile.inc) | ifneq ($(wildcard ../Makefile.inc),../Makefile.inc) | |||
$(error ../Makefile.inc is missing, please run '../configure') | $(error ../Makefile.inc is missing, please run '../configure') | |||
endif | endif | |||
include ../Makefile.inc | include ../Makefile.inc | |||
# generate 'module use' commands to put in initrc from modulepath unless | # generate 'module use' commands to put in initrc from modulepath unless | |||
# if the modulespath config file should be deployed | # if the modulespath config file should be deployed | |||
ifeq ($(setmodulespath),n) | ifeq ($(setmodulespath),n) | |||
# need to escape eventual space character in each modulepath/loadedmodule | ||||
# entry to correctly produce the module use/module load rules | ||||
space := $(subst ,, ) | ||||
modulerc := \\\n\# enable default modulepaths | modulerc := \\\n\# enable default modulepaths | |||
modulerc := $(modulerc)$(addprefix \\\nmodule use --append {,$(subst :,} ,$(modu | modulerc := $(modulerc)$(subst |,$(space),$(addprefix \\\nmodule use --append {, | |||
lepath)})) | \ | |||
$(subst :,} ,$(subst $(space),|,$(modulepath)))})) | ||||
endif | endif | |||
# generate 'module load' commands to put in initrc from loadedmodules | # generate 'module load' commands to put in initrc from loadedmodules | |||
ifneq ($(loadedmodules),) | ifneq ($(loadedmodules),) | |||
modulerc := $(modulerc)$(addprefix \\\nmodule load ,\ | modulerc := $(modulerc)$(subst |,$(space),$(addprefix \\\nmodule load {,\ | |||
$(subst :, ,$(loadedmodules))) | $(subst :,} ,$(subst $(space),|,$(loadedmodules)))})) | |||
endif | endif | |||
ifneq ($(modulerc),) | ifneq ($(modulerc),) | |||
modulerc := $(modulerc)\\\n | modulerc := $(modulerc)\\\n | |||
endif | endif | |||
# setup summary echo rules unless silent mode set | # setup summary echo rules unless silent mode set | |||
ECHO_DIR_PREFIX = init/ | ECHO_DIR_PREFIX = init/ | |||
ifneq ($(findstring s,$(MAKEFLAGS)),s) | ifneq ($(findstring s,$(MAKEFLAGS)),s) | |||
ECHO_GEN = @echo ' ' GEN $(ECHO_DIR_PREFIX)$@; | ECHO_GEN = @echo ' ' GEN $(ECHO_DIR_PREFIX)$@; | |||
endif | endif | |||
skipping to change at line 70 | skipping to change at line 79 | |||
initrc := $(etcdir)/initrc | initrc := $(etcdir)/initrc | |||
else | else | |||
modulespath := $(initdir)/.modulespath | modulespath := $(initdir)/.modulespath | |||
initrc := $(initdir)/modulerc | initrc := $(initdir)/modulerc | |||
endif | endif | |||
# define shell completion location | # define shell completion location | |||
ifeq ($(bashcompletiondir),) | ifeq ($(bashcompletiondir),) | |||
bashcompletiondir := $(initdir) | bashcompletiondir := $(initdir) | |||
makebashcompdir := n | makebashcompdir := n | |||
sourcebashcompre := s|@sourcebashcomp@||g | ||||
else | else | |||
makebashcompdir := y | makebashcompdir := y | |||
sourcebashcompre := /@sourcebashcomp@/d | ||||
endif | endif | |||
ifeq ($(fishcompletiondir),) | ifeq ($(fishcompletiondir),) | |||
fishcompletiondir := $(initdir) | fishcompletiondir := $(initdir) | |||
makefishcompdir := n | makefishcompdir := n | |||
sourcefishcompre := s|@sourcefishcomp@||g | ||||
else | else | |||
makefishcompdir := y | makefishcompdir := y | |||
sourcefishcompre := /@sourcefishcomp@/d | ||||
endif | endif | |||
ifeq ($(zshcompletiondir),) | ifeq ($(zshcompletiondir),) | |||
zshcompletiondir := $(initdir)/zsh-functions | zshcompletiondir := $(initdir)/zsh-functions | |||
setzshfpathre := s|@setzshfpath@||g | setzshfpathre := s|@setzshfpath@||g | |||
else | else | |||
setzshfpathre := /@setzshfpath@/d | setzshfpathre := /@setzshfpath@/d | |||
endif | endif | |||
# if enabled translate to keep text after markup elsewhere remove the | ||||
# entire line | ||||
ifeq ($(setmanpath),y) | ||||
setmanpathre := s|@setmanpath@||g | ||||
else | ||||
setmanpathre := /@setmanpath@/d | ||||
endif | ||||
ifeq ($(appendmanpath),y) | ||||
appendmanpathre := s|@appendmanpath@||g | ||||
prependmanpathre := /@prependmanpath@/d | ||||
else | ||||
appendmanpathre := /@appendmanpath@/d | ||||
prependmanpathre := s|@prependmanpath@||g | ||||
endif | ||||
ifeq ($(setbinpath),y) | ||||
setbinpathre := s|@setbinpath@||g | ||||
else | ||||
setbinpathre := /@setbinpath@/d | ||||
endif | ||||
ifeq ($(appendbinpath),y) | ||||
appendbinpathre := s|@appendbinpath@||g | ||||
prependbinpathre := /@prependbinpath@/d | ||||
else | ||||
appendbinpathre := /@appendbinpath@/d | ||||
prependbinpathre := s|@prependbinpath@||g | ||||
endif | ||||
ifeq ($(usemanpath),y) | ||||
usemanpathre := s|@usemanpath@||g | ||||
notusemanpathre := /@notusemanpath@/d | ||||
else | ||||
usemanpathre := /@usemanpath@/d | ||||
notusemanpathre := s|@notusemanpath@||g | ||||
endif | ||||
# comment entries if feature not enabled | # comment entries if feature not enabled | |||
ifeq ($(versioning),y) | ifeq ($(versioning),y) | |||
versdir := $(baseprefix)/versions | versdir := $(baseprefix)/versions | |||
setversioning := | setversioning := | |||
else | else | |||
setversioning := \# | setversioning := \# | |||
endif | endif | |||
# define translation rules for quarantine mechanism | # define translation rules for quarantine mechanism | |||
ifeq ($(quarantinevars),) | ifeq ($(quarantinevars),) | |||
skipping to change at line 150 | skipping to change at line 121 | |||
$(if $(filter-out ${1},${2}),s|\(@\(.*\)RUNENV_VAR\(.*\)RUNENV_VAL\(.*\)@\)|\2MO DULES_RUNENV_${1}\3${2}\4\n\1|g;) | $(if $(filter-out ${1},${2}),s|\(@\(.*\)RUNENV_VAR\(.*\)RUNENV_VAL\(.*\)@\)|\2MO DULES_RUNENV_${1}\3${2}\4\n\1|g;) | |||
endef | endef | |||
quarvarsre = -e 's|@RUN_QUARANTINE@|$(foreach vv,$(quarantinevars),$(firstword\ | quarvarsre = -e 's|@RUN_QUARANTINE@|$(foreach vv,$(quarantinevars),$(firstword\ | |||
$(subst =, ,$(vv))))|g; | $(subst =, ,$(vv))))|g; | |||
quarvarsre += $(foreach vv,$(quarantinevars),$(call runenvvarre,$(firstword\ | quarvarsre += $(foreach vv,$(quarantinevars),$(call runenvvarre,$(firstword\ | |||
$(subst =, ,$(vv))),$(subst $(firstword $(subst =, ,$(vv)))=,,$(vv)))) | $(subst =, ,$(vv))),$(subst $(firstword $(subst =, ,$(vv)))=,,$(vv)))) | |||
quarvarsre += s/@.*RUNENV_VAR.*@//;' | quarvarsre += s/@.*RUNENV_VAR.*@//;' | |||
endif | endif | |||
# define variables for shell completion | # define variables for shell completion | |||
comp_cmds := add add-any apropos aliases avail append-path clear config del disp lay edit help initadd initclear initlist initprepend initrm is-loaded is-saved i s-used is-avail info-loaded keyword list load load-any path paths purge prepend- path refresh reload restore rm remove remove-path save savelist saveshow saverm search show sh-to-mod source state swap switch test try-add try-load unload unus e use whatis | comp_cmds := add add-any apropos aliases avail append-path clear config del disp lay edit help initadd initclear initlist initprepend initrm is-loaded is-saved i s-used is-avail info-loaded keyword lint list load load-any mod-to-sh path paths purge prepend-path refresh reload reset restore rm remove remove-path save save list saveshow saverm search show sh-to-mod source stash stashclear stashlist sta shpop stashrm stashshow state swap switch test try-add try-load unload unuse use whatis | |||
comp_opts := -D -h -s -T -v -V -w --debug --help --silent --trace --verbose --ve rsion --paginate --no-pager --color --color= --width --width= | comp_opts := -D -h -s -T -v -V -w --debug --help --silent --trace --verbose --ve rsion --paginate --no-pager --color --color= --width --width= | |||
comp_load_opts := --auto --no-auto --force -f --icase -i --tag --tag= | comp_load_opts := --auto --no-auto --force -f --icase -i --tag --tag= | |||
comp_unload_opts := --auto --no-auto --force -f --icase -i | comp_unload_opts := --auto --no-auto --force -f --icase -i | |||
comp_list_opts := -a -j -l -o -t --all --json --long --output --output= --terse | comp_list_opts := -a -j -l -o -t --all --json --long --output --output= --terse | |||
comp_stashlist_opts := -j -l -t --json --long --terse | ||||
comp_clear_opts := --force -f | comp_clear_opts := --force -f | |||
comp_avail_opts := -a -C -d -i -j -L -l -o -S -t --all --contains --default --ic ase --json --latest --long --output --output= --starts-with --terse --indepth -- no-indepth | comp_avail_opts := -a -C -d -i -j -L -l -o -S -t --all --contains --default --ic ase --json --latest --long --output --output= --starts-with --terse --indepth -- no-indepth | |||
comp_mfile_opts := -i --icase | comp_mfile_opts := -i --icase | |||
comp_whatis_opts := -a -i -j --all --icase --json | comp_whatis_opts := -a -i -j --all --icase --json | |||
comp_search_opts := -a -j --all --json | comp_search_opts := -a -j --all --json | |||
comp_aliases_opts := -a --all | comp_aliases_opts := -a --all | |||
comp_isavail_opts := -a -i --all --icase | comp_isavail_opts := -a -i --all --icase | |||
comp_lint_opts := -a -i --all --icase | ||||
comp_modtosh_opts := --auto --no-auto --force -f --icase -i | ||||
comp_path_opts := -d --delim --duplicates | comp_path_opts := -d --delim --duplicates | |||
comp_rm_path_opts := -d --delim --index | comp_rm_path_opts := -d --delim --index | |||
comp_config_opts := --dump-state --reset advanced_version_spec auto_handling ava il_indepth avail_output avail_terse_output collection_pin_version collection_pin _tag collection_target color colors contact editor extended_default extra_siteco nfig home icase implicit_default implicit_requirement list_output list_terse_out put locked_configs mcookie_check mcookie_version_check ml nearly_forbidden_days pager quarantine_support rcfile redirect_output run_quarantine search_match set_ shell_startup shells_with_ksh_fpath silent_shell_debug tag_abbrev tag_color_name term_background term_width unload_match_order variant_shortcut verbosity wa_277 | comp_config_opts := --dump-state --reset advanced_version_spec auto_handling ava il_indepth avail_output avail_terse_output collection_pin_version collection_pin _tag collection_target color colors contact editor extended_default extra_siteco nfig home icase implicit_default implicit_requirement list_output list_terse_out put locked_configs mcookie_check mcookie_version_check ml nearly_forbidden_days pager protected_envvars quarantine_support rcfile redirect_output reset_target_s tate run_quarantine search_match set_shell_startup shells_with_ksh_fpath silent_ shell_debug tag_abbrev tag_color_name tcl_linter term_background term_width unlo ad_match_order variant_shortcut verbosity wa_277 | |||
define translate-in-script | define translate-in-script | |||
$(ECHO_GEN) | $(ECHO_GEN) | |||
sed -e 's|@prefix@|$(prefix)|g' \ | sed -e 's|@prefix@|$(prefix)|g' \ | |||
-e 's|@baseprefix@|$(baseprefix)|g' \ | -e 's|@baseprefix@|$(baseprefix)|g' \ | |||
-e 's|@libexecdir@|$(libexecdir)|g' \ | -e 's|@libexecdir@|$(libexecdir)|g' \ | |||
-e 's|@initdir@|$(initdir)|g' \ | -e 's|@initdir@|$(initdir)|g' \ | |||
-e 's|@etcdir@|$(etcdir)|g' \ | -e 's|@etcdir@|$(etcdir)|g' \ | |||
-e 's|@modulefilesdir@|$(modulefilesdir)|g' \ | -e 's|@modulefilesdir@|$(modulefilesdir)|g' \ | |||
-e 's|@bindir@|$(bindir)|g' \ | -e 's|@bindir@|$(bindir)|g' \ | |||
-e 's|@mandir@|$(mandir)|g' \ | -e 's|@mandir@|$(mandir)|g' \ | |||
-e 's|@comp_cmds@|$(comp_cmds)|g' \ | -e 's|@comp_cmds@|$(comp_cmds)|g' \ | |||
-e 's|@comp_opts@|$(comp_opts)|g' \ | -e 's|@comp_opts@|$(comp_opts)|g' \ | |||
-e 's|@comp_load_opts@|$(comp_load_opts)|g' \ | -e 's|@comp_load_opts@|$(comp_load_opts)|g' \ | |||
-e 's|@comp_unload_opts@|$(comp_unload_opts)|g' \ | -e 's|@comp_unload_opts@|$(comp_unload_opts)|g' \ | |||
-e 's|@comp_list_opts@|$(comp_list_opts)|g' \ | -e 's|@comp_list_opts@|$(comp_list_opts)|g' \ | |||
-e 's|@comp_stashlist_opts@|$(comp_stashlist_opts)|g' \ | ||||
-e 's|@comp_clear_opts@|$(comp_clear_opts)|g' \ | -e 's|@comp_clear_opts@|$(comp_clear_opts)|g' \ | |||
-e 's|@comp_avail_opts@|$(comp_avail_opts)|g' \ | -e 's|@comp_avail_opts@|$(comp_avail_opts)|g' \ | |||
-e 's|@comp_mfile_opts@|$(comp_mfile_opts)|g' \ | -e 's|@comp_mfile_opts@|$(comp_mfile_opts)|g' \ | |||
-e 's|@comp_whatis_opts@|$(comp_whatis_opts)|g' \ | -e 's|@comp_whatis_opts@|$(comp_whatis_opts)|g' \ | |||
-e 's|@comp_search_opts@|$(comp_search_opts)|g' \ | -e 's|@comp_search_opts@|$(comp_search_opts)|g' \ | |||
-e 's|@comp_aliases_opts@|$(comp_aliases_opts)|g' \ | -e 's|@comp_aliases_opts@|$(comp_aliases_opts)|g' \ | |||
-e 's|@comp_isavail_opts@|$(comp_isavail_opts)|g' \ | -e 's|@comp_isavail_opts@|$(comp_isavail_opts)|g' \ | |||
-e 's|@comp_lint_opts@|$(comp_lint_opts)|g' \ | ||||
-e 's|@comp_path_opts@|$(comp_path_opts)|g' \ | -e 's|@comp_path_opts@|$(comp_path_opts)|g' \ | |||
-e 's|@comp_rm_path_opts@|$(comp_rm_path_opts)|g' \ | -e 's|@comp_rm_path_opts@|$(comp_rm_path_opts)|g' \ | |||
-e 's|@comp_config_opts@|$(comp_config_opts)|g' \ | -e 's|@comp_config_opts@|$(comp_config_opts)|g' \ | |||
-e '$(setmanpathre)' \ | ||||
-e '$(appendmanpathre)' \ | ||||
-e '$(prependmanpathre)' \ | ||||
-e '$(setbinpathre)' \ | ||||
-e '$(appendbinpathre)' \ | ||||
-e '$(prependbinpathre)' \ | ||||
-e '$(usemanpathre)' \ | ||||
-e '$(notusemanpathre)' \ | ||||
-e '$(setzshfpathre)' \ | -e '$(setzshfpathre)' \ | |||
-e '$(sourcebashcompre)' \ | ||||
-e '$(sourcefishcompre)' \ | ||||
-e $$'s|@modulerc@|$(modulerc)|g' \ | -e $$'s|@modulerc@|$(modulerc)|g' \ | |||
-e 's|@modulepath@|$(modulepath)|g' \ | -e 's|@modulepath@|$(modulepath)|g' \ | |||
-e '$(setquarvarsre)' $(quarvarsre) \ | -e '$(setquarvarsre)' $(quarvarsre) \ | |||
-e '$(notsetquarvarsre)' \ | -e '$(notsetquarvarsre)' \ | |||
-e 's|@SHELLNAME@|$@|g' \ | -e 's|@SHELLNAME@|$@|g' \ | |||
-e 's|@VERSIONING@|$(setversioning)|g' \ | -e 's|@VERSIONING@|$(setversioning)|g' \ | |||
-e 's|@VERSION@|$(VERSION)|g' \ | -e 's|@VERSION@|$(VERSION)|g' \ | |||
-e 's|@SED_ERE@|$(SED_ERE)|g' \ | -e 's|@SED_ERE@|$(SED_ERE)|g' \ | |||
-e 's|@PS@|$(PS)|g' \ | -e 's|@PS@|$(PS)|g' \ | |||
-e 's|@BASENAME@|$(BASENAME)|g' \ | -e 's|@BASENAME@|$(BASENAME)|g' \ | |||
skipping to change at line 243 | skipping to change at line 209 | |||
profile.sh: profile.sh.in | profile.sh: profile.sh.in | |||
$(translate-in-script) | $(translate-in-script) | |||
$(EXAMPLE_MODFILES_SRCDIR)/modules: $(EXAMPLE_MODFILES_SRCDIR)/modules.in | $(EXAMPLE_MODFILES_SRCDIR)/modules: $(EXAMPLE_MODFILES_SRCDIR)/modules.in | |||
$(translate-in-script) | $(translate-in-script) | |||
$(EXAMPLE_MODFILES_SRCDIR)/version: $(EXAMPLE_MODFILES_SRCDIR)/version.in | $(EXAMPLE_MODFILES_SRCDIR)/version: $(EXAMPLE_MODFILES_SRCDIR)/version.in | |||
$(translate-in-script) | $(translate-in-script) | |||
dist-win: | dist-win: | |||
mkdir $(DIST_WIN_PREFIX)/init | $(INSTALL_DIR) '$(DIST_WIN_PREFIX)/init' | |||
cp cmd.cmd $(DIST_WIN_PREFIX)/init/ | $(INSTALL_DATA) cmd.cmd '$(DIST_WIN_PREFIX)/init/' | |||
mkdir $(DIST_WIN_PREFIX)/modulefiles | $(INSTALL_DIR) '$(DIST_WIN_PREFIX)/modulefiles' | |||
cp $(addprefix $(EXAMPLE_MODFILES_SRCDIR)/,$(EXAMPLE_WIN_MODFILES)) $(DIS | $(INSTALL_DATA) $(addprefix $(EXAMPLE_MODFILES_SRCDIR)/,$(EXAMPLE_WIN_MOD | |||
T_WIN_PREFIX)/modulefiles/ | FILES)) '$(DIST_WIN_PREFIX)/modulefiles/' | |||
# example configs for test rules | # example configs for test rules | |||
install-testconfig: | install-testconfig: | |||
mkdir -p $(DESTDIR)$(initdir) | $(INSTALL_DIR) '$(DESTDIR)$(initdir)' | |||
mkdir -p $(DESTDIR)$(etcdir) | $(INSTALL_DIR) '$(DESTDIR)$(etcdir)' | |||
mkdir -p $(DESTDIR)$(prefix)/etc | $(INSTALL_DIR) '$(DESTDIR)$(prefix)/etc' | |||
mkdir -p $(DESTDIR)$(modulefilesdir) | $(INSTALL_DIR) '$(DESTDIR)$(modulefilesdir)' | |||
mkdir -p $(DESTDIR)$(prefix)/test/modulefiles $(DESTDIR)$(prefix)/test/et | $(INSTALL_DIR) '$(DESTDIR)$(prefix)/test/modulefiles' '$(DESTDIR)$(prefix | |||
c | )/test/etc' | |||
cp $(addprefix $(EXAMPLE_MODFILES_SRCDIR)/,$(EXAMPLE_TESTCONFIG_MODFILES) | $(INSTALL_DATA) $(addprefix $(EXAMPLE_MODFILES_SRCDIR)/,$(EXAMPLE_TESTCON | |||
) $(DESTDIR)$(modulefilesdir)/ | FIG_MODFILES)) '$(DESTDIR)$(modulefilesdir)/' | |||
uninstall-testconfig: | uninstall-testconfig: | |||
rmdir $(DESTDIR)$(prefix)/test/modulefiles $(DESTDIR)$(prefix)/test/etc $ | rmdir '$(DESTDIR)$(prefix)/test/modulefiles' '$(DESTDIR)$(prefix)/test/et | |||
(DESTDIR)$(prefix)/test | c' '$(DESTDIR)$(prefix)/test' | |||
rm -f $(addprefix $(DESTDIR)$(modulefilesdir)/,$(EXAMPLE_TESTCONFIG_MODFI | rm -f $(foreach modfile,$(EXAMPLE_TESTCONFIG_MODFILES),'$(DESTDIR)$(modul | |||
LES)) | efilesdir)/$(modfile)') | |||
$(RMDIR_IGN_NON_EMPTY) $(DESTDIR)$(modulefilesdir) || true | $(RMDIR_IGN_NON_EMPTY) '$(DESTDIR)$(modulefilesdir)' || true | |||
$(RMDIR_IGN_NON_EMPTY) $(DESTDIR)$(etcdir) || true | $(RMDIR_IGN_NON_EMPTY) '$(DESTDIR)$(etcdir)' || true | |||
$(RMDIR_IGN_NON_EMPTY) $(DESTDIR)$(initdir) || true | $(RMDIR_IGN_NON_EMPTY) '$(DESTDIR)$(initdir)' || true | |||
install: all | install: all | |||
mkdir -p $(DESTDIR)$(initdir) | $(INSTALL_DIR) '$(DESTDIR)$(initdir)' | |||
mkdir -p $(DESTDIR)$(initdir)/ksh-functions | $(INSTALL_DIR) '$(DESTDIR)$(initdir)/ksh-functions' | |||
ifeq ($(initconfin),etcdir) | ||||
$(INSTALL_DIR) '$(DESTDIR)$(etcdir)' | ||||
endif | ||||
ifeq ($(makebashcompdir),y) | ifeq ($(makebashcompdir),y) | |||
mkdir -p $(DESTDIR)$(bashcompletiondir) | $(INSTALL_DIR) '$(DESTDIR)$(bashcompletiondir)' | |||
endif | endif | |||
ifeq ($(makefishcompdir),y) | ifeq ($(makefishcompdir),y) | |||
mkdir -p $(DESTDIR)$(fishcompletiondir) | $(INSTALL_DIR) '$(DESTDIR)$(fishcompletiondir)' | |||
endif | endif | |||
mkdir -p $(DESTDIR)$(zshcompletiondir) | $(INSTALL_DIR) '$(DESTDIR)$(zshcompletiondir)' | |||
mkdir -p $(DESTDIR)$(modulefilesdir) | $(INSTALL_DIR) '$(DESTDIR)$(modulefilesdir)' | |||
cp $(ALL_SHELLS) $(DESTDIR)$(initdir)/ | $(INSTALL_DATA) $(ALL_SHELLS) '$(DESTDIR)$(initdir)/' | |||
ifeq ($(windowssupport),y) | ifeq ($(windowssupport),y) | |||
cp cmd.cmd $(DESTDIR)$(initdir)/ | $(INSTALL_DATA) cmd.cmd '$(DESTDIR)$(initdir)/' | |||
endif | endif | |||
ifeq ($(makefishcompdir),y) | ifeq ($(makefishcompdir),y) | |||
cp fish_completion $(DESTDIR)$(fishcompletiondir)/module.fish | $(INSTALL_DATA) fish_completion '$(DESTDIR)$(fishcompletiondir)/module.fi sh' | |||
else | else | |||
cp fish_completion $(DESTDIR)$(fishcompletiondir)/ | $(INSTALL_DATA) fish_completion '$(DESTDIR)$(fishcompletiondir)/' | |||
endif | endif | |||
ifeq ($(makebashcompdir),y) | ifeq ($(makebashcompdir),y) | |||
cp bash_completion $(DESTDIR)$(bashcompletiondir)/module | $(INSTALL_DATA) bash_completion '$(DESTDIR)$(bashcompletiondir)/module' | |||
ln -s module $(DESTDIR)$(bashcompletiondir)/ml | ln -s module '$(DESTDIR)$(bashcompletiondir)/ml' | |||
else | else | |||
cp bash_completion $(DESTDIR)$(bashcompletiondir)/ | $(INSTALL_DATA) bash_completion '$(DESTDIR)$(bashcompletiondir)/' | |||
endif | endif | |||
cp zsh-functions/_module $(DESTDIR)$(zshcompletiondir)/ | $(INSTALL_DATA) zsh-functions/_module '$(DESTDIR)$(zshcompletiondir)/' | |||
cp ksh $(DESTDIR)$(initdir)/ksh-functions/module | $(INSTALL_DATA) ksh '$(DESTDIR)$(initdir)/ksh-functions/module' | |||
cp ksh $(DESTDIR)$(initdir)/ksh-functions/ml | $(INSTALL_DATA) ksh '$(DESTDIR)$(initdir)/ksh-functions/ml' | |||
rm -f $(DESTDIR)$(modulespath) $(DESTDIR)$(initrc) | $(INSTALL_DATA) initrc '$(DESTDIR)$(initrc)' | |||
cp -R -P initrc $(DESTDIR)$(initrc) | ||||
ifeq ($(setmodulespath),y) | ifeq ($(setmodulespath),y) | |||
cp -R -P modulespath $(DESTDIR)$(modulespath) | $(INSTALL_DATA) modulespath $(DESTDIR)$(modulespath) | |||
endif | endif | |||
ifeq ($(examplemodulefiles),y) | ifeq ($(examplemodulefiles),y) | |||
cp $(addprefix $(EXAMPLE_MODFILES_SRCDIR)/,$(EXAMPLE_MODFILES)) $(DESTDIR )$(modulefilesdir)/ | $(INSTALL_DATA) $(addprefix $(EXAMPLE_MODFILES_SRCDIR)/,$(EXAMPLE_MODFILE S)) '$(DESTDIR)$(modulefilesdir)/' | |||
endif | endif | |||
ifeq ($(versioning),y) | ifeq ($(versioning),y) | |||
mkdir -p $(DESTDIR)$(versdir) | $(INSTALL_DIR) '$(DESTDIR)$(versdir)' | |||
cp $(EXAMPLE_MODFILES_SRCDIR)/version $(DESTDIR)$(versdir)/$(VERSION) | $(INSTALL_DATA) $(EXAMPLE_MODFILES_SRCDIR)/version '$(DESTDIR)$(versdir)/ | |||
$(VERSION)' | ||||
endif | endif | |||
uninstall: | uninstall: | |||
rm -f $(addprefix $(DESTDIR)$(initdir)/,$(ALL_SHELLS)) | rm -f $(foreach initscript,$(ALL_SHELLS),'$(DESTDIR)$(initdir)/$(initscri pt)') | |||
ifeq ($(windowssupport),y) | ifeq ($(windowssupport),y) | |||
rm -f $(DESTDIR)$(initdir)/cmd.cmd | rm -f '$(DESTDIR)$(initdir)/cmd.cmd' | |||
endif | endif | |||
rm -f $(DESTDIR)$(initdir)/ksh-functions/module | rm -f '$(DESTDIR)$(initdir)/ksh-functions/module' | |||
rm -f $(DESTDIR)$(initdir)/ksh-functions/ml | rm -f '$(DESTDIR)$(initdir)/ksh-functions/ml' | |||
ifeq ($(makebashcompdir),y) | ifeq ($(makebashcompdir),y) | |||
rm -f $(DESTDIR)$(bashcompletiondir)/ml | rm -f '$(DESTDIR)$(bashcompletiondir)/ml' | |||
rm -f $(DESTDIR)$(bashcompletiondir)/module | rm -f '$(DESTDIR)$(bashcompletiondir)/module' | |||
else | else | |||
rm -f $(DESTDIR)$(bashcompletiondir)/bash_completion | rm -f '$(DESTDIR)$(bashcompletiondir)/bash_completion' | |||
endif | endif | |||
ifeq ($(makefishcompdir),y) | ifeq ($(makefishcompdir),y) | |||
rm -f $(DESTDIR)$(fishcompletiondir)/module.fish | rm -f '$(DESTDIR)$(fishcompletiondir)/module.fish' | |||
else | else | |||
rm -f $(DESTDIR)$(fishcompletiondir)/fish_completion | rm -f '$(DESTDIR)$(fishcompletiondir)/fish_completion' | |||
endif | endif | |||
rm -f $(DESTDIR)$(zshcompletiondir)/_module | rm -f '$(DESTDIR)$(zshcompletiondir)/_module' | |||
rm -f $(DESTDIR)$(modulespath) $(DESTDIR)$(initrc) | rm -f '$(DESTDIR)$(modulespath)' '$(DESTDIR)$(initrc)' | |||
$(RMDIR_IGN_NON_EMPTY) $(DESTDIR)$(modulefilesdir) || true | $(RMDIR_IGN_NON_EMPTY) '$(DESTDIR)$(modulefilesdir)' || true | |||
@if [ -d $(DESTDIR)$(modulefilesdir) ]; then echo; echo "WARNING: $(DESTD | @if [ -d '$(DESTDIR)$(modulefilesdir)' ]; then echo; echo "WARNING: '$(DE | |||
IR)$(modulefilesdir) is not empty so skip removal" >&2; echo; fi | STDIR)$(modulefilesdir)' is not empty so skip removal" >&2; echo; fi | |||
rmdir $(DESTDIR)$(initdir)/ksh-functions | rmdir '$(DESTDIR)$(initdir)/ksh-functions' | |||
ifeq ($(makebashcompdir),y) | ifeq ($(makebashcompdir),y) | |||
$(RMDIR_IGN_NON_EMPTY) $(DESTDIR)$(bashcompletiondir) || true | $(RMDIR_IGN_NON_EMPTY) '$(DESTDIR)$(bashcompletiondir)' || true | |||
endif | endif | |||
ifeq ($(makefishcompdir),y) | ifeq ($(makefishcompdir),y) | |||
$(RMDIR_IGN_NON_EMPTY) $(DESTDIR)$(fishcompletiondir) || true | $(RMDIR_IGN_NON_EMPTY) '$(DESTDIR)$(fishcompletiondir)' || true | |||
endif | endif | |||
$(RMDIR_IGN_NON_EMPTY) $(DESTDIR)$(zshcompletiondir) || true | $(RMDIR_IGN_NON_EMPTY) '$(DESTDIR)$(zshcompletiondir)' || true | |||
$(RMDIR_IGN_NON_EMPTY) $(DESTDIR)$(initdir) || true | $(RMDIR_IGN_NON_EMPTY) '$(DESTDIR)$(initdir)' || true | |||
@if [ -d $(DESTDIR)$(initdir) ]; then echo; echo "WARNING: $(DESTDIR)$(in | @if [ -d '$(DESTDIR)$(initdir)' ]; then echo; echo "WARNING: '$(DESTDIR)$ | |||
itdir) is not empty so skip removal" >&2; echo; fi | (initdir)' is not empty so skip removal" >&2; echo; fi | |||
ifeq ($(versioning),y) | ifeq ($(versioning),y) | |||
rm -f $(DESTDIR)$(versdir)/$(VERSION) | rm -f '$(DESTDIR)$(versdir)/$(VERSION)' | |||
$(RMDIR_IGN_NON_EMPTY) $(DESTDIR)$(versdir) || true | $(RMDIR_IGN_NON_EMPTY) '$(DESTDIR)$(versdir)' || true | |||
@if [ -d $(DESTDIR)$(versdir) ]; then echo; echo "WARNING: $(DESTDIR)$(ve | @if [ -d '$(DESTDIR)$(versdir)' ]; then echo; echo "WARNING: '$(DESTDIR)$ | |||
rsdir) is not empty so skip removal" >&2; echo; fi | (versdir)' is not empty so skip removal" >&2; echo; fi | |||
endif | endif | |||
clean: | clean: | |||
rm -f $(ALL_SHELLS) initrc bash_completion zsh-functions/_module modulesp ath $(EXAMPLE_MODFILES_SRCDIR)/modules | rm -f $(ALL_SHELLS) initrc bash_completion zsh-functions/_module modulesp ath $(EXAMPLE_MODFILES_SRCDIR)/modules | |||
ifeq ($(versioning),y) | ifeq ($(versioning),y) | |||
rm -f $(EXAMPLE_MODFILES_SRCDIR)/version | rm -f $(EXAMPLE_MODFILES_SRCDIR)/version | |||
endif | endif | |||
# quiet all commands unless verbose mode set | # quiet all commands unless verbose mode set | |||
ifeq ($(VERBOSE),1) | ifeq ($(VERBOSE),1) | |||
End of changes. 45 change blocks. | ||||
121 lines changed or deleted | 90 lines changed or added |