| 1 |
.PHONY: doc pkgdoc initdir install install-testsiteconfig \ |
| 2 |
install-testsiteconfig-1 install-testmodulerc install-testinitrc-1 \ |
| 3 |
install-testinitrc install-testetcrc install-testmodspath \ |
| 4 |
install-testmodspath-empty install-testmodspath-wild \ |
| 5 |
install-testmoguicmd uninstall-testconfig uninstall dist dist-tar \ |
| 6 |
dist-gzip dist-bzip2 dist-win srpm rpm clean distclean test-deps test \ |
| 7 |
testinstall testlint testcompletion testcookbook |
| 8 |
|
| 9 |
# commands to install files |
| 10 |
INSTALL = install |
| 11 |
INSTALL_DIR = $(INSTALL) -d -m 755 |
| 12 |
INSTALL_DATA = $(INSTALL) -m 644 |
| 13 |
INSTALL_PROGRAM = $(INSTALL) -m 755 |
| 14 |
|
| 15 |
# download command and its options |
| 16 |
CURL := curl --location --remote-name --retry 3 --retry-connrefused \ |
| 17 |
--retry-delay 20 --max-time 20 |
| 18 |
|
| 19 |
# definitions for code coverage |
| 20 |
NAGELFAR_DLSRC1 := http://downloads.sourceforge.net/nagelfar/ |
| 21 |
NAGELFAR_RELEASE := nagelfar135 |
| 22 |
NAGELFAR_DIST := $(NAGELFAR_RELEASE).tar.gz |
| 23 |
NAGELFAR_DISTSUM := 0305ae1617a365626f45fc08909c6f58 |
| 24 |
NAGELFAR := $(NAGELFAR_RELEASE)/nagelfar.tcl |
| 25 |
|
| 26 |
# definition for old Tcl interpreter for coverage testing |
| 27 |
TCL_DLSRC := http://downloads.sourceforge.net/tcl/ |
| 28 |
TCL_RELEASE83 := tcl8.3.5 |
| 29 |
TCL_DIST83 := $(TCL_RELEASE83)-src.tar.gz |
| 30 |
TCL_DISTSUM83 := 5cb79f8b90cf1322cb1286b9fe67f7a2 |
| 31 |
TCLSH83 := $(TCL_RELEASE83)/unix/tclsh |
| 32 |
|
| 33 |
# third-party definitions for source-sh testing |
| 34 |
SPACK_REPOURL := https://github.com/spack/spack.git |
| 35 |
MINICONDA_DLSRC := https://repo.anaconda.com/miniconda/ |
| 36 |
MINICONDA_DIST := Miniconda3-py38_4.11.0-Linux-x86_64.sh |
| 37 |
MINICONDA_DISTSUM := 252d3b0c863333639f99fbc465ee1d61 |
| 38 |
OPENFOAM_REPOURL := https://github.com/OpenFOAM/OpenFOAM-dev.git |
| 39 |
|
| 40 |
# specific modulecmd script for test |
| 41 |
MODULECMDTEST := modulecmd-test.tcl |
| 42 |
# if coverage enabled, run tests on instrumented file to create coverage log |
| 43 |
ifeq ($(COVERAGE),y) |
| 44 |
MODULECMD := $(MODULECMDTEST)_i |
| 45 |
else |
| 46 |
MODULECMD := $(MODULECMDTEST) |
| 47 |
endif |
| 48 |
|
| 49 |
# definitions for enhanced diff tool (to review test results) |
| 50 |
ICDIFF_DLSRC := https://raw.githubusercontent.com/jeffkaufman/icdiff/release-2.0.10/ |
| 51 |
ICDIFF_CHECKSUM := 1a9b7b2e8589f1e2ade4ead1750b5339 |
| 52 |
|
| 53 |
# source definitions shared across the Makefiles of this project |
| 54 |
ifneq ($(wildcard Makefile.inc),Makefile.inc) |
| 55 |
$(error Makefile.inc is missing, please run './configure') |
| 56 |
endif |
| 57 |
include Makefile.inc |
| 58 |
|
| 59 |
ifeq ($(compressedchangelog),y) |
| 60 |
CHANGELOG := ChangeLog.gz |
| 61 |
else |
| 62 |
CHANGELOG := ChangeLog |
| 63 |
endif |
| 64 |
|
| 65 |
INSTALL_PREREQ := modulecmd.tcl $(CHANGELOG) README script/add.modules \ |
| 66 |
script/modulecmd |
| 67 |
TEST_PREREQ := $(MODULECMD) |
| 68 |
ifeq ($(COVERAGE),y) |
| 69 |
TEST_PREREQ += $(NAGELFAR) |
| 70 |
endif |
| 71 |
|
| 72 |
ifeq ($(libtclenvmodules),y) |
| 73 |
INSTALL_PREREQ += lib/libtclenvmodules$(SHLIB_SUFFIX) |
| 74 |
TEST_PREREQ += lib/libtclenvmodules$(SHLIB_SUFFIX) |
| 75 |
ifeq ($(COVERAGE),y) |
| 76 |
TEST_PREREQ += lib/libtestutil-closedir$(SHLIB_SUFFIX) \ |
| 77 |
lib/libtestutil-getpwuid$(SHLIB_SUFFIX) \ |
| 78 |
lib/libtestutil-getgroups$(SHLIB_SUFFIX) \ |
| 79 |
lib/libtestutil-0getgroups$(SHLIB_SUFFIX) \ |
| 80 |
lib/libtestutil-dupgetgroups$(SHLIB_SUFFIX) \ |
| 81 |
lib/libtestutil-time$(SHLIB_SUFFIX) \ |
| 82 |
lib/libtestutil-mktime$(SHLIB_SUFFIX) \ |
| 83 |
lib/libtestutil-tcl_loadfile$(SHLIB_SUFFIX) |
| 84 |
endif |
| 85 |
endif |
| 86 |
|
| 87 |
# install old Tcl interpreters to test coverage |
| 88 |
ifeq ($(COVERAGE_OLDTCL),y) |
| 89 |
TEST_PREREQ += tclsh83 |
| 90 |
endif |
| 91 |
|
| 92 |
# install extra software to test source-sh against their scripts |
| 93 |
ifeq ($(EXTRATEST_SOURCESH),y) |
| 94 |
TEST_PREREQ += spack miniconda3 OpenFOAM-dev |
| 95 |
endif |
| 96 |
|
| 97 |
# define rule prereq when target need to be rebuilt when git repository change |
| 98 |
ifeq ($(wildcard .git),.git) |
| 99 |
GIT_REFRESH_PREREQ := .git/objects |
| 100 |
|
| 101 |
# determine if version.inc needs to get updated as git repository has changed |
| 102 |
ifeq ($(wildcard version.inc), version.inc) |
| 103 |
MTIME_VERSION := $(shell date -r version.inc +%s) |
| 104 |
MTIME_GIT_REPO := $(shell date -r $(GIT_REFRESH_PREREQ) +%s) |
| 105 |
REFRESH_VERSION_INC := $(shell if [ $(MTIME_GIT_REPO) -gt $(MTIME_VERSION) ]; \ |
| 106 |
then echo y; else echo n; fi) |
| 107 |
else |
| 108 |
REFRESH_VERSION_INC := y |
| 109 |
endif |
| 110 |
|
| 111 |
else |
| 112 |
GIT_REFRESH_PREREQ := |
| 113 |
REFRESH_VERSION_INC := n |
| 114 |
endif |
| 115 |
|
| 116 |
# setup summary echo rules unless silent mode set |
| 117 |
ifneq ($(findstring s,$(MAKEFLAGS)),s) |
| 118 |
ECHO_GEN = @echo ' ' GEN $@; |
| 119 |
ECHO_GEN2 = @echo ' ' GEN |
| 120 |
else |
| 121 |
# disable echo rules followed by a string |
| 122 |
ECHO_GEN2 = \# |
| 123 |
endif |
| 124 |
|
| 125 |
all: initdir $(INSTALL_PREREQ) |
| 126 |
|
| 127 |
# skip doc build if no sphinx-build |
| 128 |
ifneq ($(builddoc),n) |
| 129 |
all: pkgdoc |
| 130 |
endif |
| 131 |
|
| 132 |
initdir: |
| 133 |
$(MAKE) --no-print-directory -C init all |
| 134 |
|
| 135 |
pkgdoc: version.inc |
| 136 |
$(MAKE) --no-print-directory -C doc man txt |
| 137 |
|
| 138 |
doc: version.inc |
| 139 |
$(MAKE) --no-print-directory -C doc all |
| 140 |
|
| 141 |
# source version definitions if built and no need to get refreshed |
| 142 |
# skip calls to git command if this file is available |
| 143 |
ifeq ($(wildcard version.inc) $(REFRESH_VERSION_INC), version.inc n) |
| 144 |
-include version.inc |
| 145 |
else |
| 146 |
# build version.inc shared definitions from git repository info |
| 147 |
ifeq ($(wildcard .git) $(wildcard version.inc.in),.git version.inc.in) |
| 148 |
GIT_CURRENT_TAG := $(shell git describe --tags --abbrev=0 2>/dev/null) |
| 149 |
GIT_CURRENT_DESC := $(shell git describe --tags 2>/dev/null) |
| 150 |
GIT_CURRENT_BRANCH := $(notdir $(shell git rev-parse --abbrev-ref HEAD)) |
| 151 |
|
| 152 |
MODULES_RELEASE := $(subst v,,$(GIT_CURRENT_TAG)) |
| 153 |
ifeq ($(MODULES_RELEASE),) |
| 154 |
# load raw version information to get MODULES_RELEASE as git repository does |
| 155 |
# not contain enough info (checked out repository depth too short) |
| 156 |
include version.inc.in |
| 157 |
GIT_CURRENT_COMMIT := $(shell git rev-parse --short=8 HEAD) |
| 158 |
ifeq ($(GIT_CURRENT_BRANCH),main) |
| 159 |
MODULES_BUILD := +XX-g$(GIT_CURRENT_COMMIT) |
| 160 |
else |
| 161 |
MODULES_BUILD := +$(GIT_CURRENT_BRANCH)-XX-g$(GIT_CURRENT_COMMIT) |
| 162 |
endif |
| 163 |
else ifeq ($(GIT_CURRENT_TAG),$(GIT_CURRENT_DESC)) |
| 164 |
MODULES_BUILD := |
| 165 |
else ifeq ($(GIT_CURRENT_BRANCH),main) |
| 166 |
MODULES_BUILD := +$(subst $(GIT_CURRENT_TAG)-,,$(GIT_CURRENT_DESC)) |
| 167 |
else |
| 168 |
MODULES_BUILD := +$(GIT_CURRENT_BRANCH)$(subst $(GIT_CURRENT_TAG),,$(GIT_CURRENT_DESC)) |
| 169 |
endif |
| 170 |
MODULES_BUILD_DATE := $(shell git log -1 --format=%cd --date=short) |
| 171 |
|
| 172 |
else |
| 173 |
# load raw version information |
| 174 |
include version.inc.in |
| 175 |
|
| 176 |
# build short date from full date found in raw data |
| 177 |
ifeq ($(MODULES_BUILD_FDATE),$$Format:%ci$$) |
| 178 |
MODULES_BUILD_DATE := $(shell date '+%Y-%m-%d') |
| 179 |
else |
| 180 |
MODULES_BUILD_DATE := $(firstword $(MODULES_BUILD_FDATE)) |
| 181 |
endif |
| 182 |
|
| 183 |
# set a recognizable build number if one found in version.inc.in is raw data |
| 184 |
ifeq ($(MODULES_BUILD_HASH),$$Format:%h$$) |
| 185 |
MODULES_BUILD := +XX-gffffffff |
| 186 |
# or compute it from these information as if working from git repository |
| 187 |
else |
| 188 |
comma := , |
| 189 |
MODULES_BUILD_REFS := $(subst $(comma),,$(MODULES_BUILD_REFS)) |
| 190 |
|
| 191 |
ifeq ($(filter v$(MODULES_RELEASE),$(MODULES_BUILD_REFS)),v$(MODULES_RELEASE)) |
| 192 |
MODULES_BUILD := |
| 193 |
else ifeq ($(filter main,$(MODULES_BUILD_REFS)),main) |
| 194 |
MODULES_BUILD := +XX-g$(MODULES_BUILD_HASH) |
| 195 |
else ifeq ($(MODULES_BUILD_REFS),%D) |
| 196 |
MODULES_BUILD := +XX-g$(MODULES_BUILD_HASH) |
| 197 |
else |
| 198 |
MODULES_BUILD := +$(notdir $(lastword $(MODULES_BUILD_REFS)))-XX-g$(MODULES_BUILD_HASH) |
| 199 |
endif |
| 200 |
endif |
| 201 |
endif |
| 202 |
# no need to include generated version.inc file as the MODULES_* variables |
| 203 |
# have just been computed |
| 204 |
endif |
| 205 |
|
| 206 |
# determine RPM release |
| 207 |
# use last release if we currently sat on tag, append build number to it elsewhere |
| 208 |
MODULES_LAST_RPM_VERSREL := $(shell sed -n '/^%changelog/ {n;s/^\*.* - //p;q;}' \ |
| 209 |
share/rpm/environment-modules.spec.in) |
| 210 |
MODULES_LAST_RPM_RELEASE := $(lastword $(subst -, ,$(MODULES_LAST_RPM_VERSREL))) |
| 211 |
MODULES_RPM_RELEASE := $(MODULES_LAST_RPM_RELEASE)$(subst +,.,$(subst -,.,$(MODULES_BUILD))) |
| 212 |
|
| 213 |
# define init configs location |
| 214 |
ifeq ($(initconfin),etcdir) |
| 215 |
modulespath := $(etcdir)/modulespath |
| 216 |
initrc := $(etcdir)/initrc |
| 217 |
else |
| 218 |
modulespath := $(initdir)/.modulespath |
| 219 |
initrc := $(initdir)/modulerc |
| 220 |
endif |
| 221 |
|
| 222 |
# comment entries if feature not enabled |
| 223 |
ifeq ($(versioning),y) |
| 224 |
setversioning := |
| 225 |
setnotversioning := \# |
| 226 |
else |
| 227 |
setversioning := \# |
| 228 |
setnotversioning := |
| 229 |
endif |
| 230 |
ifeq ($(setbinpath),y) |
| 231 |
setsetbinpath := |
| 232 |
else |
| 233 |
setsetbinpath := \# |
| 234 |
endif |
| 235 |
ifeq ($(appendbinpath),y) |
| 236 |
setappendbinpath := append |
| 237 |
else |
| 238 |
setappendbinpath := prepend |
| 239 |
endif |
| 240 |
ifeq ($(setpythonpath),y) |
| 241 |
setsetpythonpath := |
| 242 |
else |
| 243 |
setsetpythonpath := \# |
| 244 |
endif |
| 245 |
ifeq ($(appendpythonpath),y) |
| 246 |
setappendpythonpath := append |
| 247 |
else |
| 248 |
setappendpythonpath := prepend |
| 249 |
endif |
| 250 |
# env_modules python module is installed in initdir if no specific location |
| 251 |
ifeq ($(pythondir),) |
| 252 |
pythondir := $(initdir) |
| 253 |
endif |
| 254 |
ifeq ($(setmanpath),y) |
| 255 |
setsetmanpath := |
| 256 |
else |
| 257 |
setsetmanpath := \# |
| 258 |
endif |
| 259 |
ifeq ($(appendmanpath),y) |
| 260 |
setappendmanpath := append |
| 261 |
else |
| 262 |
setappendmanpath := prepend |
| 263 |
endif |
| 264 |
ifeq ($(usemanpath),y) |
| 265 |
setusemanpath := |
| 266 |
setnotusemanpath := \# |
| 267 |
else |
| 268 |
setusemanpath := \# |
| 269 |
setnotusemanpath := |
| 270 |
endif |
| 271 |
|
| 272 |
# build list of shell whose completion script has to be sourced during |
| 273 |
# autoinit initialization |
| 274 |
shellcompsource := tcsh |
| 275 |
ifeq ($(bashcompletiondir),) |
| 276 |
shellcompsource += bash |
| 277 |
endif |
| 278 |
ifeq ($(fishcompletiondir),) |
| 279 |
shellcompsource += fish |
| 280 |
endif |
| 281 |
|
| 282 |
ifeq ($(silentshdbgsupport),y) |
| 283 |
setsilentshdbgsupport := 1 |
| 284 |
else |
| 285 |
setsilentshdbgsupport := 0 |
| 286 |
endif |
| 287 |
|
| 288 |
ifeq ($(quarantinesupport),y) |
| 289 |
setquarantinesupport := 1 |
| 290 |
else |
| 291 |
setquarantinesupport := 0 |
| 292 |
endif |
| 293 |
|
| 294 |
ifeq ($(libtclenvmodules),y) |
| 295 |
setlibtclenvmodules := |
| 296 |
else |
| 297 |
setlibtclenvmodules := \# |
| 298 |
endif |
| 299 |
|
| 300 |
ifeq ($(multilibsupport),y) |
| 301 |
setmultilibsupport := |
| 302 |
setnotmultilibsupport := \# |
| 303 |
sedexprlibdir := -e 's|@libdir64@|$(libdir64)|g' -e 's|@libdir32@|$(libdir32)|g' |
| 304 |
else |
| 305 |
setmultilibsupport := \# |
| 306 |
setnotmultilibsupport := |
| 307 |
sedexprlibdir := -e 's|@libdir@|$(libdir)|g' |
| 308 |
endif |
| 309 |
|
| 310 |
ifneq ($(pageropts),) |
| 311 |
pagercmd := $(pager) $(pageropts) |
| 312 |
else |
| 313 |
pagercmd := $(pager) |
| 314 |
endif |
| 315 |
|
| 316 |
ifneq ($(loggeropts),) |
| 317 |
loggercmd := $(logger) $(loggeropts) |
| 318 |
else |
| 319 |
loggercmd := $(logger) |
| 320 |
endif |
| 321 |
|
| 322 |
ifneq ($(domainnameopts),) |
| 323 |
domainnamecmd := $(domainname) $(domainnameopts) |
| 324 |
else |
| 325 |
domainnamecmd := $(domainname) |
| 326 |
endif |
| 327 |
|
| 328 |
ifeq ($(color),y) |
| 329 |
setcolor := auto |
| 330 |
else |
| 331 |
setcolor := never |
| 332 |
endif |
| 333 |
|
| 334 |
ifeq ($(autohandling),y) |
| 335 |
setautohandling := 1 |
| 336 |
else |
| 337 |
setautohandling := 0 |
| 338 |
endif |
| 339 |
|
| 340 |
ifeq ($(conflictunload),y) |
| 341 |
setconflictunload := 1 |
| 342 |
else |
| 343 |
setconflictunload := 0 |
| 344 |
endif |
| 345 |
|
| 346 |
ifeq ($(requirevia),y) |
| 347 |
setrequirevia := 1 |
| 348 |
else |
| 349 |
setrequirevia := 0 |
| 350 |
endif |
| 351 |
|
| 352 |
ifeq ($(implicitrequirement),y) |
| 353 |
setimplicitrequirement := 1 |
| 354 |
else |
| 355 |
setimplicitrequirement := 0 |
| 356 |
endif |
| 357 |
|
| 358 |
ifeq ($(availindepth),y) |
| 359 |
setavailindepth := 1 |
| 360 |
else |
| 361 |
setavailindepth := 0 |
| 362 |
endif |
| 363 |
|
| 364 |
ifeq ($(spiderindepth),y) |
| 365 |
setspiderindepth := 1 |
| 366 |
else |
| 367 |
setspiderindepth := 0 |
| 368 |
endif |
| 369 |
|
| 370 |
ifeq ($(implicitdefault),y) |
| 371 |
setimplicitdefault := 1 |
| 372 |
else |
| 373 |
setimplicitdefault := 0 |
| 374 |
endif |
| 375 |
|
| 376 |
ifeq ($(extendeddefault),y) |
| 377 |
setextendeddefault := 1 |
| 378 |
else |
| 379 |
setextendeddefault := 0 |
| 380 |
endif |
| 381 |
|
| 382 |
ifeq ($(advversspec),y) |
| 383 |
setadvversspec := 1 |
| 384 |
else |
| 385 |
setadvversspec := 0 |
| 386 |
endif |
| 387 |
|
| 388 |
ifeq ($(uniquenameloaded),y) |
| 389 |
setuniquenameloaded := 1 |
| 390 |
else |
| 391 |
setuniquenameloaded := 0 |
| 392 |
endif |
| 393 |
|
| 394 |
ifeq ($(sourcecache),y) |
| 395 |
setsourcecache := 1 |
| 396 |
else |
| 397 |
setsourcecache := 0 |
| 398 |
endif |
| 399 |
|
| 400 |
ifeq ($(ml),y) |
| 401 |
setml := 1 |
| 402 |
else |
| 403 |
setml := 0 |
| 404 |
endif |
| 405 |
|
| 406 |
ifeq ($(setshellstartup),y) |
| 407 |
setsetshellstartup := 1 |
| 408 |
else |
| 409 |
setsetshellstartup := 0 |
| 410 |
endif |
| 411 |
|
| 412 |
ifeq ($(mcookieversioncheck),y) |
| 413 |
setmcookieversioncheck := 1 |
| 414 |
else |
| 415 |
setmcookieversioncheck := 0 |
| 416 |
endif |
| 417 |
|
| 418 |
ifeq ($(wa277),y) |
| 419 |
setwa277 := 1 |
| 420 |
else |
| 421 |
setwa277 := 0 |
| 422 |
endif |
| 423 |
|
| 424 |
ifeq ($(paginate),y) |
| 425 |
setpaginate := 1 |
| 426 |
else |
| 427 |
setpaginate := 0 |
| 428 |
endif |
| 429 |
|
| 430 |
ifeq ($(pathentryreorder),y) |
| 431 |
setpathentryreorder := 1 |
| 432 |
else |
| 433 |
setpathentryreorder := 0 |
| 434 |
endif |
| 435 |
|
| 436 |
ifneq ($(tcllinteropts),) |
| 437 |
tcllintercmd := $(tcllinter) $(tcllinteropts) |
| 438 |
else |
| 439 |
tcllintercmd := $(tcllinter) |
| 440 |
endif |
| 441 |
|
| 442 |
ifeq ($(nagelfaraddons),y) |
| 443 |
setnagelfaraddons := |
| 444 |
else |
| 445 |
setnagelfaraddons := \# |
| 446 |
endif |
| 447 |
|
| 448 |
define translate-in-script |
| 449 |
$(ECHO_GEN) |
| 450 |
sed -e 's|@prefix@|$(prefix)|g' \ |
| 451 |
-e 's|@baseprefix@|$(baseprefix)|g' \ |
| 452 |
$(sedexprlibdir) \ |
| 453 |
-e 's|@libexecdir@|$(libexecdir)|g' \ |
| 454 |
-e 's|@initdir@|$(initdir)|g' \ |
| 455 |
-e 's|@etcdir@|$(etcdir)|g' \ |
| 456 |
-e 's|@modulefilesdir@|$(modulefilesdir)|g' \ |
| 457 |
-e 's|@bindir@|$(bindir)|g' \ |
| 458 |
-e 's|@mandir@|$(mandir)|g' \ |
| 459 |
-e 's|@nagelfardatadir@|$(nagelfardatadir)|g' \ |
| 460 |
-e 's|@moduleshome@|$(moduleshome)|g' \ |
| 461 |
-e 's|@initrc@|$(initrc)|g' \ |
| 462 |
-e 's|@modulespath@|$(modulespath)|g' \ |
| 463 |
-e 's|@VERSION@|$(VERSION)|g' \ |
| 464 |
-e 's|@TCLSHDIR@/tclsh|$(TCLSH)|g' \ |
| 465 |
-e 's|@TCLSH@|$(TCLSH)|g' \ |
| 466 |
-e 's|@PYTHON@|$(PYTHON)|g' \ |
| 467 |
-e 's|@loggedevents@|$(loggedevents)|g' \ |
| 468 |
-e 's|@loggercmd@|$(loggercmd)|g' \ |
| 469 |
-e 's|@pagercmd@|$(pagercmd)|g' \ |
| 470 |
-e 's|@domainnamecmd@|$(domainnamecmd)|g' \ |
| 471 |
-e 's|@paginate@|$(setpaginate)|g' \ |
| 472 |
-e 's|@verbosity@|$(verbosity)|g' \ |
| 473 |
-e 's|@color@|$(setcolor)|g' \ |
| 474 |
-e 's|@darkbgcolors@|$(darkbgcolors)|g' \ |
| 475 |
-e 's|@lightbgcolors@|$(lightbgcolors)|g' \ |
| 476 |
-e 's|@termbg@|$(termbg)|g' \ |
| 477 |
-e 's|@lockedconfigs@|$(lockedconfigs)|g' \ |
| 478 |
-e 's|@unloadmatchorder@|$(unloadmatchorder)|g' \ |
| 479 |
-e 's|@implicitdefault@|$(setimplicitdefault)|g' \ |
| 480 |
-e 's|@extendeddefault@|$(setextendeddefault)|g' \ |
| 481 |
-e 's|@advversspec@|$(setadvversspec)|g' \ |
| 482 |
-e 's|@uniquenameloaded@|$(setuniquenameloaded)|g' \ |
| 483 |
-e 's|@sourcecache@|$(setsourcecache)|g' \ |
| 484 |
-e 's|@searchmatch@|$(searchmatch)|g' \ |
| 485 |
-e 's|@wa277@|$(setwa277)|g' \ |
| 486 |
-e 's|@pathentryreorder@|$(setpathentryreorder)|g' \ |
| 487 |
-e 's|@initenvvars@|$(initenvvars)|g' \ |
| 488 |
-e 's|@icase@|$(icase)|g' \ |
| 489 |
-e 's|@nearlyforbiddendays@|$(nearlyforbiddendays)|g' \ |
| 490 |
-e 's|@tagabbrev@|$(tagabbrev)|g' \ |
| 491 |
-e 's|@tagcolorname@|$(tagcolorname)|g' \ |
| 492 |
-e 's|@stickypurge@|$(stickypurge)|g' \ |
| 493 |
-e 's|@abortonerror@|$(abortonerror)|g' \ |
| 494 |
-e 's|@availoutput@|$(availoutput)|g' \ |
| 495 |
-e 's|@availterseoutput@|$(availterseoutput)|g' \ |
| 496 |
-e 's|@listoutput@|$(listoutput)|g' \ |
| 497 |
-e 's|@listterseoutput@|$(listterseoutput)|g' \ |
| 498 |
-e 's|@spideroutput@|$(spideroutput)|g' \ |
| 499 |
-e 's|@spiderterseoutput@|$(spiderterseoutput)|g' \ |
| 500 |
-e 's|@variantshortcut@|$(variantshortcut)|g' \ |
| 501 |
-e 's|@editor@|$(editor)|g' \ |
| 502 |
-e 's|@autohandling@|$(setautohandling)|g' \ |
| 503 |
-e 's|@conflictunload@|$(setconflictunload)|g' \ |
| 504 |
-e 's|@requirevia@|$(setrequirevia)|g' \ |
| 505 |
-e 's|@implicitrequirement@|$(setimplicitrequirement)|g' \ |
| 506 |
-e 's|@availindepth@|$(setavailindepth)|g' \ |
| 507 |
-e 's|@spiderindepth@|$(setspiderindepth)|g' \ |
| 508 |
-e 's|@silentshdbgsupport@|$(setsilentshdbgsupport)|g' \ |
| 509 |
-e 's|@ml@|$(setml)|g' \ |
| 510 |
-e 's|@setshellstartup@|$(setsetshellstartup)|g' \ |
| 511 |
-e 's|@mcookieversioncheck@|$(setmcookieversioncheck)|g' \ |
| 512 |
-e 's|@quarantinesupport@|$(setquarantinesupport)|g' \ |
| 513 |
-e 's|@libtclenvmodules@|$(setlibtclenvmodules)|g' \ |
| 514 |
-e 's|@SHLIB_SUFFIX@|$(SHLIB_SUFFIX)|g' \ |
| 515 |
-e 's|@multilibsupport@|$(setmultilibsupport)|g' \ |
| 516 |
-e 's|@notmultilibsupport@|$(setnotmultilibsupport)|g' \ |
| 517 |
-e 's|@VERSIONING@|$(setversioning)|g' \ |
| 518 |
-e 's|@NOTVERSIONING@|$(setnotversioning)|g' \ |
| 519 |
-e 's|@setbinpath@|$(setsetbinpath)|g' \ |
| 520 |
-e 's|@appendbinpath@|$(setappendbinpath)|g' \ |
| 521 |
-e 's|@setmanpath@|$(setsetmanpath)|g' \ |
| 522 |
-e 's|@appendmanpath@|$(setappendmanpath)|g' \ |
| 523 |
-e 's|@usemanpath@|$(setusemanpath)|g' \ |
| 524 |
-e 's|@setpythonpath@|$(setsetpythonpath)|g' \ |
| 525 |
-e 's|@appendpythonpath@|$(setappendpythonpath)|g' \ |
| 526 |
-e 's|@pythondir@|$(pythondir)|g' \ |
| 527 |
-e 's|@notusemanpath@|$(setnotusemanpath)|g' \ |
| 528 |
-e 's|@shellcompsource@|$(shellcompsource)|g' \ |
| 529 |
-e 's|@tcllintercmd@|$(tcllintercmd)|g' \ |
| 530 |
-e 's|@nagelfaraddons@|$(setnagelfaraddons)|g' \ |
| 531 |
-e 's|@MODULES_RELEASE@|$(MODULES_RELEASE)|g' \ |
| 532 |
-e 's|@MODULES_BUILD@|$(MODULES_BUILD)|g' \ |
| 533 |
-e 's|@MODULES_RPM_RELEASE@|$(MODULES_RPM_RELEASE)|g' \ |
| 534 |
-e 's|@MODULES_BUILD_DATE@|$(MODULES_BUILD_DATE)|g' $< > $@ |
| 535 |
endef |
| 536 |
|
| 537 |
DIST_PREFIX := modules-$(MODULES_RELEASE)$(MODULES_BUILD) |
| 538 |
DIST_WIN_PREFIX := $(DIST_PREFIX)-win |
| 539 |
|
| 540 |
# avoid shared definitions to be rebuilt by make |
| 541 |
Makefile.inc: ; |
| 542 |
|
| 543 |
# refresh files embedding shared definitions when ./configure updates them |
| 544 |
# (tcl scripts and their assemblies follow through their version.inc |
| 545 |
# prerequisite) |
| 546 |
version.inc share/rpm/environment-modules.spec script/add.modules \ |
| 547 |
script/gitlog2changelog.py script/modulecmd \ |
| 548 |
testsuite/example/.modulespath testsuite/example/modulespath-wild \ |
| 549 |
testsuite/example/modulerc testsuite/example/initrc-1 \ |
| 550 |
testsuite/example/initrc: Makefile.inc |
| 551 |
|
| 552 |
version.inc: version.inc.in $(GIT_REFRESH_PREREQ) |
| 553 |
$(translate-in-script) |
| 554 |
|
| 555 |
share/rpm/environment-modules.spec: share/rpm/environment-modules.spec.in $(GIT_REFRESH_PREREQ) |
| 556 |
$(translate-in-script) |
| 557 |
|
| 558 |
tcl/cache.tcl: tcl/cache.tcl.in version.inc |
| 559 |
$(translate-in-script) |
| 560 |
|
| 561 |
tcl/coll.tcl: tcl/coll.tcl.in version.inc |
| 562 |
$(translate-in-script) |
| 563 |
|
| 564 |
tcl/envmngt.tcl: tcl/envmngt.tcl.in version.inc |
| 565 |
$(translate-in-script) |
| 566 |
|
| 567 |
tcl/init.tcl: tcl/init.tcl.in version.inc |
| 568 |
$(translate-in-script) |
| 569 |
|
| 570 |
tcl/main.tcl: tcl/main.tcl.in version.inc |
| 571 |
$(translate-in-script) |
| 572 |
|
| 573 |
tcl/interp.tcl: tcl/interp.tcl.in version.inc |
| 574 |
$(translate-in-script) |
| 575 |
|
| 576 |
tcl/modfind.tcl: tcl/modfind.tcl.in version.inc |
| 577 |
$(translate-in-script) |
| 578 |
|
| 579 |
tcl/report.tcl: tcl/report.tcl.in version.inc |
| 580 |
$(translate-in-script) |
| 581 |
|
| 582 |
tcl/subcmd.tcl: tcl/subcmd.tcl.in version.inc |
| 583 |
$(translate-in-script) |
| 584 |
|
| 585 |
tcl/init.tcl_i: tcl/init.tcl $(NAGELFAR) |
| 586 |
$(ECHO_GEN) |
| 587 |
rm -f $<_log |
| 588 |
$(NAGELFAR) -instrument $< |
| 589 |
ifeq ($(multilibsupport),y) |
| 590 |
ifeq ($(COVERAGE_MULTILIB),y) |
| 591 |
sed -i -e 's|$(libdir64)|lib64|' -e 's|$(libdir32)|lib|' $@ |
| 592 |
else |
| 593 |
sed -i -e 's|$(libdir64)|lib|' -e 's|$(libdir32)|lib|' $@ |
| 594 |
endif |
| 595 |
else |
| 596 |
sed -i -e 's|$(libdir)|lib|' $@ |
| 597 |
endif |
| 598 |
|
| 599 |
tcl/subcmd.tcl_i: tcl/subcmd.tcl $(NAGELFAR) |
| 600 |
$(ECHO_GEN) |
| 601 |
rm -f $<_log |
| 602 |
$(NAGELFAR) -instrument $< |
| 603 |
sed -i -e 's|$(nagelfardatadir)|share/nagelfar|g' $@ |
| 604 |
|
| 605 |
# join all tcl/*.tcl files to build modulecmd.tcl |
| 606 |
modulecmd.tcl: tcl/cache.tcl tcl/coll.tcl tcl/envmngt.tcl tcl/init.tcl \ |
| 607 |
tcl/interp.tcl tcl/main.tcl tcl/mfcmd.tcl tcl/modeval.tcl \ |
| 608 |
tcl/modfind.tcl tcl/modscan.tcl tcl/modspec.tcl tcl/report.tcl \ |
| 609 |
tcl/subcmd.tcl tcl/util.tcl version.inc |
| 610 |
$(ECHO_GEN) |
| 611 |
echo "#!$(TCLSH)" > $@ |
| 612 |
sed -e '3s/.*/# MODULECMD.TCL, a pure TCL implementation of the module command/' \ |
| 613 |
-e '1d' -e '/^# vim:/d' -e '/^# ;;;/d' tcl/init.tcl >> $@ |
| 614 |
sed -e '1,22d' -e '/^# vim:/d' -e '/^# ;;;/d' tcl/util.tcl >> $@ |
| 615 |
sed -e '1,22d' -e '/^# vim:/d' -e '/^# ;;;/d' tcl/envmngt.tcl >> $@ |
| 616 |
sed -e '1,22d' -e '/^# vim:/d' -e '/^# ;;;/d' tcl/report.tcl >> $@ |
| 617 |
sed -e '1,22d' -e '/^# vim:/d' -e '/^# ;;;/d' tcl/interp.tcl >> $@ |
| 618 |
sed -e '1,22d' -e '/^# vim:/d' -e '/^# ;;;/d' tcl/mfcmd.tcl >> $@ |
| 619 |
sed -e '1,20d' -e '/^# vim:/d' -e '/^# ;;;/d' tcl/modscan.tcl >> $@ |
| 620 |
sed -e '1,22d' -e '/^# vim:/d' -e '/^# ;;;/d' tcl/modfind.tcl >> $@ |
| 621 |
sed -e '1,22d' -e '/^# vim:/d' -e '/^# ;;;/d' tcl/modeval.tcl >> $@ |
| 622 |
sed -e '1,20d' -e '/^# vim:/d' -e '/^# ;;;/d' tcl/modspec.tcl >> $@ |
| 623 |
sed -e '1,20d' -e '/^# vim:/d' -e '/^# ;;;/d' tcl/cache.tcl >> $@ |
| 624 |
sed -e '1,20d' -e '/^# vim:/d' -e '/^# ;;;/d' tcl/coll.tcl >> $@ |
| 625 |
sed -e '1,22d' -e '/^# vim:/d' -e '/^# ;;;/d' tcl/subcmd.tcl >> $@ |
| 626 |
sed -e '1,22d' -e '/^# vim:/d' -e '/^# ;;;/d' tcl/main.tcl >> $@ |
| 627 |
chmod +x $@ |
| 628 |
|
| 629 |
# generate an empty changelog file if not working from git repository |
| 630 |
ifeq ($(wildcard .git),.git) |
| 631 |
ChangeLog: script/gitlog2changelog.py |
| 632 |
$(ECHO_GEN) |
| 633 |
script/gitlog2changelog.py |
| 634 |
else |
| 635 |
ChangeLog: |
| 636 |
$(ECHO_GEN) |
| 637 |
echo "Please refer to the NEWS document to learn about main changes" >$@ |
| 638 |
endif |
| 639 |
|
| 640 |
ChangeLog.gz: ChangeLog |
| 641 |
$(ECHO_GEN) |
| 642 |
gzip --keep --force -9 $< |
| 643 |
|
| 644 |
README: |
| 645 |
$(ECHO_GEN) |
| 646 |
sed -e '181,187d' -e '1,10d' -e 's|\[\(.*\?\)\]\[[0-9]\]|\1|' [email protected] > $@ |
| 647 |
|
| 648 |
# AGENTS.md (https://agents.md) is the single source of instructions for AI |
| 649 |
# coding assistants working in this repository. Codex, Claude Code and |
| 650 |
# Mistral Vibe read it directly, but Gemini CLI only looks for its own |
| 651 |
# GEMINI.md filename, so generate a stub that just imports AGENTS.md |
| 652 |
GEMINI.md: AGENTS.md |
| 653 |
$(ECHO_GEN) |
| 654 |
echo '@AGENTS.md' > $@ |
| 655 |
|
| 656 |
script/add.modules: script/add.modules.in |
| 657 |
$(translate-in-script) |
| 658 |
chmod +x $@ |
| 659 |
|
| 660 |
script/gitlog2changelog.py: script/gitlog2changelog.py.in |
| 661 |
$(translate-in-script) |
| 662 |
chmod +x $@ |
| 663 |
|
| 664 |
script/modulecmd: script/modulecmd.in |
| 665 |
$(translate-in-script) |
| 666 |
chmod +x $@ |
| 667 |
|
| 668 |
# Tcl extension library-related rules |
| 669 |
lib/libtclenvmodules$(SHLIB_SUFFIX): |
| 670 |
$(MAKE) --no-print-directory -C lib $(@F) |
| 671 |
|
| 672 |
lib/libtestutil-closedir$(SHLIB_SUFFIX): |
| 673 |
$(MAKE) --no-print-directory -C lib $(@F) |
| 674 |
|
| 675 |
lib/libtestutil-getpwuid$(SHLIB_SUFFIX): |
| 676 |
$(MAKE) --no-print-directory -C lib $(@F) |
| 677 |
|
| 678 |
lib/libtestutil-getgroups$(SHLIB_SUFFIX): |
| 679 |
$(MAKE) --no-print-directory -C lib $(@F) |
| 680 |
|
| 681 |
lib/libtestutil-0getgroups$(SHLIB_SUFFIX): |
| 682 |
$(MAKE) --no-print-directory -C lib $(@F) |
| 683 |
|
| 684 |
lib/libtestutil-dupgetgroups$(SHLIB_SUFFIX): |
| 685 |
$(MAKE) --no-print-directory -C lib $(@F) |
| 686 |
|
| 687 |
lib/libtestutil-time$(SHLIB_SUFFIX): |
| 688 |
$(MAKE) --no-print-directory -C lib $(@F) |
| 689 |
|
| 690 |
lib/libtestutil-mktime$(SHLIB_SUFFIX): |
| 691 |
$(MAKE) --no-print-directory -C lib $(@F) |
| 692 |
|
| 693 |
lib/libtestutil-tcl_loadfile$(SHLIB_SUFFIX): |
| 694 |
$(MAKE) --no-print-directory -C lib $(@F) |
| 695 |
|
| 696 |
# example configs for test rules |
| 697 |
testsuite/example/.modulespath: testsuite/example/.modulespath.in |
| 698 |
$(translate-in-script) |
| 699 |
|
| 700 |
testsuite/example/modulespath-wild: testsuite/example/modulespath-wild.in |
| 701 |
$(translate-in-script) |
| 702 |
|
| 703 |
testsuite/example/modulerc: testsuite/example/modulerc.in |
| 704 |
$(translate-in-script) |
| 705 |
|
| 706 |
testsuite/example/initrc-1: testsuite/example/initrc-1.in |
| 707 |
$(translate-in-script) |
| 708 |
|
| 709 |
testsuite/example/initrc: testsuite/example/initrc.in |
| 710 |
$(translate-in-script) |
| 711 |
|
| 712 |
install-testsiteconfig: testsuite/example/siteconfig.tcl |
| 713 |
$(MAKE) -C init install-testconfig DESTDIR='$(DESTDIR)' |
| 714 |
$(INSTALL_DATA) $^ '$(DESTDIR)$(etcdir)/' |
| 715 |
|
| 716 |
install-testsiteconfig-1: testsuite/example/siteconfig.tcl-1 |
| 717 |
$(MAKE) -C init install-testconfig DESTDIR='$(DESTDIR)' |
| 718 |
$(INSTALL_DATA) $^ '$(DESTDIR)$(etcdir)/siteconfig.tcl' |
| 719 |
|
| 720 |
install-testmodulerc: testsuite/example/modulerc |
| 721 |
$(MAKE) -C init install-testconfig DESTDIR='$(DESTDIR)' |
| 722 |
$(INSTALL_DATA) $^ '$(DESTDIR)$(initrc)' |
| 723 |
|
| 724 |
install-testinitrc-1: testsuite/example/initrc-1 |
| 725 |
$(MAKE) -C init install-testconfig DESTDIR='$(DESTDIR)' |
| 726 |
$(INSTALL_DATA) $^ '$(DESTDIR)$(initrc)' |
| 727 |
|
| 728 |
install-testinitrc: testsuite/example/initrc |
| 729 |
$(MAKE) -C init install-testconfig DESTDIR='$(DESTDIR)' |
| 730 |
$(INSTALL_DATA) $^ '$(DESTDIR)$(initrc)' |
| 731 |
|
| 732 |
install-testetcrc: testsuite/etc/empty |
| 733 |
$(MAKE) -C init install-testconfig DESTDIR='$(DESTDIR)' |
| 734 |
$(INSTALL_DATA) $^ '$(DESTDIR)$(etcdir)/rc' |
| 735 |
|
| 736 |
install-testmodspath: testsuite/example/.modulespath |
| 737 |
$(MAKE) -C init install-testconfig DESTDIR='$(DESTDIR)' |
| 738 |
$(INSTALL_DATA) $^ '$(DESTDIR)$(modulespath)' |
| 739 |
|
| 740 |
install-testmodspath-empty: testsuite/example/modulespath-empty |
| 741 |
$(MAKE) -C init install-testconfig DESTDIR='$(DESTDIR)' |
| 742 |
$(INSTALL_DATA) $^ '$(DESTDIR)$(modulespath)' |
| 743 |
|
| 744 |
install-testmodspath-wild: testsuite/example/modulespath-wild |
| 745 |
$(MAKE) -C init install-testconfig DESTDIR='$(DESTDIR)' |
| 746 |
$(INSTALL_DATA) $^ '$(DESTDIR)$(modulespath)' |
| 747 |
|
| 748 |
install-testmoguicmd: |
| 749 |
$(INSTALL_DIR) '$(HOME)/.local/bin' |
| 750 |
$(INSTALL_PROGRAM) script/envml '$(HOME)/.local/bin/mogui-cmd' |
| 751 |
|
| 752 |
uninstall-testconfig: |
| 753 |
rm -f '$(DESTDIR)$(etcdir)/rc' |
| 754 |
rm -f '$(DESTDIR)$(etcdir)/siteconfig.tcl' |
| 755 |
rm -f '$(DESTDIR)$(initrc)' |
| 756 |
rm -f '$(DESTDIR)$(modulespath)' |
| 757 |
rm -f '$(HOME)/.local/bin/mogui-cmd' |
| 758 |
$(MAKE) -C init uninstall-testconfig DESTDIR='$(DESTDIR)' |
| 759 |
|
| 760 |
# define space character as a variable to reference it in functions |
| 761 |
space := $(subst ,, ) |
| 762 |
|
| 763 |
install: $(INSTALL_PREREQ) |
| 764 |
$(INSTALL_DIR) '$(DESTDIR)$(libexecdir)' |
| 765 |
$(INSTALL_DIR) '$(DESTDIR)$(bindir)' |
| 766 |
$(INSTALL_DIR) '$(DESTDIR)$(etcdir)' |
| 767 |
$(INSTALL_PROGRAM) modulecmd.tcl '$(DESTDIR)$(libexecdir)/' |
| 768 |
ifeq ($(libtclenvmodules),y) |
| 769 |
$(INSTALL_DIR) '$(DESTDIR)$(libdir)' |
| 770 |
$(INSTALL_PROGRAM) lib/libtclenvmodules$(SHLIB_SUFFIX) '$(DESTDIR)$(libdir)/' |
| 771 |
endif |
| 772 |
$(INSTALL_PROGRAM) script/envml '$(DESTDIR)$(bindir)/' |
| 773 |
$(INSTALL_PROGRAM) script/add.modules '$(DESTDIR)$(bindir)/' |
| 774 |
$(INSTALL_PROGRAM) script/modulecmd '$(DESTDIR)$(bindir)/' |
| 775 |
$(INSTALL_PROGRAM) script/mkroot '$(DESTDIR)$(bindir)/' |
| 776 |
ifeq ($(windowssupport),y) |
| 777 |
$(INSTALL_PROGRAM) script/module.cmd '$(DESTDIR)$(bindir)/' |
| 778 |
$(INSTALL_PROGRAM) script/ml.cmd '$(DESTDIR)$(bindir)/' |
| 779 |
$(INSTALL_PROGRAM) script/envml.cmd '$(DESTDIR)$(bindir)/' |
| 780 |
endif |
| 781 |
ifneq ($(wildcard $(subst $(space),\$(space),$(DESTDIR)$(etcdir)/siteconfig.tcl)),$(DESTDIR)$(etcdir)/siteconfig.tcl) |
| 782 |
$(INSTALL_DATA) siteconfig.tcl '$(DESTDIR)$(etcdir)/' |
| 783 |
endif |
| 784 |
ifeq ($(docinstall),y) |
| 785 |
$(INSTALL_DIR) '$(DESTDIR)$(docdir)' |
| 786 |
$(INSTALL_DATA) COPYING '$(DESTDIR)$(docdir)/' |
| 787 |
$(INSTALL_DATA) $(CHANGELOG) '$(DESTDIR)$(docdir)/' |
| 788 |
$(INSTALL_DATA) README '$(DESTDIR)$(docdir)/' |
| 789 |
endif |
| 790 |
ifeq ($(vimaddons),y) |
| 791 |
$(INSTALL_DIR) '$(DESTDIR)$(vimdatadir)/ftdetect' |
| 792 |
$(INSTALL_DIR) '$(DESTDIR)$(vimdatadir)/ftplugin' |
| 793 |
$(INSTALL_DIR) '$(DESTDIR)$(vimdatadir)/syntax' |
| 794 |
$(INSTALL_DATA) share/vim/ftdetect/modulefile.vim '$(DESTDIR)$(vimdatadir)/ftdetect' |
| 795 |
$(INSTALL_DATA) share/vim/ftplugin/modulefile.vim '$(DESTDIR)$(vimdatadir)/ftplugin' |
| 796 |
$(INSTALL_DATA) share/vim/syntax/modulefile.vim '$(DESTDIR)$(vimdatadir)/syntax' |
| 797 |
endif |
| 798 |
ifeq ($(emacsaddons),y) |
| 799 |
$(INSTALL_DIR) '$(DESTDIR)$(emacsdatadir)' |
| 800 |
$(INSTALL_DATA) share/emacs/lisp/modulefile-mode.el* '$(DESTDIR)$(emacsdatadir)' |
| 801 |
endif |
| 802 |
ifeq ($(nagelfaraddons),y) |
| 803 |
$(INSTALL_DIR) '$(DESTDIR)$(nagelfardatadir)' |
| 804 |
$(INSTALL_DATA) share/nagelfar/plugin_modulecache.tcl '$(DESTDIR)$(nagelfardatadir)/' |
| 805 |
$(INSTALL_DATA) share/nagelfar/plugin_modulefile.tcl '$(DESTDIR)$(nagelfardatadir)/' |
| 806 |
$(INSTALL_DATA) share/nagelfar/plugin_modulerc.tcl '$(DESTDIR)$(nagelfardatadir)/' |
| 807 |
$(INSTALL_DATA) share/nagelfar/plugin_globalrc.tcl '$(DESTDIR)$(nagelfardatadir)/' |
| 808 |
$(INSTALL_DATA) share/nagelfar/syntaxdb_modulecache.tcl '$(DESTDIR)$(nagelfardatadir)/' |
| 809 |
$(INSTALL_DATA) share/nagelfar/syntaxdb_modulefile.tcl '$(DESTDIR)$(nagelfardatadir)/' |
| 810 |
$(INSTALL_DATA) share/nagelfar/syntaxdb_modulerc.tcl '$(DESTDIR)$(nagelfardatadir)/' |
| 811 |
endif |
| 812 |
$(MAKE) -C init install DESTDIR='$(DESTDIR)' |
| 813 |
ifneq ($(builddoc),n) |
| 814 |
$(MAKE) -C doc install DESTDIR='$(DESTDIR)' |
| 815 |
else |
| 816 |
@echo |
| 817 |
@echo "WARNING: Documentation not built nor installed" >&2 |
| 818 |
endif |
| 819 |
@echo |
| 820 |
@echo "NOTICE: Modules installation is complete." >&2 |
| 821 |
@echo " Please read the 'Configuration' section in INSTALL guide to learn" >&2 |
| 822 |
@echo " how to adapt your installation and make it fit your needs." >&2 |
| 823 |
@echo |
| 824 |
|
| 825 |
uninstall: |
| 826 |
rm -f '$(DESTDIR)$(libexecdir)/modulecmd.tcl' |
| 827 |
ifeq ($(libtclenvmodules),y) |
| 828 |
rm -f '$(DESTDIR)$(libdir)/libtclenvmodules$(SHLIB_SUFFIX)' |
| 829 |
endif |
| 830 |
rm -f '$(DESTDIR)$(bindir)/envml' |
| 831 |
rm -f '$(DESTDIR)$(bindir)/add.modules' |
| 832 |
rm -f '$(DESTDIR)$(bindir)/modulecmd' |
| 833 |
rm -f '$(DESTDIR)$(bindir)/mkroot' |
| 834 |
ifeq ($(windowssupport),y) |
| 835 |
rm -f '$(DESTDIR)$(bindir)/module.cmd' |
| 836 |
rm -f '$(DESTDIR)$(bindir)/ml.cmd' |
| 837 |
rm -f '$(DESTDIR)$(bindir)/envml.cmd' |
| 838 |
endif |
| 839 |
ifeq ($(vimaddons),y) |
| 840 |
rm -f '$(DESTDIR)$(vimdatadir)/ftdetect/modulefile.vim' |
| 841 |
rm -f '$(DESTDIR)$(vimdatadir)/ftplugin/modulefile.vim' |
| 842 |
rm -f '$(DESTDIR)$(vimdatadir)/syntax/modulefile.vim' |
| 843 |
-rmdir '$(DESTDIR)$(vimdatadir)/ftdetect' |
| 844 |
-rmdir '$(DESTDIR)$(vimdatadir)/ftplugin' |
| 845 |
-rmdir '$(DESTDIR)$(vimdatadir)/syntax' |
| 846 |
-rmdir -p '$(DESTDIR)$(vimdatadir)' |
| 847 |
endif |
| 848 |
ifeq ($(emacsaddons),y) |
| 849 |
rm -f '$(DESTDIR)$(emacsdatadir)/modulefile-mode.el' |
| 850 |
rm -f '$(DESTDIR)$(emacsdatadir)/modulefile-mode.elc' |
| 851 |
-rmdir -p '$(DESTDIR)$(emacsdatadir)' |
| 852 |
endif |
| 853 |
ifeq ($(nagelfaraddons),y) |
| 854 |
rm -f '$(DESTDIR)$(nagelfardatadir)/plugin_modulecache.tcl' |
| 855 |
rm -f '$(DESTDIR)$(nagelfardatadir)/plugin_modulefile.tcl' |
| 856 |
rm -f '$(DESTDIR)$(nagelfardatadir)/plugin_modulerc.tcl' |
| 857 |
rm -f '$(DESTDIR)$(nagelfardatadir)/plugin_globalrc.tcl' |
| 858 |
rm -f '$(DESTDIR)$(nagelfardatadir)/syntaxdb_modulecache.tcl' |
| 859 |
rm -f '$(DESTDIR)$(nagelfardatadir)/syntaxdb_modulefile.tcl' |
| 860 |
rm -f '$(DESTDIR)$(nagelfardatadir)/syntaxdb_modulerc.tcl' |
| 861 |
-rmdir -p '$(DESTDIR)$(nagelfardatadir)' |
| 862 |
endif |
| 863 |
ifeq ($(docinstall),y) |
| 864 |
rm -f $(foreach docfile,$(CHANGELOG) README COPYING,'$(DESTDIR)$(docdir)/$(docfile)') |
| 865 |
ifeq ($(builddoc),n) |
| 866 |
rmdir '$(DESTDIR)$(docdir)' |
| 867 |
endif |
| 868 |
endif |
| 869 |
$(MAKE) -C init uninstall DESTDIR='$(DESTDIR)' |
| 870 |
ifneq ($(builddoc),n) |
| 871 |
$(MAKE) -C doc uninstall DESTDIR='$(DESTDIR)' |
| 872 |
endif |
| 873 |
rmdir '$(DESTDIR)$(libexecdir)' |
| 874 |
ifeq ($(libtclenvmodules),y) |
| 875 |
rmdir '$(DESTDIR)$(libdir)' |
| 876 |
endif |
| 877 |
rmdir '$(DESTDIR)$(bindir)' |
| 878 |
rmdir '$(DESTDIR)$(datarootdir)' |
| 879 |
$(RMDIR_IGN_NON_EMPTY) '$(DESTDIR)$(prefix)' || true |
| 880 |
|
| 881 |
# include config.{guess,sub} scripts in dist if generated by autoreconf |
| 882 |
ifeq ($(wildcard lib/config.guess),lib/config.guess) |
| 883 |
DIST_AUTORECONF_EXTRA += lib/config.guess |
| 884 |
endif |
| 885 |
ifeq ($(wildcard lib/config.sub),lib/config.sub) |
| 886 |
DIST_AUTORECONF_EXTRA += lib/config.sub |
| 887 |
endif |
| 888 |
|
| 889 |
# include pre-generated documents not to require documentation build |
| 890 |
# tools when installing from dist tarball |
| 891 |
dist-tar: $(CHANGELOG) share/rpm/environment-modules.spec pkgdoc |
| 892 |
$(ECHO_GEN2) $(DIST_PREFIX).tar |
| 893 |
git archive --prefix=$(DIST_PREFIX)/ --worktree-attributes \ |
| 894 |
-o $(DIST_PREFIX).tar HEAD |
| 895 |
tar -rf $(DIST_PREFIX).tar --transform 's,^,$(DIST_PREFIX)/,' \ |
| 896 |
lib/configure lib/config.h.in $(DIST_AUTORECONF_EXTRA) $(CHANGELOG) \ |
| 897 |
doc/build/MIGRATING.txt doc/build/changes.txt doc/build/INSTALL.txt \ |
| 898 |
doc/build/INSTALL-win.txt doc/build/NEWS.txt doc/build/CONTRIBUTING.txt \ |
| 899 |
doc/build/module.1.in doc/build/ml.1 doc/build/envml.1 \ |
| 900 |
doc/build/modulecmd.1 doc/build/modulefile.5 \ |
| 901 |
share/rpm/environment-modules.spec |
| 902 |
|
| 903 |
dist-gzip: dist-tar |
| 904 |
$(ECHO_GEN2) $(DIST_PREFIX).tar.gz |
| 905 |
gzip -f -9 $(DIST_PREFIX).tar |
| 906 |
|
| 907 |
dist-bzip2: dist-tar |
| 908 |
$(ECHO_GEN2) $(DIST_PREFIX).tar.bz2 |
| 909 |
bzip2 -f $(DIST_PREFIX).tar |
| 910 |
|
| 911 |
dist: dist-gzip |
| 912 |
|
| 913 |
# dist zip ball for Windows platform with all pre-generated relevant files |
| 914 |
dist-win: modulecmd.tcl $(CHANGELOG) README pkgdoc |
| 915 |
$(ECHO_GEN2) $(DIST_WIN_PREFIX).zip |
| 916 |
$(INSTALL_DIR) $(DIST_WIN_PREFIX) |
| 917 |
$(INSTALL_DIR) $(DIST_WIN_PREFIX)/libexec |
| 918 |
$(INSTALL_PROGRAM) modulecmd.tcl $(DIST_WIN_PREFIX)/libexec/ |
| 919 |
$(INSTALL_DIR) $(DIST_WIN_PREFIX)/bin |
| 920 |
$(INSTALL_PROGRAM) script/module.cmd $(DIST_WIN_PREFIX)/bin/ |
| 921 |
$(INSTALL_PROGRAM) script/ml.cmd $(DIST_WIN_PREFIX)/bin/ |
| 922 |
$(INSTALL_PROGRAM) script/envml.cmd $(DIST_WIN_PREFIX)/bin/ |
| 923 |
$(INSTALL_DIR) $(DIST_WIN_PREFIX)/doc |
| 924 |
$(INSTALL_DATA) COPYING $(DIST_WIN_PREFIX)/doc/ |
| 925 |
$(INSTALL_DATA) $(CHANGELOG) $(DIST_WIN_PREFIX)/doc/ |
| 926 |
$(INSTALL_DATA) README $(DIST_WIN_PREFIX)/doc/ |
| 927 |
$(INSTALL_DATA) doc/build/MIGRATING.txt $(DIST_WIN_PREFIX)/doc/ |
| 928 |
$(INSTALL_DATA) doc/build/INSTALL-win.txt $(DIST_WIN_PREFIX)/doc/ |
| 929 |
$(INSTALL_DATA) doc/build/NEWS.txt $(DIST_WIN_PREFIX)/doc/ |
| 930 |
$(INSTALL_DATA) doc/build/CONTRIBUTING.txt $(DIST_WIN_PREFIX)/doc/ |
| 931 |
$(INSTALL_DATA) doc/build/module.txt $(DIST_WIN_PREFIX)/doc/ |
| 932 |
$(INSTALL_DATA) doc/build/ml.txt $(DIST_WIN_PREFIX)/doc/ |
| 933 |
$(INSTALL_DATA) doc/build/envml.txt $(DIST_WIN_PREFIX)/doc/ |
| 934 |
$(INSTALL_DATA) doc/build/modulefile.txt $(DIST_WIN_PREFIX)/doc/ |
| 935 |
$(MAKE) --no-print-directory -C init dist-win DIST_WIN_PREFIX=../$(DIST_WIN_PREFIX) |
| 936 |
$(INSTALL_PROGRAM) script/INSTALL.bat $(DIST_WIN_PREFIX)/ |
| 937 |
$(INSTALL_PROGRAM) script/UNINSTALL.bat $(DIST_WIN_PREFIX)/ |
| 938 |
$(INSTALL_PROGRAM) script/TESTINSTALL.bat $(DIST_WIN_PREFIX)/ |
| 939 |
$(INSTALL_PROGRAM) script/INSTALL_PWSH.bat $(DIST_WIN_PREFIX)/ |
| 940 |
$(INSTALL_PROGRAM) script/TESTINSTALL_PWSH.ps1 $(DIST_WIN_PREFIX)/ |
| 941 |
zip -r $(DIST_WIN_PREFIX).zip $(DIST_WIN_PREFIX) |
| 942 |
rm -rf $(DIST_WIN_PREFIX) |
| 943 |
|
| 944 |
srpm: dist-bzip2 |
| 945 |
rpmbuild -ts $(DIST_PREFIX).tar.bz2 |
| 946 |
|
| 947 |
rpm: dist-bzip2 |
| 948 |
rpmbuild -tb $(DIST_PREFIX).tar.bz2 |
| 949 |
|
| 950 |
clean: |
| 951 |
rm -f *.log *.sum |
| 952 |
rm -f tcl/*.tcl_i tcl/*.tcl_log tcl/*.tcl_m |
| 953 |
rm -rf coverage |
| 954 |
# do not clean generated docs if not in git repository |
| 955 |
ifeq ($(wildcard .git),.git) |
| 956 |
rm -f ChangeLog* |
| 957 |
endif |
| 958 |
rm -f README |
| 959 |
rm -f GEMINI.md |
| 960 |
rm -f modulecmd.tcl |
| 961 |
rm -f $(MODULECMDTEST) $(MODULECMDTEST)_i |
| 962 |
rm -f tcl/cache.tcl |
| 963 |
rm -f tcl/coll.tcl |
| 964 |
rm -f tcl/envmngt.tcl |
| 965 |
rm -f tcl/init.tcl |
| 966 |
rm -f tcl/interp.tcl |
| 967 |
rm -f tcl/main.tcl |
| 968 |
rm -f tcl/modfind.tcl |
| 969 |
rm -f tcl/report.tcl |
| 970 |
rm -f tcl/subcmd.tcl |
| 971 |
rm -f script/add.modules |
| 972 |
rm -f script/gitlog2changelog.py |
| 973 |
rm -f script/modulecmd |
| 974 |
rm -f testsuite/example/.modulespath testsuite/example/modulespath-wild testsuite/example/modulerc testsuite/example/initrc-1 testsuite/example/initrc |
| 975 |
rm -f modules-*.tar modules-*.tar.gz modules-*.tar.bz2 |
| 976 |
rm -rf modules-*-win/ |
| 977 |
rm -f modules-*-win.zip |
| 978 |
rm -f environment-modules-*.srpm environment-modules-*.rpm |
| 979 |
$(MAKE) -C init clean |
| 980 |
ifneq ($(builddoc),n) |
| 981 |
$(MAKE) -C doc clean |
| 982 |
endif |
| 983 |
rm -f version.inc |
| 984 |
rm -f share/rpm/environment-modules.spec |
| 985 |
ifneq ($(wildcard lib/Makefile),) |
| 986 |
$(MAKE) -C lib clean |
| 987 |
endif |
| 988 |
|
| 989 |
distclean: clean |
| 990 |
rm -f Makefile.inc |
| 991 |
rm -f site.exp |
| 992 |
rm -f icdiff .noicdiff |
| 993 |
rm -rf $(NAGELFAR_RELEASE) |
| 994 |
rm -rf $(TCL_RELEASE83) |
| 995 |
rm -f tclsh83 |
| 996 |
rm -rf spack |
| 997 |
rm -rf miniconda3 |
| 998 |
rm -rf OpenFOAM-dev |
| 999 |
rm -f tcl/tags |
| 1000 |
rm -f tcl/GTAGS tcl/GRTAGS tcl/GPATH tcl/gtags.file |
| 1001 |
rm -f tcl/syntaxdb_modulecmd.tcl |
| 1002 |
ifneq ($(wildcard lib/Makefile),) |
| 1003 |
$(MAKE) -C lib distclean |
| 1004 |
endif |
| 1005 |
|
| 1006 |
# make specific modulecmd script for test to check built extension lib |
| 1007 |
# if coverage asked, instrument script and clear previous coverage log |
| 1008 |
$(MODULECMDTEST): modulecmd.tcl |
| 1009 |
$(ECHO_GEN) |
| 1010 |
ifeq ($(multilibsupport),y) |
| 1011 |
sed -e 's|$(libdir64)|lib|' -e 's|$(libdir32)|lib|' $< > $@ |
| 1012 |
else |
| 1013 |
sed -e 's|$(libdir)|lib|' $< > $@ |
| 1014 |
endif |
| 1015 |
sed -i -e 's|$(nagelfardatadir)|share/nagelfar|g' $@ |
| 1016 |
|
| 1017 |
tcl/%.tcl_i: tcl/%.tcl $(NAGELFAR) |
| 1018 |
$(ECHO_GEN) |
| 1019 |
rm -f $<_log |
| 1020 |
$(NAGELFAR) -instrument $< |
| 1021 |
|
| 1022 |
# for coverage check, run tests on instrumented file to create coverage log |
| 1023 |
# over split tcl source files |
| 1024 |
$(MODULECMDTEST)_i: tcl/cache.tcl_i tcl/coll.tcl_i tcl/envmngt.tcl_i \ |
| 1025 |
tcl/init.tcl_i tcl/interp.tcl_i tcl/main.tcl_i tcl/mfcmd.tcl_i \ |
| 1026 |
tcl/modeval.tcl_i tcl/modfind.tcl_i tcl/modscan.tcl_i tcl/modspec.tcl_i \ |
| 1027 |
tcl/report.tcl_i tcl/subcmd.tcl_i tcl/util.tcl_i version.inc |
| 1028 |
$(ECHO_GEN) |
| 1029 |
echo "#!$(TCLSH)" > $@ |
| 1030 |
echo 'source tcl/init.tcl_i' >> $@ |
| 1031 |
echo 'source tcl/util.tcl_i' >> $@ |
| 1032 |
echo 'source tcl/envmngt.tcl_i' >> $@ |
| 1033 |
echo 'source tcl/report.tcl_i' >> $@ |
| 1034 |
echo 'source tcl/interp.tcl_i' >> $@ |
| 1035 |
echo 'source tcl/mfcmd.tcl_i' >> $@ |
| 1036 |
echo 'source tcl/modscan.tcl_i' >> $@ |
| 1037 |
echo 'source tcl/modfind.tcl_i' >> $@ |
| 1038 |
echo 'source tcl/modeval.tcl_i' >> $@ |
| 1039 |
echo 'source tcl/modspec.tcl_i' >> $@ |
| 1040 |
echo 'source tcl/cache.tcl_i' >> $@ |
| 1041 |
echo 'source tcl/coll.tcl_i' >> $@ |
| 1042 |
echo 'source tcl/subcmd.tcl_i' >> $@ |
| 1043 |
echo 'source tcl/main.tcl_i' >> $@ |
| 1044 |
chmod +x $@ |
| 1045 |
|
| 1046 |
# specific target to build test dependencies |
| 1047 |
test-deps: $(TEST_PREREQ) |
| 1048 |
|
| 1049 |
# if coverage enabled create markup file for better read coverage result |
| 1050 |
test: $(TEST_PREREQ) |
| 1051 |
TCLSH=$(TCLSH); export TCLSH; \ |
| 1052 |
MODULECMD=$(MODULECMD); export MODULECMD; \ |
| 1053 |
OBJDIR=`pwd -P`; export OBJDIR; \ |
| 1054 |
TESTSUITEDIR=`cd testsuite;pwd -P`; export TESTSUITEDIR; \ |
| 1055 |
runtest --srcdir $$TESTSUITEDIR --objdir $$OBJDIR $(RUNTESTFLAGS) --tool modules $(RUNTESTFILES) |
| 1056 |
ifeq ($(COVERAGE),y) |
| 1057 |
$(NAGELFAR) -markup tcl/cache.tcl |
| 1058 |
$(NAGELFAR) -markup tcl/coll.tcl |
| 1059 |
$(NAGELFAR) -markup tcl/envmngt.tcl |
| 1060 |
$(NAGELFAR) -markup tcl/init.tcl |
| 1061 |
$(NAGELFAR) -markup tcl/interp.tcl |
| 1062 |
$(NAGELFAR) -markup tcl/main.tcl |
| 1063 |
$(NAGELFAR) -markup tcl/mfcmd.tcl |
| 1064 |
$(NAGELFAR) -markup tcl/modeval.tcl |
| 1065 |
$(NAGELFAR) -markup tcl/modscan.tcl |
| 1066 |
$(NAGELFAR) -markup tcl/modfind.tcl |
| 1067 |
$(NAGELFAR) -markup tcl/modspec.tcl |
| 1068 |
$(NAGELFAR) -markup tcl/report.tcl |
| 1069 |
$(NAGELFAR) -markup tcl/subcmd.tcl |
| 1070 |
$(NAGELFAR) -markup tcl/util.tcl |
| 1071 |
endif |
| 1072 |
|
| 1073 |
testinstall: |
| 1074 |
OBJDIR=`pwd -P`; export OBJDIR; \ |
| 1075 |
TESTSUITEDIR=`cd testsuite;pwd -P`; export TESTSUITEDIR; \ |
| 1076 |
runtest --srcdir $$TESTSUITEDIR --objdir $$OBJDIR $(RUNTESTFLAGS) --tool install $(RUNTESTFILES) |
| 1077 |
|
| 1078 |
testlint: initdir modulecmd.tcl $(NAGELFAR) script/add.modules script/modulecmd |
| 1079 |
NAGELFAR=$(NAGELFAR); export NAGELFAR; \ |
| 1080 |
OBJDIR=`pwd -P`; export OBJDIR; \ |
| 1081 |
TESTSUITEDIR=`cd testsuite;pwd -P`; export TESTSUITEDIR; \ |
| 1082 |
runtest --srcdir $$TESTSUITEDIR --objdir $$OBJDIR $(RUNTESTFLAGS) --tool lint $(RUNTESTFILES) |
| 1083 |
|
| 1084 |
testcompletion: initdir $(MODULECMD) |
| 1085 |
TCLSH=$(TCLSH); export TCLSH; \ |
| 1086 |
MODULECMD=$(MODULECMD); export MODULECMD; \ |
| 1087 |
OBJDIR=`pwd -P`; export OBJDIR; \ |
| 1088 |
TESTSUITEDIR=`cd testsuite;pwd -P`; export TESTSUITEDIR; \ |
| 1089 |
runtest --srcdir $$TESTSUITEDIR --objdir $$OBJDIR $(RUNTESTFLAGS) --tool completion $(RUNTESTFILES) |
| 1090 |
|
| 1091 |
testcookbook: $(MODULECMD) |
| 1092 |
TCLSH=$(TCLSH); export TCLSH; \ |
| 1093 |
MODULECMD=$(MODULECMD); export MODULECMD; \ |
| 1094 |
OBJDIR=`pwd -P`; export OBJDIR; \ |
| 1095 |
TESTSUITEDIR=`cd testsuite;pwd -P`; export TESTSUITEDIR; \ |
| 1096 |
runtest --srcdir $$TESTSUITEDIR --objdir $$OBJDIR $(RUNTESTFLAGS) --tool cookbook $(RUNTESTFILES) |
| 1097 |
|
| 1098 |
|
| 1099 |
# install enhanced diff tool (to review test results) |
| 1100 |
icdiff: |
| 1101 |
$(CURL) $(ICDIFF_DLSRC)$@ |
| 1102 |
echo "$(ICDIFF_CHECKSUM) $@" | md5sum --status -c - || \ |
| 1103 |
md5 -c $(ICDIFF_CHECKSUM) $@ |
| 1104 |
chmod +x $@ |
| 1105 |
|
| 1106 |
# install old Tcl interpreter (for code coverage purpose) |
| 1107 |
tclsh83: |
| 1108 |
$(CURL) $(TCL_DLSRC)$(TCL_DIST83) |
| 1109 |
echo "$(TCL_DISTSUM83) $(TCL_DIST83)" | md5sum --status -c - || \ |
| 1110 |
md5 -c $(TCL_DISTSUM83) $@ || (rm -f $(TCL_DIST83) && false) |
| 1111 |
tar xzf $(TCL_DIST83) |
| 1112 |
cd $(TCL_RELEASE83)/unix && bash configure --disable-shared && make |
| 1113 |
echo '#!/bin/bash' >$@ |
| 1114 |
echo 'exec $(TCLSH83) $${@}' >>$@ |
| 1115 |
chmod +x $@ |
| 1116 |
rm $(TCL_DIST83) |
| 1117 |
|
| 1118 |
# fetch spack repository and initialize it (for source-sh test purpose) |
| 1119 |
spack: |
| 1120 |
git clone --depth 1 $(SPACK_REPOURL) |
| 1121 |
cd spack && ./bin/spack bootstrap now |
| 1122 |
|
| 1123 |
# install Conda (for source-sh test purpose) |
| 1124 |
miniconda3: |
| 1125 |
$(CURL) $(MINICONDA_DLSRC)$(MINICONDA_DIST) |
| 1126 |
echo "$(MINICONDA_DISTSUM) $(MINICONDA_DIST)" | md5sum --status -c - || \ |
| 1127 |
md5 -c $(MINICONDA_DISTSUM) $@ || (rm -f $(MINICONDA_DIST) && false) |
| 1128 |
bash $(MINICONDA_DIST) -b -s -p ./miniconda3 |
| 1129 |
rm $(MINICONDA_DIST) |
| 1130 |
|
| 1131 |
# fetch OpenFOAM repository (for source-sh test purpose) |
| 1132 |
OpenFOAM-dev: |
| 1133 |
git clone --branch 20240520 --depth 1 $(OPENFOAM_REPOURL) |
| 1134 |
|
| 1135 |
# install code coverage tool |
| 1136 |
# download from alt. source if correct tarball not retrieved from primary location |
| 1137 |
$(NAGELFAR): |
| 1138 |
$(CURL) $(NAGELFAR_DLSRC1)$(NAGELFAR_DIST) |
| 1139 |
echo "$(NAGELFAR_DISTSUM) $(NAGELFAR_DIST)" | md5sum --status -c - || \ |
| 1140 |
(rm -f $(NAGELFAR_DIST) && false) |
| 1141 |
tar xzf $(NAGELFAR_DIST) |
| 1142 |
rm $(NAGELFAR_DIST) |
| 1143 |
|
| 1144 |
# build Ctags index |
| 1145 |
tcl/tags: tcl/cache.tcl.in tcl/coll.tcl.in tcl/envmngt.tcl.in tcl/init.tcl.in \ |
| 1146 |
tcl/interp.tcl.in tcl/main.tcl.in tcl/mfcmd.tcl tcl/modeval.tcl \ |
| 1147 |
tcl/modfind.tcl.in tcl/modscan.tcl tcl/modspec.tcl tcl/report.tcl.in \ |
| 1148 |
tcl/subcmd.tcl.in tcl/util.tcl |
| 1149 |
ctags --tag-relative -f $@ --langmap=tcl:.tcl.in tcl/cache.tcl.in \ |
| 1150 |
tcl/coll.tcl.in tcl/envmngt.tcl.in tcl/init.tcl.in tcl/interp.tcl.in \ |
| 1151 |
tcl/main.tcl.in tcl/mfcmd.tcl tcl/modeval.tcl tcl/modfind.tcl.in \ |
| 1152 |
tcl/modscan.tcl tcl/modspec.tcl tcl/report.tcl.in tcl/subcmd.tcl.in \ |
| 1153 |
tcl/util.tcl |
| 1154 |
|
| 1155 |
# build Gtags target files |
| 1156 |
tcl/gtags.file: |
| 1157 |
echo cache.tcl.in > $@ |
| 1158 |
echo coll.tcl.in >> $@ |
| 1159 |
echo envmngt.tcl.in >> $@ |
| 1160 |
echo init.tcl.in >> $@ |
| 1161 |
echo interp.tcl.in >> $@ |
| 1162 |
echo main.tcl.in >> $@ |
| 1163 |
echo mfcmd.tcl >> $@ |
| 1164 |
echo modeval.tcl >> $@ |
| 1165 |
echo modscan.tcl >> $@ |
| 1166 |
echo modfind.tcl.in >> $@ |
| 1167 |
echo modspec.tcl >> $@ |
| 1168 |
echo report.tcl.in >> $@ |
| 1169 |
echo subcmd.tcl.in >> $@ |
| 1170 |
echo util.tcl >> $@ |
| 1171 |
|
| 1172 |
# build Gtags tag file |
| 1173 |
tcl/GTAGS: tcl/cache.tcl.in tcl/coll.tcl.in tcl/envmngt.tcl.in tcl/init.tcl.in \ |
| 1174 |
tcl/interp.tcl.in tcl/main.tcl.in tcl/mfcmd.tcl tcl/modeval.tcl \ |
| 1175 |
tcl/modfind.tcl.in tcl/modscan.tcl tcl/modspec.tcl tcl/report.tcl.in \ |
| 1176 |
tcl/subcmd.tcl.in tcl/util.tcl tcl/gtags.file |
| 1177 |
gtags -C tcl --gtagsconf ../.globalrc |
| 1178 |
|
| 1179 |
tcl/syntaxdb.tcl: modulecmd.tcl $(NAGELFAR) |
| 1180 |
echo "set argv {sh -V};\ |
| 1181 |
rename exit __exit;\ |
| 1182 |
proc exit {args} {};\ |
| 1183 |
source modulecmd.tcl;\ |
| 1184 |
defineModStartNbProc 1;\ |
| 1185 |
defineGetEqArrayKeyProc 1;\ |
| 1186 |
defineDoesModMatchAtDepthProc 1 1 equal;\ |
| 1187 |
defineModVersCmpProc 1 1;\ |
| 1188 |
defineModEqStaticProc 1 1 mod;\ |
| 1189 |
defineModEqProc 1 1;\ |
| 1190 |
defineParseModuleSpecificationProc 1;\ |
| 1191 |
set tcl_interactive 1;\ |
| 1192 |
source $(NAGELFAR_RELEASE)/syntaxbuild.tcl;\ |
| 1193 |
set ::syntax(lappendNoDup) {n x*};\ |
| 1194 |
set ::syntax(lrem) {n x};\ |
| 1195 |
set ::syntax(lprepend) {n x*};\ |
| 1196 |
set ::syntax(execute-modulefile) {x x n x x x? x? x?};\ |
| 1197 |
set ::syntax(scanExtraMatchSearch) {x x n};\ |
| 1198 |
set ::syntax(insertProvidedAliases) {x n};\ |
| 1199 |
set ::syntax(filterExtraMatchSearch) {x x n n};\ |
| 1200 |
set ::syntax(findModulesFromDirsAndFiles) {x x x x n n? n? n? n?};\ |
| 1201 |
set ::syntax(getArrayKey) {n x x};\ |
| 1202 |
set ::syntax(getDiffBetweenArray) {n n x? x?};\ |
| 1203 |
buildFile $@;" | $(TCLSH) |
| 1204 |
|
| 1205 |
|
| 1206 |
# quiet build targets unless verbose mode set |
| 1207 |
ifeq ($(VERBOSE),1) |
| 1208 |
V = 1 |
| 1209 |
endif |
| 1210 |
# let verbose by default the install/clean/test and other specific non-build targets |
| 1211 |
$(V).SILENT: initdir pkgdoc doc version.inc share/rpm/environment-modules.spec \ |
| 1212 |
modulecmd.tcl tcl/cache.tcl tcl/coll.tcl tcl/envmngt.tcl tcl/init.tcl \ |
| 1213 |
tcl/interp.tcl tcl/main.tcl tcl/modfind.tcl tcl/report.tcl tcl/subcmd.tcl \ |
| 1214 |
tcl/cache.tcl_i tcl/coll.tcl_i tcl/envmngt.tcl_i tcl/init.tcl_i tcl/interp.tcl_i \ |
| 1215 |
tcl/main.tcl_i tcl/mfcmd.tcl_i tcl/modfind.tcl_i tcl/modeval.tcl_i \ |
| 1216 |
tcl/modscan.tcl_i tcl/modspec.tcl_i tcl/report.tcl_i tcl/subcmd.tcl_i \ |
| 1217 |
tcl/util.tcl_i ChangeLog ChangeLog.gz README GEMINI.md \ |
| 1218 |
script/add.modules script/gitlog2changelog.py script/modulecmd \ |
| 1219 |
lib/libtclenvmodules$(SHLIB_SUFFIX) lib/libtestutil-closedir$(SHLIB_SUFFIX) \ |
| 1220 |
lib/libtestutil-getpwuid$(SHLIB_SUFFIX) lib/libtestutil-getgroups$(SHLIB_SUFFIX) \ |
| 1221 |
lib/libtestutil-0getgroups$(SHLIB_SUFFIX) lib/libtestutil-mktime$(SHLIB_SUFFIX) \ |
| 1222 |
lib/libtestutil-dupgetgroups$(SHLIB_SUFFIX) lib/libtestutil-time$(SHLIB_SUFFIX) \ |
| 1223 |
lib/libtestutil-tcl_loadfile$(SHLIB_SUFFIX) \ |
| 1224 |
testsuite/example/.modulespath testsuite/example/modulespath-wild \ |
| 1225 |
testsuite/example/modulerc testsuite/example/initrc-1 testsuite/example/initrc \ |
| 1226 |
dist-tar dist-gzip dist-bzip2 dist-win $(MODULECMDTEST) $(MODULECMDTEST)_i |