-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.am
357 lines (308 loc) · 15.2 KB
/
Makefile.am
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
## Process this file with automake to produce Makefile.in
##
## Hand written file: used as input into Autotools.
## This is part of GNU Astronomy Utilities (gnuastro).
##
## Original author:
## Mohammad Akhlaghi <[email protected]>
## Contributing author(s):
## Copyright (C) 2015-2021, Free Software Foundation, Inc.
##
## Gnuastro is free software: you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## Gnuastro is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Gnuastro. If not, see <http://www.gnu.org/licenses/>.
## Sources to be created before everything else
## ============================================
##
## These target(s) will be created before anything else when running
## 'make', 'make check', or 'make install', see the "Built sources" section
## of the AUTOMAKE manual and the git-version-gen script comments for more
## information. Note that AUTHORS depends on '$(top_srcdir)/.version', and
## '$(top_srcdir)/.version' depends on $(top_srcdir)/configure'. So any
## time the version is updated, both of these will be re-built. But during
## usual utility and library development, '$(top_srcdir)/configure' is not
## commonly updated, so this will not slow down the process.
BUILT_SOURCES = $(top_srcdir)/AUTHORS
## Directories to check:
## =====================
##
## Gnulib is intentionally compiled and tested prior to the gnuastro
## progams. With this configuration, the user can confirm if the
## problem is internal to gnulib or still persists after all the
## Gnulib tests have been done.
if COND_ARITHMETIC
MAYBE_ARITHMETIC = bin/arithmetic
endif
if COND_BUILDPROG
MAYBE_BUILDPROG = bin/buildprog
endif
if COND_CONVERTT
MAYBE_CONVERTT = bin/convertt
endif
if COND_CONVOLVE
MAYBE_CONVOLVE = bin/convolve
endif
if COND_COSMICCAL
MAYBE_COSMICCAL = bin/cosmiccal
endif
if COND_CROP
MAYBE_CROP = bin/crop
endif
if COND_FITS
MAYBE_FITS = bin/fits
endif
if COND_MATCH
MAYBE_MATCH = bin/match
endif
if COND_MKCATALOG
MAYBE_MKCATALOG = bin/mkcatalog
endif
if COND_MKNOISE
MAYBE_MKNOISE = bin/mknoise
endif
if COND_MKPROF
MAYBE_MKPROF = bin/mkprof
endif
if COND_NOISECHISEL
MAYBE_NOISECHISEL = bin/noisechisel
endif
if COND_QUERY
MAYBE_QUERY = bin/query
endif
if COND_SEGMENT
MAYBE_SEGMENT = bin/segment
endif
if COND_STATISTICS
MAYBE_STATISTICS = bin/statistics
endif
if COND_TABLE
MAYBE_TABLE = bin/table
endif
#if COND_TEMPLATE
# MAYBE_TEMPLATE = bin/TEMPLATE
#endif
if COND_WARP
MAYBE_WARP = bin/warp
endif
if COND_GNULIBCHECK
MAYBE_GNULIBCHECK = bootstrapped/tests
endif
## Subdirectories to build
## =======================
##
## Note that by default 'COND_TEMPLATE' is not set in configure, it is
## commented, and exists only as a template for you to copy and paste to
## name your new utility. The same rule is applied here (in the 'if'
## conditions above). When 'MAYBE_TEMPLATE' is not defined, then Make will
## see it as a blank string and igonore it, so there is no problem with
## having an uncommented 'MAYBE_TEMPLATE' as a value in 'SUBDIRS'.
SUBDIRS = bootstrapped/lib $(MAYBE_GNULIBCHECK) lib $(MAYBE_ARITHMETIC) \
$(MAYBE_BUILDPROG) $(MAYBE_CONVERTT) $(MAYBE_CONVOLVE) \
$(MAYBE_COSMICCAL) $(MAYBE_CROP) $(MAYBE_FITS) $(MAYBE_MATCH) \
$(MAYBE_MKCATALOG) $(MAYBE_MKNOISE) $(MAYBE_MKPROF) $(MAYBE_NOISECHISEL) \
$(MAYBE_QUERY) $(MAYBE_SEGMENT) $(MAYBE_STATISTICS) $(MAYBE_TABLE) \
$(MAYBE_TEMPLATE) $(MAYBE_WARP) bin/script doc tests
## Add m4/ to the list of directories to search for m4 files
## =========================================================
ACLOCAL_AMFLAGS = -I bootstrapped/m4
## Files that are installed (and distributed)
## =========================================
dist_doc_DATA = README
# Installed system configuration files
# ====================================
dist_sysconf_DATA = bin/gnuastro.conf
## Files that are only distributed
## ===============================
##
## Note that 'COPYING' (containing the GNU GPL) is included in the
## distribution tarball by default in Automake, but not other license
## files, so we have to manually add 'COPYING.FDL'.
EXTRA_DIST = COPYING.FDL genauthors .dir-locals.el .version \
developer-build bootstrapped/README .autom4te.cfg
## Print the completion messages
## =============================
##
## After the jobs in all the subdirectories are done, print the following
## messages to confirm that everything is complete and guide the users on
## what they should do next.
##
## When running ./configure, the user can opt-out of these messages using
## the GUIDEMESSAGE variable that is set when they run ./configure with the
## '--distable-guide-message' option.
##
## Note that all-local is a prerequisite of 'make check' too, so we will
## only print its message when 'make' was called with no options. Make will
## set MAKECMDGOALS to blank if there are no arguments, however, the way
## Automake works, its value is set to "all-am".
all-local:
# If we are in static linking mode, correct the 'lib_dependencies'
# variable of 'libgnuastro.la'. Because by default it will not
# include static libraries!
@if [ "X$(MAKECMDGOALS)" = "Xall-am" ] && [ "X$(ENABLE_SHARED)" = "Xno" ]; then \
$(AWK) '/^dependency_libs/{print "dependency_libs='\''$(CONFIG_LDADD)'\''"} \
!/^dependency_libs/{print}' $(top_builddir)/lib/libgnuastro.la \
> $(top_builddir)/lib/libgnuastro_tmp.la; \
mv $(top_builddir)/lib/libgnuastro_tmp.la \
$(top_builddir)/lib/libgnuastro.la; \
fi
# Print a message if requested.
@if [ "X$(MAKECMDGOALS)" = "Xall-am" ] && [ x$(GUIDEMESSAGE) = xyes ]; then \
echo; \
echo "==================================================================="; \
echo "==================================================================="; \
echo "Gnuastro $(VERSION), was successfully built."; \
echo "Please check the build on your system by running:"; \
echo; \
echo " make check -j8"; \
echo; \
echo "(You can change the 8 to the number of CPU threads available.)"; \
echo "(The following \"Leaving directory\" notices can be ignored.)"; \
echo "==================================================================="; \
echo "==================================================================="; \
echo; \
fi
## We cannot do the writing persmission test at configure time. Here is a
## quote from the generated ./configure script: The prefix variables...
##
## "... are left unexpanded so users can "make install exec_prefix=/foo"
## and all the variables that are supposed to be based on exec_prefix by
## default will actually change."
##
## So actually, they can also do that after 'make check'. Usually
## professional users would want to do such a thing, so they can ignore the
## NOTE. This note is mostly for beginners and it is not written to convey
## that this is the ONLY solution.
check-local:
@if [ x$(GUIDEMESSAGE) = xyes ]; then \
echo; \
echo "==================================================================="; \
echo "==================================================================="; \
echo "Your build of Gnuastro $(VERSION) didn't fail on any tests."; \
echo "To install Gnuastro, please run the command(s) below:"; \
echo; \
if [ ! -w $(prefix) ] ; then \
echo "(NOTE: As the user $$USER, you don't have writing permissions"; \
echo "in \"$(prefix)\". To install Gnuastro there, you must get "; \
echo "privileges first, as described below. If you can't, configure "; \
echo "Gnuastro again, for example: \"./configure --prefix ~/.local\".)"; \
echo; \
echo " sudo make install"; \
echo "or"; \
echo " su"; \
fi; \
echo " make install"; \
if [ ! -w $(prefix) ] ; then \
echo " exit"; \
fi; \
echo; \
echo "(The following \"Leaving directory\" notices can be ignored.)"; \
echo "==================================================================="; \
echo "==================================================================="; \
echo; \
fi
## Note that the '\' characters in the GNU head here are not printed on the
## command line. So we have to consider them. The ASCII GNU head is taken
## from: https://www.gnu.org/graphics/gnu-ascii.html
install-exec-local:
@if [ x$(GUIDEMESSAGE) = xyes ]; then \
echo; \
echo "==================================================================="; \
echo "==================================================================="; \
echo " , , "; \
echo " / \ "; \
echo " ((__-^^-,-^^-__)) Congratulations!"; \
echo " \`-_---' \`---_-' GNU Astronomy Utilities (Gnuastro),"; \
echo " \`--|o\` 'o|--' Version $(VERSION)"; \
echo " \ \` / "; \
echo " ): :( Successfully installed on this system."; \
echo " :o_o: "; \
echo " \"-\" "; \
echo; \
echo "More information Command to run "; \
echo "---------------- -------------- "; \
echo "Complete official Gnuastro book: ' info gnuastro '"; \
echo "Entertaining tutorials: ' info gnuastro Tutorials '"; \
echo "Dedicated help mailing list: ' info help-gnuastro '"; \
echo "Instructions for reporting bugs: ' info bug-gnuastro '"; \
echo "Effectively use Info: ' info info '"; \
echo; \
echo; \
echo "Environment variables to check: "; \
echo " - '$(prefix)/bin' in PATH."; \
echo " - '$(prefix)/lib' in LD_LIBRARY_PATH."; \
echo "(for an intro, run 'info gnuastro \"Installation directory\"')"; \
echo; \
echo; \
echo "To stay up to date with future releases, please subscribe to: "; \
echo " https://lists.gnu.org/mailman/listinfo/info-gnuastro"; \
echo; \
echo; \
echo "(The following lines can be ignored.)"; \
echo "==================================================================="; \
echo "==================================================================="; \
echo; \
fi
## $(top_srcdir)/.version
## ======================
##
## This file is created from the $(VERSION) variable which was defined by
## the 'git-version-gen' script (located at address below), which is run
## when the '$(top_srcdir)/configure' script is being built by Autoconf.
##
## $(top_srcdir)/bootstrapped/build-aux/git-version-gen
##
## Note that contrary to what is proposed by 'git-version-gen', here the
## creation of '$(top_srcdir)/.version' depends on the
## '$(top_srcdir)/configure' script. Therefore, anytime a the VERSION
## variable is updated there, '$(top_srcdir)/.version' is also
## updated. During development, of the main functionality of Gnuastro
## (utilities and libraries), the '$(top_srcdir/configure' script is rarely
## updated, so '$(top_srcdir)/.version' will not be rebuilt and thus it
## won't harm the speed of tests during development.
$(top_srcdir)/.version: $(top_srcdir)/configure
echo $(VERSION) > $@-t && mv $@-t $@
## $(top_srcdir)/AUTHORS
## =====================
##
## This file is generated automatically from the version controlled
## history. Note the following:
##
## - '$(top_srcdir)/AUTHORS' is defined as a BUILT_SOURCES variable, so
## it is the first thing that is built (even in multi-threaded runs).
##
## - '$(top_srcdir)/AUTHORS' is updated only when
## '$(top_srcdir)/.version' is updated. '$(top_srcdir)/.version' its
## self is only updated when '$(top_srcdir)/configure' is updated. But
## generally, the '$(top_srcdir)/configure' script is not updated
## regularly during development and outside of version control.
##
## - The '$(top_srcdir)/genauthors' script will not do anything
## (make/update the '$(top_srcdir)AUTHORS' file) when there is no git
## repository. '$(top_srcdir)/AUTHORS' is only necessary when building
## a tarball distribution.
$(top_srcdir)/AUTHORS: $(top_srcdir)/.version
$(top_srcdir)/genauthors $(top_srcdir)
## Run when building a distribution
## ================================
##
## These targets will be created when building a (tarball)
## distribution. Note that AUTHORS depends on '.version'.
dist-hook: $(top_srcdir)/AUTHORS
echo $(VERSION) > $(distdir)/.tarball-version
## Nice joke
## =========
##
## This joke is taken from the "The art of unix programming", and a quote
## by Stuart Feldman (creator of Make): "One of the older Unix jokes is
## "Make love" which results in "Don’t know how to make love"."
love:
@echo "Don't know how to make love!"