forked from Starlink/starlink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
341 lines (315 loc) · 11.8 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
# Process this file with autoconf to generate the Makefile
# @configure_input@
# Unlike most Makefile.in files in the tree, this is a hand-maintained
# file, and not generated by automake.
# MANIFESTS and prefix must match the value defaulted in starconf.
# FIXME: tie these together, and link with starconf values.
prefix=@prefix@
MANIFESTS=$(prefix)/manifests
# Keep the following in alphabetical order. We don't actually _have_ to
# include everything here, just enough to imply all the others that we
# really need. However, it does no harm to include more components than
# minimally necessary.
#
# Targets not to include:
# No buildsupport targets: 'buildsupport' handles them below.
# No obsolete components.
ALL_TARGETS = \
$(MANIFESTS)/agi \
$(MANIFESTS)/ard \
$(MANIFESTS)/ast \
$(MANIFESTS)/astrom \
$(MANIFESTS)/atl \
$(MANIFESTS)/atools \
$(MANIFESTS)/blt \
$(MANIFESTS)/cat \
$(MANIFESTS)/ccdpack \
$(MANIFESTS)/chr \
$(MANIFESTS)/cnf \
$(MANIFESTS)/coco \
$(MANIFESTS)/convert \
$(MANIFESTS)/cupid \
$(MANIFESTS)/datacube \
$(MANIFESTS)/daophot \
$(MANIFESTS)/dipso \
$(MANIFESTS)/docfind \
$(MANIFESTS)/echomop \
$(MANIFESTS)/echwind \
$(MANIFESTS)/ems \
$(MANIFESTS)/esp \
$(MANIFESTS)/extractor \
$(MANIFESTS)/extreme \
$(MANIFESTS)/fftw \
$(MANIFESTS)/fluxes \
$(MANIFESTS)/figaro \
$(MANIFESTS)/findcoords \
$(MANIFESTS)/fio \
$(MANIFESTS)/gaia \
$(MANIFESTS)/gks \
$(MANIFESTS)/gns \
$(MANIFESTS)/graphpar \
$(MANIFESTS)/grp \
$(MANIFESTS)/gsd \
$(MANIFESTS)/gsl \
$(MANIFESTS)/gwm \
$(MANIFESTS)/hds \
$(MANIFESTS)/hdstools \
$(MANIFESTS)/hdstrace \
$(MANIFESTS)/hlp \
$(MANIFESTS)/htx \
$(MANIFESTS)/icl \
$(MANIFESTS)/idi \
$(MANIFESTS)/img \
$(MANIFESTS)/info \
$(MANIFESTS)/init \
$(MANIFESTS)/itcl \
$(MANIFESTS)/kappa \
$(MANIFESTS)/kaprh \
$(MANIFESTS)/match \
$(MANIFESTS)/mers \
$(MANIFESTS)/messgen \
$(MANIFESTS)/nbs \
$(MANIFESTS)/ndf \
$(MANIFESTS)/ndg \
$(MANIFESTS)/news \
$(MANIFESTS)/observe \
$(MANIFESTS)/one \
$(MANIFESTS)/pamela \
$(MANIFESTS)/pal \
$(MANIFESTS)/par \
$(MANIFESTS)/period \
$(MANIFESTS)/pcs \
$(MANIFESTS)/pda \
$(MANIFESTS)/pgp \
$(MANIFESTS)/photom \
$(MANIFESTS)/pisa \
$(MANIFESTS)/pongo \
$(MANIFESTS)/polpack \
$(MANIFESTS)/prm \
$(MANIFESTS)/psmerge \
$(MANIFESTS)/psx \
$(MANIFESTS)/ref \
$(MANIFESTS)/rv \
$(MANIFESTS)/sae \
$(MANIFESTS)/sgs \
$(MANIFESTS)/shl \
$(MANIFESTS)/sla \
$(MANIFESTS)/smurf \
$(MANIFESTS)/specx \
$(MANIFESTS)/spt \
$(MANIFESTS)/sst \
$(MANIFESTS)/starmem \
$(MANIFESTS)/surf \
$(MANIFESTS)/tcl \
$(MANIFESTS)/tclx \
$(MANIFESTS)/thr \
$(MANIFESTS)/tk \
$(MANIFESTS)/trn \
$(MANIFESTS)/tsp \
$(MANIFESTS)/xdisplay \
$(MANIFESTS)/sc2 \
$(MANIFESTS)/sc3 \
$(MANIFESTS)/sc4 \
$(MANIFESTS)/sc5 \
$(MANIFESTS)/sc6 \
$(MANIFESTS)/sc7 \
$(MANIFESTS)/sc9 \
$(MANIFESTS)/sc12 \
$(MANIFESTS)/sc14 \
$(MANIFESTS)/sc15 \
$(MANIFESTS)/sc17 \
$(MANIFESTS)/sc21 \
$(MANIFESTS)/sg8 \
$(MANIFESTS)/sg9
# The other important target is `buildsupport', the dependencies of
# which are defined in the Makefile.dependencies which is included below.
SUBDIRS = @subdirs@
@SET_MAKE@
LN_S=@LN_S@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
GIT = @GIT@
# Java support: need a java runtime. The Java programs below use the
# jar in $(BUILDSUPPORTCP), which is installed
# as part of the starconf component.
JAVA=@JAVA@
# Location of the buildsupport classes. This default is generally
# the best one, but we make it configurable so we can override it in
# special circumstances.
BUILDSUPPORTCP=`starconf --show buildsupportjar`
# The RECURSIVE_TARGETS support here is based on the similar support
# generated by automake, but isn't identical.
RECURSIVE_TARGETS = all-recursive check-recursive \
clean-recursive distclean-recursive maintainer-clean-recursive
all: all-recursive
# Note to track the build we create a world-stamp file with the current date
# and a starlink.version file with the current branch name (usually master,
# but other names for release branches are possible), the sha1 of the
# last commit which reflects the current state of the checkout and the
# date and time in of that commit in ISO8601 format.
world: $(ALL_TARGETS)
- if test -d $(prefix)/starjava/docs; then \
test -f $(prefix)/bin/hlink \
&& test -d $(prefix)/docs \
&& $(prefix)/bin/hlink $(prefix)/docs $(prefix)/help $(prefix)/starjava/docs; \
else \
test -f $(prefix)/bin/hlink \
&& test -d $(prefix)/docs \
&& $(prefix)/bin/hlink $(prefix)/docs $(prefix)/help ; \
fi
rm -f world-stamp
date >world-stamp
$(INSTALL_DATA) world-stamp $(MANIFESTS)/world-stamp
rm -f starlink.version
- if test -n "$(GIT)"; then \
$(GIT) branch | grep '^\*' | sed 's,\* ,,' > starlink.version; \
$(GIT) rev-parse --verify HEAD >> starlink.version; \
$(GIT) log -n 1 HEAD --pretty=format:%cd --date=iso >> starlink.version; \
echo >> starlink.version; \
$(INSTALL_DATA) starlink.version $(MANIFESTS)/starlink.version; \
fi
# Avoid doing anything if the variable JAVA is NOJAVA -- this is true if
# we're using this file unconfigured during bootstrap (see ./bootstrap
# for the relevant gymnastics).
#
# It might seem like a good idea to create a set of dependencies for
# componentset.xml at the same time, saying that it depends on all the
# component.xml files beneath it in the tree. It's a bad idea,
# however, since it means that the Makefile can be used only if the
# entire tree is checked out. If we only check out part of the tree,
# because we only want to build one component, then any make at the
# top level will fail because one or other of the dependencies of
# componentset.xml is missing. This is also why individual
# component.xml files are checked in to the repository, since this
# allows compenentset.xml to be built without the component.xml files
# being configured. This, finally, is why we do not declare that
# Makefile.dependencies depends on componentset.xml, and have a
# separate rule for the latter: we can't express any componentset.xml
# dependencies, so once it exists, it wouldn't be updated.
#
# We make the componentset.xml by concatenating all the component.xml
# files we can find. Sort the list of files to make the order
# deterministic. The removal of the DOCTYPE lines and PIs is
# admittedly lame, but good enough for the moment.
#
# componentset.xml `really' depends on all the component.xml files
# below it, but don't state this, for the reason explained above.
# If you add a component or changes a component's dependencies,
# then delete Makefile.dependencies here and remake it.
#
# The test of whether $(JAVA) is NOJAVA is important. An edited
# version of this file is used by the ./bootstrap script, in which the
# JAVA variable is set to NOJAVA (since the directory may not have been
# configured yet); we must not fail in this case. In this case simply
# do nothing, because the Makefile.dependencies file can be assumed to
# be up-to-date.
#
# If $(JAVA) is NOJAVA and Makefile.dependencies does not exist,
# then what is happening is that the user has deleted
# Makefile.dependencies in order to remake it, but they don't have a
# java binary on their path. Oh dear. Just touching the file isn't
# any use here, so fail noisily, and tell the user what they need to do.
#
# if $(JAVA) is NOJAVA and Makefile.dependencies does exist, then
# we're puzzled, because we probably shouldn't be executing this
# rule. Clearly, `make' has gone mad. In this case, simply touch
# Makefile.dependencies, since that should at least stop this
# happening again, and hope this turns into someone else's problem.
#
# The hole in the logic below is where we have an unconfigured tree
# (ie, buildsupport/starconf has not been installed) _and_ no
# Makefile.dependencies. Since the latter is checked into the
# repository, this can only mean that someone is playing
# silly-buggers, and we're stuck. The error message should cover
# that case, too.
#
Makefile.dependencies componentset-extrainfo.xml:
rm -f componentset.xml Makefile.dependencies Makefile.dependencies.tmp
exec 5>componentset.xml; \
echo '<?xml version="1.0"?>' >&5; \
echo '<!-- DTD in buildsupport/starconf/componentinfo.dtd -->' >&5; \
echo '<componentset>' >&5; \
find . -name component.xml | sort | \
{ while read c; do cat $$c; done } | \
sed '/^<?/d;/^<!DOCTYPE/d;/^ *<!--.*--> *$$/d' >&5; \
echo '</componentset>' >&5
if test "$(JAVA)" != NOJAVA; then \
$(JAVA) -classpath $(BUILDSUPPORTCP) \
GenerateDependencies \
--makefile=Makefile.dependencies.tmp \
--flatdeps=componentset-extrainfo.xml \
componentset.xml \
&& mv Makefile.dependencies.tmp Makefile.dependencies; \
elif test -f $@; then \
touch $@; \
else \
echo "You are remaking Makefile.dependencies (yes?)."; \
echo "To do this, you must have java in your path."; \
echo "(and the starconf component must be installed, as the"; \
echo "result of a tree-wide bootstrap). Either call:"; \
echo " make JAVA=/path/to/java Makefile.dependencies"; \
echo "or edit PATH appropriately, run"; \
echo " ./configure --no-recursion"; \
echo "and then remake Makefile.dependencies"; \
false; \
fi
# Create the componentset.html summary of the componentset.xml file.
# Depends on Makefile.dependencies => componentset.xml.
# Probably only used by USSC maintainer, so limited error recovery.
componentset.html: Makefile.dependencies
test $(JAVA) != NOJAVA -a -f componentset.xml
$(JAVA) -classpath $(BUILDSUPPORTCP) \
Transformer componentset.xml \
buildsupport/misc/summarise-components.xslt $@
# Make a link to an installed componentinfo.dtd file. This will not
# work at bootstrap time (so the bootstrap file takes care of this
# link). It does no harm to have the rule in, just in case this is
# used at some other time.
componentinfo.dtd:
$(LN_S) `starconf --show buildsupportdata`/componentinfo.dtd componentinfo.dtd
# Makefile.dependencies expresses all the dependencies between components.
# It expects the current file to define variable MANIFESTS to be the directory
# which holds the manifest files, typically /star/manifests
#
# As well as defining each of the manifest targets, this
# file also defines the following targets:
# buildsupport: build each of the buildsupport tools
# clean-buildsupport: clean the buildsupport tools
# configure-deps: build the set of components which
# must be built before ./configure
#
# See the Makefile.dependencies target above.
include Makefile.dependencies
# Add extra dependencies on starconf, to ensure that ./configure and
# install-sh are present before we attempt to configure it.
$(MANIFESTS)/starconf: buildsupport/starconf/configure
buildsupport/starconf/configure: $(MANIFESTS)/automake $(MANIFESTS)/autoconf
cd buildsupport/starconf && autoreconf --install --symlink --verbose
# Disable `make install' from this directory
install install-manifest:
@ echo "To install a component, go to its directory and type"
@ echo " 'make install' there. Or delete its manifest from"
@ echo " $(MANIFESTS), and make $(MANIFESTS)/<component-name>".
@ echo "To install the whole tree, type 'make world'."
clean: clean-recursive
check: check-recursive
# This list is taken from the list generated by automake when it makes
# a Makefile.in, namely $(am__CONFIG_DISTCLEAN_FILES)
CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno
distclean: distclean-recursive
-rm -f $(CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
maintainer-clean: maintainer-clean-recursive
-rm -f $(CONFIG_DISTCLEAN_FILES)
-rm -rf autom4te.cache
-rm -f Makefile
$(RECURSIVE_TARGETS):
for d in $(SUBDIRS); do \
if test "$$d" = . ; then \
echo "Omitting recursive make of current directory"; \
else \
target=`echo $@ | sed s/-recursive//`; \
(cd $$d && $(MAKE) $$target); \
fi; \
done