forked from TACC/lariat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.in
More file actions
170 lines (139 loc) · 5.78 KB
/
Makefile.in
File metadata and controls
170 lines (139 loc) · 5.78 KB
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
# $Id: Makefile.in 701 2011-02-08 22:27:13Z mclay $
PATH_TO_LUA := @PATH_TO_LUA@
prefix := @prefix@
BIN := $(prefix)/bin
BUILD_VERSION := .build
version := $(shell . ./.build; echo $$PKG_VERSION)
DIRLIST := $(DESTDIR)$(BIN)
GLOBAL_SRCS := $(HOME)/a/global_sources/ibrun
MAINDIR := configure.ac Makefile.in configure
STANDALONE_PRGM := bin/build_env.pl bin/checkExec.in bin/parseLDD.in bin/getmode.sh \
bin/ibrun.sge bin/ibrun.slurm bin/tacc_affinity.sge \
bin/readRMap.lua bin/ibrun.symm bin/tacc_affinity.slurm \
bin/offload_affinity.slurm
VDATE := $(shell date +'%F %H:%M')
REQUIRED_PKGS := \
BeautifulTbl \
Dbg \
Optiks \
Optiks_Option \
TermWidth \
VarDump \
capture \
declare \
fileOps \
pairsByKeys \
serializeTbl \
strict \
string_split \
string_trim \
REQUIRED := $(patsubst %, $(DESTDIR)$(BIN)/%.lua, $(REQUIRED_PKGS))
all:
@echo done
install: $(DIRLIST) PRGMS PKGS
global_sources: GS_PKGS GS_PRGMS
GS_PKGS:
cp `findLuaPkgs $(REQUIRED_PKGS)` $(GLOBAL_SRCS)
GS_PRGMS: $(STANDALONE_PRGM)
-for i in $^; do \
bareN=$${i##*/}; \
cp $$i $(GLOBAL_SRCS); \
done
$(DIRLIST) :
mkdir -p $@
__installMe:
-for i in $(FILELIST); do \
bareN=$${i##*/}; \
fn=$${bareN%%.in*}; \
ext=$${bareN#*.}; \
sed -e 's|@PREFIX@|@prefix@|g' \
-e 's|@path_to_lua@|$(PATH_TO_LUA)|g' \
-e 's|@PKG@|$(PKG)|g' < $$i > $(DIRLOC)/$$fn; \
[ "$$ext" != "lua" ] && \
chmod +x $(DIRLOC)/$$fn; \
done
PKGS:
for i in $(REQUIRED_PKGS); do \
if [ -f src/$(notdir $$i) ]; then \
cp src/$(notdir $$i) $(DESTDIR)$(BIN); \
else \
f=`echo "$(notdir $$i)" | sed -e 's/\.lua//'`; \
echo f: $$f; \
cp `findLuaPkgs $$f` $(DESTDIR)$(BIN); \
fi; \
done
srcPkgs:
if [ -n "$^" ]; then cp $^
PRGMS: $(STANDALONE_PRGM)
$(MAKE) FILELIST="$^" DIRLOC=$(BIN) __installMe
for i in $^; do \
j=`basename $$i`; \
if [[ $$j =~ .$(QUEUE_T) ]]; then \
fn=`basename $$j .$(QUEUE_T)`; \
echo ln -s $$j $(DESTDIR)$(BIN)/$$fn ; \
ln -s $$j $(DESTDIR)$(BIN)/$$fn ; \
fi; \
done
makefile: Makefile.in config.status
./config.status $@
config.status:
./config.status --recheck
echo:
@echo $(version)
dist:
$(MAKE) DistD=DIST _dist
_dist: _distMkDir _distMainDir _distBin _distReqPkg _distTar
_distMkDir:
$(RM) -r $(DistD)
mkdir -p $(DistD)
_distMainDir:
cp $(MAINDIR) $(DistD)
_distReqPkg:
mkdir $(DistD)/src
cp `findLuaPkgs $(REQUIRED_PKGS)` $(DistD)/src
_distBin:
mkdir $(DistD)/bin
cp $(STANDALONE_PRGM) $(DistD)/bin
_distTar:
echo "ibwrapper"-$(version) > .fname; \
$(RM) -r `cat .fname` `cat .fname`.tar*; \
mv ${DistD} `cat .fname`; \
tar chf `cat .fname`.tar `cat .fname`; \
gzip `cat .fname`.tar; \
rm -rf `cat .fname` .fname;
tags:
find . \( -regex '.*~$$\|.*/\.git\|.*/\.git/' -prune \) \
-o -type f > file_list.1
sed -e 's|.*/.git.*||g' \
-e 's|.*/rt/.*/t1/.*||g' \
-e 's|./TAGS||g' \
-e 's|./configure$$||g' \
-e 's|./config.log$$||g' \
-e 's|./testreports/.*||g' \
-e 's|./config.status$$||g' \
-e 's|.*\~$$||g' \
-e 's|./file_list.*||g' \
-e '/^\s*$$/d' \
< file_list.1 > file_list.2
etags `cat file_list.2`
$(RM) file_list.*
clean:
$(RM) config.log
clobber: clean
distclean: clobber
$(RM) config.status
gittag:
ifneq ($(TAG),)
@git status -s > /tmp/ibrun$$$$; \
if [ -s /tmp/ibrun$$$$ ]; then \
echo "All files not checked in => try again"; \
else \
$(RM) $(BUILD_VERSION); \
echo "PKG_VERSION=$(TAG)" > $(BUILD_VERSION); \
git commit -m "moving to TAG_VERSION $(TAG)" $(BUILD_VERSION); \
git tag -a $(TAG) -m 'Setting TAG_VERSION to $(TAG)' ; \
fi; \
rm -f /tmp/ibrun$$$$
else
@echo "To git tag do: make gittag TAG=?"
endif