-
Notifications
You must be signed in to change notification settings - Fork 128
/
Makefile.in
648 lines (577 loc) · 34.6 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
srcdir := @srcdir@
prefix := @prefix@
SYS_LUA_PATH := @SYS_LUA_PATH@
SYS_LUA_CPATH := @SYS_LUA_CPATH@
package := lmod
ifeq ($(PATH_TO_SRC),@$(path_to_src)@)
PATH_TO_SRC := .
endif
PATH_TO_LUA := @PATH_TO_LUA@
version := $(shell LUA_PATH="$(srcdir)/src/?.lua;$(SYS_LUA_PATH)" $(PATH_TO_LUA) -e "V=require('Version'); print(V.tag())")
SITE_CONTROLLED_PREFIX := @SITE_CONTROLLED_PREFIX@
LMOD_ROOT := $(prefix)/$(package)
MY_PACKAGE := $(prefix)/$(package)/$(version)
MY_PKG_PACKAGE := $(prefix)/$(package)/$(package)
LMOD_CONFIG_DIR := @LMOD_CONFIG_DIR@
ifneq ($(SITE_CONTROLLED_PREFIX),no)
LMOD_ROOT := $(prefix)/..
MY_PACKAGE := $(prefix)
MY_PKG_PACKAGE := $(prefix)
endif
CC := @CC@
PATH_TO_SRC := @PATH_TO_SRC@
path_to_src := PATH_TO_SRC
TOOL_SRC := $(wildcard $(srcdir)/tools/*.lua)
I18N_SRC := $(wildcard $(srcdir)/tools/i18n/*.lua)
CONF_PY := $(srcdir)/docs/source/conf.py
CONF_PY_PATTERN := $(srcdir)/proj_mgmt/conf_py_update_patternA.lua
CURRENT_MK := $(lastword $(MAKEFILE_LIST))
export IGNORE_DIRS := $(shell $(PATH_TO_LUA) $(srcdir)/proj_mgmt/ignore_dirs_converter @IGNORE_DIRS@)
REDIRECT := @REDIRECT@
LMOD_SETTARG_FULL_SUPPORT := $(shell echo "@SETTARG@" | tr '[:upper:]' '[:lower:]')
USE_DOT_FILES := $(shell echo "@USE_DOT_FILES@" | tr '[:upper:]' '[:lower:]')
PREPEND_BLOCK := $(shell echo "@PREPEND_BLOCK@" | tr '[:upper:]' '[:lower:]')
COLORIZE := $(shell echo "@COLORIZE@" | tr '[:upper:]' '[:lower:]')
SETTARG_CMD := settarg_cmd
MODULEPATH_INIT := @MODULEPATH_INIT@
LMOD_TERSE_DECORATIONS := @TERSE_DECORATIONS@
LMOD_AVAIL_EXTENSIONS := @AVAIL_EXTENSIONS@
LMOD_HIDDEN_ITALIC := @HIDDEN_ITALIC@
LMOD_OVERRIDE_LANG := @LMOD_OVERRIDE_LANG@
LMOD_ALLOW_ROOT_USE := @LMOD_ALLOW_ROOT_USE@
LMOD_USE_DOT_CONFIG_ONLY := @USE_DOT_CONFIG_DIR_ONLY@
SITE_MSG_FILE := @SITE_MSG_FILE@
SITE_NAME := @SITE_NAME@
SUPPORT_KSH := @SUPPORT_KSH@
SYSHOST := @SYSHOST@
DYNAMIC_SPIDER_CACHE := @DYNAMIC_SPIDER_CACHE@
SILENCE_SHELL_DEBUGGING := @SILENCE_SHELL_DEBUGGING@
SYS_LD_LIB_PATH := @SYS_LD_LIB_PATH@
SYS_LD_PRELOAD := @SYS_LD_PRELOAD@
CASE_INDEPENDENT_SORTING := @CASE_INDEPENDENT_SORTING@
ZSH_SITE_FUNCTIONS_DIRS := @ZSH_SITE_FUNCTIONS_DIRS@
SPIDER_CACHE_DESCRIPT_FN := @SPIDER_CACHE_DESCRIPT_FN@
ANCIENT := @ANCIENT@
ALLOW_TCL_MFILES := @ALLOW_TCL_MFILES@
MPATH_AVAIL := @MPATH_AVAIL@
EXTENDED_DEFAULT := @EXTENDED_DEFAULT@
TMOD_PATH_RULE := @TMOD_PATH_RULE@
TMOD_FIND_FIRST := @TMOD_FIND_FIRST@
CACHED_LOADS := @CACHED_LOADS@
EXACT_MATCH := @EXACT_MATCH@
DUPLICATE_PATHS := @DUPLICATE_PATHS@
DISABLE_NAME_AUTOSWAP := @DISABLE_NAME_AUTOSWAP@
SHORT_TIME := @SHORT_TIME@
PIN_VERSIONS := @PIN_VERSIONS@
AUTO_SWAP := @AUTO_SWAP@
SPIDER_CACHE_DIRS := @SPIDER_CACHE_DIRS@
LEGACY_ORDERING := @LEGACY_ORDERING@
EXPORT_MODULE := @EXPORT_MODULE@
LMOD_DOWNSTREAM_CONFLICTS := @LMOD_DOWNSTREAM_CONFLICTS@
MODULES_AUTO_HANDLING := @MODULES_AUTO_HANDLING@
BASENAME := @BASENAME@
UPDATE_VERSION := LUA_PATH="$(srcdir)/tools/?.lua;$(SYS_LUA_PATH)" $(PATH_TO_LUA) $(srcdir)/proj_mgmt/updateVersion
BUILD_V_src := LUA_PATH="$(srcdir)/tools/?.lua;$(SYS_LUA_PATH)" LUA_CPATH="$(SYS_LUA_CPATH)" $(PATH_TO_LUA) $(srcdir)/proj_mgmt/buildVersion_src
PS := @PS@
READLINK := @READLINK@
EXPR := @EXPR@
MODULES_AUTO_HANDLING := @MODULES_AUTO_HANDLING@
PATH_TO_POD2MAN := @PATH_TO_POD2MAN@
PATH_TO_HASHSUM := @PATH_TO_HASHSUM@
PATH_TO_LUAC := @PATH_TO_LUAC@
PATH_TO_PAGER := @PATH_TO_PAGER@
PATH_TO_TCLSH := @PATH_TO_TCLSH@
PATH_TO_LS := @PATH_TO_LS@
MODULEPATH_ROOT := @MODULEPATH_ROOT@
VDateFn := $(srcdir)/.versionDate
VERSION_SRC := $(srcdir)/src/Version.lua
SETTARG_VSRC := $(srcdir)/settarg/Version.lua
LUA_INCLUDE := @LUA_INCLUDE@
UPDATE_SYSTEM_FN := @UPDATE_SYSTEM_FN@
GIT_PROG := @PATH_TO_GIT@
PKG := $(MY_PKG_PACKAGE)
PKGV := $(MY_PACKAGE)
LIB := $(MY_PACKAGE)/lib
LIBEXEC := $(MY_PACKAGE)/libexec
SHELLS := $(MY_PACKAGE)/shells
TOOLS := $(MY_PACKAGE)/tools
I18N := $(MY_PACKAGE)/tools/i18n
SETTARG := $(MY_PACKAGE)/settarg
INIT := $(MY_PACKAGE)/init
INIT_KSH_FUNCS := $(MY_PACKAGE)/init/ksh_funcs
FISH_TAB := $(MY_PACKAGE)/init/fish_tab_completion
MESSAGEDIR := $(MY_PACKAGE)/messageDir
LMOD_MF := $(MY_PACKAGE)/modulefiles/Core
MAN_PAGES_CAT := $(MY_PACKAGE)/share/man/cat1
MAN_PAGES := $(MY_PACKAGE)/share/man/man1
LMOD_MF_SOURCE := $(patsubst %, $(srcdir)/%, MF/*.version.lua)
SETTARG_SOURCE := $(patsubst %, $(srcdir)/%, settarg/*.lua settarg/targ.in)
DATE_cmd := $(srcdir)/proj_mgmt/DATE_cmd.sh
UNAME_S := $(shell uname -s)
VersionDate := $(shell cat $(VDateFn))
MODE := @MODE@
ifeq ($(UNAME_S),Darwin)
SED := gsed
else
SED := sed
endif
MODE_X := $(shell $(srcdir)/proj_mgmt/convert_mode.sh -x $(MODE))
MODE_R := $(shell $(srcdir)/proj_mgmt/convert_mode.sh -r $(MODE))
ifeq ($(LUA_INCLUDE),no)
LUA_INCLUDE :=
else
LUA_INCLUDE := -I$(LUA_INCLUDE)
endif
ifeq ($(GIT_VERSION),)
GIT_VERSION := $(shell if [ -n "$(GIT_PROG)" -a -e $(srcdir)/.git ]; then lmodV=`git describe --always;`; echo "$$lmodV"; else echo "$(version)"; fi)
endif
ifeq ($(GIT_BRANCH),)
GIT_BRANCH := $(shell if [ -n "$(GIT_PROG)" -a -e $(srcdir)/.git ]; then lmodBR=`git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/';`; echo "$$lmodBR"; else echo "main"; fi)
endif
DIRLIST := $(DESTDIR)$(LIBEXEC) $(DESTDIR)$(TOOLS) $(DESTDIR)$(SETTARG) \
$(DESTDIR)$(SHELLS) $(DESTDIR)$(INIT) $(DESTDIR)$(LIB) \
$(DESTDIR)$(LMOD_MF) $(DESTDIR)$(MESSAGEDIR) $(DESTDIR)$(I18N) \
$(DESTDIR)$(FISH_TAB) $(DESTDIR)$(MAN_PAGES) $(DESTDIR)$(MAN_PAGES_CAT) \
$(DESTDIR)$(INIT_KSH_FUNCS)
STANDALONE_PRGM := src/lmod.in.lua src/addto.in.lua \
src/spider.in.lua src/clearLMOD_cmd.in.lua \
src/ml_cmd.in.lua \
src/spiderCacheSupport.in.lua \
src/sh_to_modulefile.in.lua \
src/update_lmod_system_cache_files.in \
src/check_module_tree_syntax.in.lua \
sh_src/print_os.sh.in
STANDALONE_PRGM := $(patsubst %, $(srcdir)/%, $(STANDALONE_PRGM))
SHELL_INIT := bash.in cmake csh.in ksh.in tcsh.in zsh.in sh.in perl R \
env_modules_python.py.in lmod_bash_completions fish.in \
lisp env_modules_ruby.rb.in rc.in
SHELL_INIT := $(patsubst %, $(srcdir)/init/%, $(SHELL_INIT))
LMODRC_INIT := $(patsubst %, $(srcdir)/init/%, lmodrc.lua)
ZSH_FUNCS := _ml _module
ZSH_FUNCS := $(patsubst %, $(srcdir)/init/zsh/%, $(ZSH_FUNCS))
FISH_FUNCS := module.fish
FISH_FUNCS := $(patsubst %, $(srcdir)/init/fish/%, $(FISH_FUNCS))
KSH_FUNCS := clearLmod clearMT ml module settarg
KSH_FUNCS := $(patsubst %, $(srcdir)/init/ksh_funcs/%, $(KSH_FUNCS))
STARTUP := profile.in profile.fish.in profile.rc.in cshrc.in
STARTUP := $(patsubst %, $(srcdir)/init/%, $(STARTUP))
MSGFNs := $(wildcard $(srcdir)/messageDir/*.lua)
MAIN_DIR := Makefile.in INSTALL configure README_lua_modulefiles.txt \
README README.old License
CONTRIB_DIRS := \
BuildSystemCacheFile \
Deprecating_Modules \
SitePackage \
TACC \
bash_patch \
converting_shell_to_module_files \
hook \
parseVersions \
settarg \
tracking_module_usage \
tricky_modulefiles
CONTRIB := $(patsubst %, $(srcdir)/contrib/%, $(CONTRIB_DIRS))
lua_code := $(filter-out %.in.lua, $(wildcard $(srcdir)/src/*.lua))
lua_code := $(filter-out $(srcdir)/src/Version.lua, $(lua_code)) $(wildcard $(srcdir)/src/*.tcl)
CurDATE := $(shell $(DATE_cmd) +'%F %H:%M %:z')
ComputeHashSum := $(srcdir)/src/computeHashSum.in.lua
spiderCacheSupportCMD := $(PATH_TO_LUA) $(DESTDIR)$(LIBEXEC)/spiderCacheSupport
export L_PATH = $(LUA_PATH)
export L_CPATH = $(LUA_CPATH)
HAVE_LUA_TERM := @HAVE_LUA_TERM@
ifneq ($(HAVE_LUA_TERM),yes)
PKGS := pkgs
endif
HAVE_LUAFILESYSTEM := @HAVE_LUAFILESYSTEM@
ifneq ($(HAVE_LUAFILESYSTEM),yes)
PKGS := $(PKGS) lfs
PKG_LFS := lfs
endif
FAST_TCL_INTERP := @FAST_TCL_INTERP@
TCL_INCLUDE := @TCL_INCLUDE@
TCL_LIBS := @TCL_LIBS@
ifeq ($(FAST_TCL_INTERP),yes)
PKGS := $(PKGS) tcl2lua
PKG_T2L := tcl2lua
endif
.PHONY: test pkgs man_pages
all:
@echo done
uninstall:
$(RM) -rf $(DESTDIR)$(MY_PKG_PACKAGE)
@echo "If you added lmod files to /etc/profile.d please remove them."
pre-install: $(DIRLIST) lmod_install_targets
lmod_install_targets: $(PKGS) lmodrc_init shell_init startup libexec VersionSrc \
Inst_Tools Inst_Shells Inst_Settarg Inst_Lmod_MF other_tools \
man_pages messageFns i18n spiderCacheSupport ksh_funcs \
STVersionSrc
install: pre-install zsh_tab_funcs fish_tab_funcs
$(MAKE) PKGV=$(PKG) shell_init startup
@if test "$(SITE_CONTROLLED_PREFIX)" = "no" ; then \
echo $(RM) $(DESTDIR)$(PKG); \
$(RM) $(DESTDIR)$(PKG); \
echo ln -s $(version) $(DESTDIR)$(PKG); \
ln -s $(version) $(DESTDIR)$(PKG); \
else \
echo '**************************************************************'; \
echo ''; \
echo 'Warning: remember to update the Lmod scripts in /etc/profile.d'; \
echo ''; \
echo '**************************************************************'; \
fi;
echo:
@echo Version: $(version)
@echo GIT_VERSION: $(GIT_VERSION)
@echo GIT_BRANCH: $(GIT_BRANCH)
man_pages: $(DESTDIR)$(MAN_PAGES) $(DESTDIR)$(MAN_PAGES_CAT)
ifeq ($(PATH_TO_POD2MAN), UNKNOWN_POD2MAN)
LUA_CPATH='$(MY_PACKAGE)/lib/?.so;$(SYS_LUA_CPATH);;' \
LUA_PATH='$(MY_PACKAGE)/libexec/?.lua;$(SYS_LUA_PATH);;' \
$(PATH_TO_LUA) $(srcdir)/src/lmod.in.lua bash --help 2> $(DESTDIR)$(MAN_PAGES_CAT)/module.1
chmod $(MODE_R) $(DESTDIR)$(MAN_PAGES_CAT)/module.1
else
LUA_CPATH='$(MY_PACKAGE)/lib/?.so;$(SYS_LUA_CPATH);;' \
LUA_PATH='$(MY_PACKAGE)/libexec/?.lua;$(SYS_LUA_PATH);;' \
$(PATH_TO_LUA) $(srcdir)/src/lmod.in.lua bash --pod 2> $(DESTDIR)$(MAN_PAGES)/module.pod
$(PATH_TO_POD2MAN) $(DESTDIR)$(MAN_PAGES)/module.pod > $(DESTDIR)$(MAN_PAGES)/module.1
$(RM) $(DESTDIR)$(MAN_PAGES)/module.pod
chmod $(MODE_R) $(DESTDIR)$(MAN_PAGES)/module.1
endif
$(DIRLIST) :
install -m $(MODE_X) -d $@
__installMe:
-for i in $(FILELIST); do \
bareN=$${i##*/}; \
fn=$${bareN%%.in*}; \
ext=$${bareN#*.}; \
: echo "DIRLOC/fn: $(DIRLOC)/$$fn"; \
$(SED) -e 's|@PREFIX@|$(prefix)|g' \
-e 's|@LMOD_TOP_DIR@|$(MY_PACKAGE)|g' \
-e 's|@path_to_lua@|$(PATH_TO_LUA)|g' \
-e 's|@hashsum@|$(PATH_TO_HASHSUM)|g' \
-e 's|@pager@|$(PATH_TO_PAGER)|g' \
-e 's|@case_independent_sorting@|$(CASE_INDEPENDENT_SORTING)|g' \
-e 's|@lmod_settarg_full_support@|$(LMOD_SETTARG_FULL_SUPPORT)|g' \
-e 's|@use_dot_files@|$(USE_DOT_FILES)|g' \
-e 's|@lang@|$(LMOD_OVERRIDE_LANG)|g' \
-e 's|@site_msg_file@|$(SITE_MSG_FILE)|g' \
-e 's|@git@|$(GIT_VERSION)|g' \
-e 's|--@ignore_dirs@--|$(IGNORE_DIRS)|g' \
-e 's|@sys_lua_path@|$(SYS_LUA_PATH)|g' \
-e 's|@hidden_italic@|$(LMOD_HIDDEN_ITALIC)|g' \
-e 's|@modulepath_init@|$(MODULEPATH_INIT)|g' \
-e 's|@sys_lua_cpath@|$(SYS_LUA_CPATH)|g' \
-e 's|@modules_auto_handling@|$(MODULES_AUTO_HANDLING)|g' \
-e 's|@path_to_luac@|$(PATH_TO_LUAC)|g' \
-e 's|@path_to_lmod@|$(LIBEXEC)/lmod|g' \
-e 's|@have_lua_term@|$(HAVE_LUA_TERM)|g' \
-e 's|@silence_shell_debugging@|$(SILENCE_SHELL_DEBUGGING)|g' \
-e 's|@dynamic_spider_cache@|$(DYNAMIC_SPIDER_CACHE)|g' \
-e 's|@fast_tcl_interp@|$(FAST_TCL_INTERP)|g' \
-e 's|@terse_decorations@|$(LMOD_TERSE_DECORATIONS)|g' \
-e 's|@settarg_cmd@|$(SETTARG_CMD)|g' \
-e 's|@lmod_config_dir@|$(LMOD_CONFIG_DIR)|g' \
-e 's|@lmod_downstream_conflicts@|$(LMOD_DOWNSTREAM_CONFLICTS)|g' \
-e 's|@modules_auto_handling@|$(MODULES_AUTO_HANDLING)|g' \
-e "s|@my_shell@|$$fn|g" \
-e 's|@tclsh@|$(PATH_TO_TCLSH)|g' \
-e 's|@ls@|$(PATH_TO_LS)|g' \
-e 's|@disable_name_autoswap@|$(DISABLE_NAME_AUTOSWAP)|g' \
-e 's|@tmod_path_rule@|$(TMOD_PATH_RULE)|g' \
-e 's|@tmod_find_first@|$(TMOD_FIND_FIRST)|g' \
-e 's|@redirect@|$(REDIRECT)|g' \
-e 's|@basename@|$(BASENAME)|g' \
-e 's|@support_ksh@|$(SUPPORT_KSH)|g' \
-e 's|@cached_loads@|$(CACHED_LOADS)|g' \
-e 's|@avail_extensions@|$(LMOD_AVAIL_EXTENSIONS)|g' \
-e 's|@ps@|$(PS)|g' \
-e 's|@readlink@|$(READLINK)|g' \
-e 's|@site_name@|$(SITE_NAME)|g' \
-e 's|@site_controlled_prefix@|$(SITE_CONTROLLED_PREFIX)|g' \
-e 's|@syshost@|$(SYSHOST)|g' \
-e 's|@expr@|$(EXPR)|g' \
-e 's|@extended_default@|$(EXTENDED_DEFAULT)|g' \
-e 's|@libexec@|$(LIBEXEC)|g' \
-e 's|@legacy_ordering@|$(LEGACY_ORDERING)|g' \
-e 's|@pin_versions@|$(PIN_VERSIONS)|g' \
-e 's|@auto_swap@|$(AUTO_SWAP)|g' \
-e 's|@sys_ld_lib_path@|$(SYS_LD_LIB_PATH)|g' \
-e 's|@sys_ld_preload@|$(SYS_LD_PRELOAD)|g' \
-e 's|@export_module@|$(EXPORT_MODULE)|g' \
-e 's|@lmod_version@|$(version)|g' \
-e 's|@exact_match@|$(EXACT_MATCH)|g' \
-e 's|@ancient@|$(ANCIENT)|g' \
-e 's|@prepend_block@|$(PREPEND_BLOCK)|g' \
-e 's|@colorize@|$(COLORIZE)|g' \
-e 's|@duplicate_paths@|$(DUPLICATE_PATHS)|g' \
-e 's|@allow_tcl_mfiles@|$(ALLOW_TCL_MFILES)|g' \
-e 's|@mpath_avail@|$(MPATH_AVAIL)|g' \
-e 's|@short_time@|$(SHORT_TIME)|g' \
-e 's|@cacheDirs@|$(SPIDER_CACHE_DIRS)|g' \
-e 's|@updateSystemFn@|$(UPDATE_SYSTEM_FN)|g' \
-e 's|@modulepath_root@|$(MODULEPATH_ROOT)|g' \
-e 's|@lmod_root@|$(LMOD_ROOT)|g' \
-e 's|@lmod_allow_root_use@|$(LMOD_ALLOW_ROOT_USE)|g' \
-e 's|@lmod_use_dot_config_only@|$(LMOD_USE_DOT_CONFIG_ONLY)|g' \
-e 's|@PKGV@|$(PKGV)|g' \
-e 's|@PKG@|$(PKG)|g' < $$i > $(DIRLOC)/$$fn; \
chmod $(MODE_R) $(DIRLOC)/$$fn; \
[ "$$ext" = "in.lua" -o "$$ext" = "tcl" -o "$$ext" = "in" \
-o "$$ext" = "sh.in" ] && \
chmod $(MODE_X) $(DIRLOC)/$$fn; \
if [ "$$ext" = "version.lua" ]; then \
mname=$${bareN%%.*}; \
: echo "DIRLOC: $(DIRLOC)/$$mname"; \
mv $(DIRLOC)/$$fn $(DIRLOC)/$$mname.lua; \
chmod $(MODE_R) $(DIRLOC)/$$mname.lua; \
fi; \
done
generate_doc:
ldoc .
shell_init: $(SHELL_INIT)
$(MAKE) FILELIST="$^" DIRLOC=$(DESTDIR)$(INIT) GIT_VERSION=$(GIT_VERSION) __installMe
lmodrc_init: $(LMODRC_INIT)
$(MAKE) FILELIST="$^" DIRLOC=$(DESTDIR)$(INIT) GIT_VERSION=$(GIT_VERSION) __installMe
messageFns: $(MSGFNs)
$(MAKE) FILELIST="$^" DIRLOC=$(DESTDIR)$(MESSAGEDIR) GIT_VERSION=$(GIT_VERSION) __installMe
i18n: $(I18N_SRC)
$(MAKE) FILELIST="$^" DIRLOC=$(DESTDIR)$(I18N) GIT_VERSION=$(GIT_VERSION) __installMe
startup: $(STARTUP)
$(MAKE) FILELIST="$^" DIRLOC=$(DESTDIR)$(INIT) GIT_VERSION=$(GIT_VERSION) __installMe
other_tools: $(ComputeHashSum) $(STANDALONE_PRGM)
$(MAKE) FILELIST="$^" DIRLOC=$(DESTDIR)$(LIBEXEC) GIT_VERSION=$(GIT_VERSION) __installMe
spiderCacheSupport: $(PKG_LFS) $(PKG_T2L) Inst_Tools libexec
$(spiderCacheSupportCMD) --cacheDirs "$(SPIDER_CACHE_DIRS)" \
--updateFn "$(UPDATE_SYSTEM_FN)" \
--descriptFn "$(SPIDER_CACHE_DESCRIPT_FN)" \
>> $(DESTDIR)$(INIT)/lmodrc.lua;
chmod $(MODE_R) $(DESTDIR)$(INIT)/lmodrc.lua;
src/computeHashSum: $(ComputeHashSum)
$(MAKE) FILELIST="$^" DIRLOC="$(prefix)/src" GIT_VERSION=$(GIT_VERSION) __installMe
chmod $(MODE_X) $@
tcl2lua:
if [ -d $(srcdir)/pkgs/tcl2lua ]; then \
$(MAKE) -C $(srcdir)/pkgs/tcl2lua LUA_INC=$(LUA_INCLUDE) \
TCL_INCLUDE=$(TCL_INCLUDE) TCL_LIBS=$(TCL_LIBS) \
LIB=$(DESTDIR)$(LIB) LIBS=@LIBS@ CC="$(CC)" \
SHARE=$(DESTDIR)$(LIBEXEC) MODE_R=$(MODE_R) \
install; \
fi
lfs:
if [ -d $(srcdir)/pkgs/luafilesystem ]; then \
$(MAKE) -C $(srcdir)/pkgs/luafilesystem LUA_INC=$(LUA_INCLUDE) \
LIB=$(DESTDIR)$(LIB) SHARE=$(DESTDIR)$(LIBEXEC) CC="$(CC)" \
MODE_R=$(MODE_R) \
install; \
fi
pkgs:
if [ -d $(srcdir)/pkgs ]; then \
$(MAKE) -C $(srcdir)/pkgs LUA_INC=$(LUA_INCLUDE) \
LIB=$(DESTDIR)$(LIB) SHARE=$(DESTDIR)$(LIBEXEC) CC="$(CC)" \
MODE_R=$(MODE_R) \
install; \
fi
zsh_tab_funcs: $(ZSH_FUNCS) $(KSH_FUNCS)
-if [ -n "$(ZSH_SITE_FUNCTIONS_DIRS)" ]; then \
for zdir in `echo "$(ZSH_SITE_FUNCTIONS_DIRS)" | tr ':' ' '`; do \
for i in $^; do \
bareN=$${i##*/}; \
fn=$${bareN%%.in*}; \
ext=$${bareN#*.}; \
cp $$i $(DESTDIR)$$zdir/$$fn 2> /dev/null; \
chmod $(MODE_R) $(DESTDIR)$$zdir/$$fn 2> /dev/null; \
[ "$$ext" = "in" ] && chmod $(MODE_X) $(DESTDIR)$$zdir/$$fn; \
done; \
done; \
true; \
fi
ksh_funcs: $(KSH_FUNCS)
$(MAKE) FILELIST="$^" DIRLOC=$(DESTDIR)$(INIT_KSH_FUNCS) GIT_VERSION=$(GIT_VERSION) __installMe
fish_tab_funcs: $(FISH_FUNCS)
install -m $(MODE_R) $^ $(DESTDIR)$(FISH_TAB) 2>/dev/null
makefile: $(srcdir)/Makefile.in ./config.status
./config.status $@
config.status:
./config.status --recheck
trailing_blanks_removed:
find . -type d \( -path ./rt -o -path ./spec/Spider/h \) -prune -o -name '*.lua' -exec $(SED) -i -e 's/ *$$//' {} \;
dist:
GIT_BRANCH=`git status | head -n 1 | sed -e 's/^[# ]*On branch //g' -e 's/^[# ]*HEAD detached at//g'`; \
if [ "$$GIT_BRANCH" = "Not currently on any branch." ]; then GIT_BRANCH=main; fi; \
echo "GIT_BRANCH: $$GIT_BRANCH" ; \
git archive --prefix=Lmod-$(version)/ $$GIT_BRANCH > Lmod-$(version).tar ; \
echo "ls -l Lmod-$(version).tar" ; \
ls -l Lmod-$(version).tar ; \
$(RM) -rf DIST ; \
mkdir DIST ; \
cd DIST ; \
tar xf ../Lmod-$(version).tar ; \
$(RM) ../Lmod-$(version).tar ; \
echo "Lmod"-$(version) > .fname ; \
sed -i.bk 's/\@git\@/$(GIT_VERSION)/g' `cat .fname`/src/Version.lua ; \
rm `cat .fname`/src/Version.lua.bk ; \
tar chf `cat .fname`.tar `cat .fname` ; \
bzip2 `cat .fname`.tar ; \
mv `cat .fname`.tar.bz2 .. ; \
cd ..; $(RM) -rf DIST
ml_dist:
$(MAKE) DistD=DIST _ml_dist
_ml_dist: _distMkDir
cp src/ml_cmd.in.lua ML_README.txt $(DistD)
echo "ml"-$(version) > .fname; \
$(RM) -r `cat .fname` `cat .fname`.tar*; \
mv ${DistD} `cat .fname`; \
tar chf `cat .fname`.tar `cat .fname`; \
bzip2 `cat .fname`.tar; \
rm -rf `cat .fname` .fname;
test:
cd rt; unset TMFuncPATH; tm .
tags: build_tags
$(RM) file_list.*
build_tags:
find . \( -regex '.*~$$\|.*/\.git\|.*/\.git/' -prune \) \
-o -type f > file_list.1.txt
sed -e 's|.*/.git.*||g' \
-e 's|.*/embed/.*||g' \
-e 's|.*/rt/.*/t1/.*||g' \
-e 's|./rt/funny_files/mf/.*||g' \
-e 's|.*/html/.*$$||g' \
-e 's|./TAGS$$||g' \
-e 's|./TAGS.world$$||g' \
-e 's|./makefile||g' \
-e 's|./configure$$||g' \
-e 's|.*\.DS_Store$$||g' \
-e 's|.*\.tgz$$||g' \
-e 's|.*\.tar\.gz$$||g' \
-e 's|.*\.tar\.bz2$$||g' \
-e 's|.*\.csv$$||g' \
-e 's|.*\.aux$$||g' \
-e 's|.*\.fdb_latexmk$$||g' \
-e 's|.*\.fls$$||g' \
-e 's|.*\.nav$$||g' \
-e 's|.*\.out$$||g' \
-e 's|.*\.new.lua$$||g' \
-e 's|.*\.pdf$$||g' \
-e 's|.*\.pyc$$||g' \
-e 's|.*db\.conf$$||g' \
-e 's|.*\.o$$||g' \
-e 's|.*\.so\.$$||g' \
-e 's|.*\.so$$||g' \
-e 's|.*\.pyo$$||g' \
-e 's|.*\.snm$$||g' \
-e 's|.*\.toc$$||g' \
-e 's|.*\.sty$$||g' \
-e 's|.*\.vrb$$||g' \
-e 's|.*\.key$$||g' \
-e 's|^#.*||g' \
-e 's|.*/#.*||g' \
-e 's|\.#.*||g' \
-e 's|.*/\.#.*||g' \
-e 's|.*\.pdf$$||g' \
-e 's|.*\.used$$||g' \
-e 's|./.*\.log$$||g' \
-e 's|./testreports/.*||g' \
-e 's|./docs/build/.*||g' \
-e 's|./config\.status$$||g' \
-e 's|.*\~$$||g' \
-e 's|./lmod.check.txt*||g' \
-e 's|./file_list\..*||g' \
-e '/^\s*$$/d' \
< file_list.1.txt > file_list.2.txt
etags -o TAGS.world `cat file_list.2.txt`
sed -e 's|.*/rt/.*||g' \
-e 's|.*/contrib/.*||g' \
-e 's|.*/cookbook/.*||g' \
-e 's|.*/docs/.*||g' \
-e 's|.*/my_docs/.*||g' \
-e 's|.*/spec/.*/mf/.*||g' \
-e 's|.*/spec/.*/mf2/.*||g' \
-e 's|.*/spec/.*/nv/.*||g' \
-e 's|.*/spec/.*/nv2/.*||g' \
-e '/^\s*$$/d' \
< file_list.2.txt > file_list.3.txt
etags `cat file_list.3.txt`
busted:
ifeq ($(TAG),)
@PROJDIR=$(CURDIR) LMOD_FAST_TCL_INTERP=no busted --verbose -m "$(CURDIR)/src/?.lua;$(CURDIR)/tools/?.lua;$(CURDIR)/tools/?/init.lua"
else
@PROJDIR=$(CURDIR) LMOD_FAST_TCL_INTERP=no busted -t $(TAG) --verbose -m "$(CURDIR)/src/?.lua;$(CURDIR)/tools/?.lua;$(CURDIR)/tools/?/init.lua"
endif
luachk:
luacheck --exclude-files src/*.new.lua -- src shells tools settarg spec 2>&1 | tee lmod.check.txt; \
if [ "$$?" -eq 0 ]; then rm lmod.check.txt; fi
libexec: $(lua_code)
$(MAKE) FILELIST="$^" DIRLOC=$(DESTDIR)$(LIBEXEC) GIT_VERSION=$(GIT_VERSION) __installMe
VersionSrc:
$(BUILD_V_src) "$(GIT_BRANCH)" "$(version)" "$(GIT_VERSION)" "$(VersionDate)" "$(CurDATE)" > $(DESTDIR)$(LIBEXEC)/Version.lua
STVersionSrc: Inst_Settarg
$(BUILD_V_src) "$(GIT_BRANCH)" "$(version)" "$(GIT_VERSION)" "$(VersionDate)" "$(CurDATE)" > $(DESTDIR)$(SETTARG)/Version.lua
Inst_Tools: $(TOOL_SRC)
$(MAKE) FILELIST="$^" DIRLOC=$(DESTDIR)$(TOOLS) GIT_VERSION=$(GIT_VERSION) __installMe
Inst_Shells: $(srcdir)/shells/*.lua
$(MAKE) FILELIST="$^" DIRLOC=$(DESTDIR)$(SHELLS) GIT_VERSION=$(GIT_VERSION) __installMe
Inst_Settarg: $(SETTARG_SOURCE)
$(MAKE) FILELIST="$^" DIRLOC=$(DESTDIR)$(SETTARG) GIT_VERSION=$(GIT_VERSION) __installMe
Inst_Lmod_MF: $(LMOD_MF_SOURCE)
$(MAKE) FILELIST="$^" DIRLOC=$(DESTDIR)$(LMOD_MF) GIT_VERSION=$(GIT_VERSION) __installMe
clean:
$(RM) config.log *.o
cd $(srcdir)/pkgs; $(MAKE) LIB=$(DESTDIR)$(LIB) SHARE=$(DESTDIR)$(LIBEXEC) clean
cd $(srcdir)/pkgs/luafilesystem; $(MAKE) LIB=$(DESTDIR)$(LIB) clean
cd $(srcdir)/pkgs/tcl2lua; $(MAKE) LIB=$(DESTDIR)$(LIB) clean
clobber: clean
distclean: clobber
$(RM) makefile config.status
world_update:
@git status -s > /tmp/git_st_$$$$; \
if [ -s /tmp/git_st_$$$$ ]; then \
echo "All files not checked in => try again"; \
elif [ $(srcdir)/configure -ot $(srcdir)/configure.ac ]; then \
echo "configure is out of date => try again"; \
else \
branchName=`git status | head -n 1 | sed 's/^[# ]*On branch //g'`; \
git push github $$branchName; \
git push --tags github $$branchName; \
pid=$$$$; \
echo '{' > /tmp/json_$$pid; \
echo " \"tag_name\": \"$(version)\"," >> /tmp/json_$$pid; \
echo " \"target_commitish\": \"$$branchName\"," >> /tmp/json_$$pid; \
echo " \"name\": \"$(version)\"," >> /tmp/json_$$pid; \
echo " \"body\": \"\"," >> /tmp/json_$$pid; \
echo " \"draft\": false," >> /tmp/json_$$pid; \
echo " \"prelease\": false" >> /tmp/json_$$pid; \
echo '}' >> /tmp/json_$$pid; \
URL=https://api.github.com/repositories/9381512/releases; \
TOKEN=$$(cat ~/c/lmod_github_token.txt); \
curl --user rtmclay:token -H "Authorization: token $$TOKEN" -X POST \
--data @/tmp/json_$$pid $$URL; \
fi; \
rm -f /tmp/json_$$pid /tmp/git_st_$$$$;
gittag:
ifneq ($(TAG),)
@git status -s > /tmp/git_st_$$$$; \
if [ -s /tmp/git_st_$$$$ ]; then \
echo "All files not checked in => try again"; \
elif [ $(srcdir)/configure -ot $(srcdir)/configure.ac ]; then \
echo "configure is out of date => try again"; \
else \
$(RM) $(VERSION_SRC); \
$(RM) $(SETTARG_VSRC); \
$(BUILD_V_src) "$(GIT_BRANCH)" "$(TAG)" "$(TAG)" \
"$(CurDATE)" "$(CurDATE)" > $(VERSION_SRC); \
cp $(VERSION_SRC) $(SETTARG_VSRC); \
echo $(CurDATE) > $(VDateFn); \
$(UPDATE_VERSION) -p $(CONF_PY_PATTERN) --version $(TAG) $(CONF_PY); \
git commit -m "moving to TAG_VERSION $(TAG)" $(SETTARG_VSRC) \
$(CONF_PY) \
$(VDateFn) \
$(VERSION_SRC); \
git tag -a $(TAG) -m 'Setting TAG_VERSION to $(TAG)' ; \
branchName=`git status | head -n 1 | sed 's/^[# ]*On branch //g'` ; \
git push origin $$branchName ; \
git push --tags origin $$branchName ; \
fi ; \
rm -f /tmp/git_st_$$$$ ;
else
@echo "To git tag do: make gittag TAG=?"
endif