source: tags/ms_r18q1/Makefile

Last change on this file was 16986, checked in by westram, 4 years ago

Update: continued by [17178]

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 78.7 KB
Line 
1# =============================================================== #
2#                                                                 #
3#   File      : Makefile                                          #
4#                                                                 #
5#   Institute of Microbiology (Technical University Munich)       #
6#   http://www.arb-home.de/                                       #
7#                                                                 #
8# =============================================================== #
9
10# -----------------------------------------------------
11# The ARB Makefile is aware of the following defines:
12#
13# CC                    C compiler (should be defined by OS)
14# CXX                   C++ compiler (should be defined by OS)
15#
16# BUILDHOST_64=0/1      1=>compile on 64 bit platform (defaults to ARB_64)
17# DEVELOPER=name        special compilation (values: ANY,RELEASE,your name)
18# OPENGL=0/1            whether OPENGL is available
19#
20# -----------------------------------------------------
21# Paths for several libraries may be set from config.makefile by using:
22#
23#     export XLIBS=$(shell pkg-config --libs xpm xerces-c)
24#     export XINCLUDES=$(shell pkg-config --cflags x11)
25#     export XAW_LIBS=$(shell pkg-config --libs xaw7)
26#     export XML_INCLUDES=$(shell pkg-config --cflags xerces-c)
27#
28# You make have to explicitely point pkg-config to the *.pc files needed.
29# For example, Xquartz X11 libraries on macos can be located by adding
30# the following line before those given above:
31#
32#     export PKG_CONFIG_PATH=/usr/X11/lib/pkgconfig
33#
34# -----------------------------------------------------
35# ARB Makefile and ARB source code are aware of the following defines:
36#
37# $(MACH)               name of the machine (LINUX or DARWIN; see config.makefile)
38# DEBUG                 compiles the DEBUG sections
39# DEBUG_GRAPHICS        all X-graphics are flushed immediately (for debugging)
40# ARB_64=0/1            1=>compile 64 bit version
41# UNIT_TESTS=0/1        1=>compile in unit tests and call them after build
42# COVERAGE=0/1/2        compile in gcov support (useful together with UNIT_TESTS=1)
43#                       0=no, 1+2=compile in, 1=show
44# STABS=0/1             force stabs format? (0 = "use default format")
45# SANITIZE=0/#/all      use Sanitizer? (defaults to 0,
46#                                       1=AddressSanitizer+LeakSanitizer,
47#                                       2=UndefinedBehaviorSanitizer,
48#                                       combine bit-values to activate multiple Sanitizers,
49#                                       specify 'all' to activate all)
50# SHOWTODO=0/1          activate TODO-warnings? (defaults to 0, except for ralf)
51#
52# -----------------------------------------------------
53# The ARB source code is aware of the following defines:
54#
55# NDEBUG                doesn't compile the DEBUG sections
56# DEVEL_$(DEVELOPER)    developer-dependent flag (enables you to have private sections in code)
57#                       DEVELOPER='ANY' (default setting) will be ignored
58#                       configurable in config.makefile
59#
60# -----------------------------------------------------
61# Read configuration
62include config.makefile
63
64# set defaults for variables commented out in config.makefile:
65ifndef DARWIN
66 DARWIN:=0
67endif
68ifndef LINUX
69 LINUX:=0
70endif
71ifndef DEBIAN
72 DEBIAN:=0
73endif
74ifndef REDHAT
75 REDHAT:=0
76endif
77ifndef ARB_64
78 ARB_64=1#default to 64bit
79endif
80
81# compiler settings:
82ifneq ($(CC),use__A_CC__instead_of__CC)
83 A_CC:=$(CC)# compile C
84 A_CXX:=$(CXX)# compile C++
85
86# uncomment to ensure no submakefile uses CC and CXX directly
87 override CC:=use__A_CC__instead_of__CC
88 override CXX:=use__A_CXX__instead_of__CXX
89endif
90
91export CC CXX A_CC A_CXX
92
93# unconditionally prepend $(ARBHOME)/lib to LD_LIBRARY_PATH if not found
94ifeq ($(findstring $(ARBHOME)/lib,$(LD_LIBRARY_PATH)),)
95 LD_LIBRARY_PATH:=${ARBHOME}/lib:$(LD_LIBRARY_PATH)
96endif
97
98# store LD_LIBRARY_PATH to circumvent SIP restrictions:
99ARBBUILD_LIBRARY_PATH:=$(LD_LIBRARY_PATH)
100
101FORCEMASK = umask 002
102NODIR=--no-print-directory
103
104SED:=$(ARBHOME)/SH/arb_sed
105READLINK:=$(ARBHOME)/SH/arb_readlink
106
107# ---------------------- compiler version detection
108
109# supported gcc versions:
110ALLOWED_gcc_VERSIONS=\
111                    4.4.3       4.4.5 4.4.6 4.4.7 \
112              4.5.2 \
113        4.6.1 4.6.2 4.6.3 4.6.4 \
114        4.7.1 4.7.2 4.7.3 4.7.4 \
115  4.8.0 4.8.1 4.8.2 4.8.3 4.8.4 4.8.5 \
116  4.9.0 4.9.1 4.9.2 4.9.3 4.9.4 \
117  5.1.0 5.2.0 5.3.0 5.3.1 5.4.0 5.5.0 \
118  6.1.0 6.2.0 6.3.0 6.4.0 \
119  7.1.0 7.2.0 7.3.0 \
120  8.1.0 \
121
122# ----------------------
123
124COMPILER_INFO:=$(shell SOURCE_TOOLS/arb_compiler_version.pl $(A_CXX))
125COMPILER_NAME:=$(word 1,$(COMPILER_INFO))
126COMPILER_VERSION:=$(word 2,$(COMPILER_INFO))
127
128USE_CLANG:=0
129ifneq ($(COMPILER_NAME),gcc)
130 ifeq ($(COMPILER_NAME),clang)
131  USE_CLANG:=1
132 else
133  ifeq ($(COMPILER_VERSION),4.6.4)
134#  gcc version 4.6.4 segfaults when dumping symbols for detection (silently accept as gcc)
135   COMPILER_NAME:=gcc
136  else
137   $(error failed to detect COMPILER_NAME (got '$(COMPILER_NAME)', expected 'clang' or 'gcc'))
138  endif
139 endif
140endif
141
142ifeq ($(USE_CLANG),1)
143# accept all clang versions:
144 ALLOWED_COMPILER_VERSIONS=$(COMPILER_VERSION)
145else
146 ALLOWED_COMPILER_VERSIONS=$(ALLOWED_gcc_VERSIONS)
147endif
148
149COMPILER_VERSION_ALLOWED=$(strip $(subst ___,,$(foreach version,$(ALLOWED_COMPILER_VERSIONS),$(findstring ___$(version)___,___$(COMPILER_VERSION)___))))
150
151#---------------------- split gcc version
152
153SPLITTED_VERSION:=$(subst ., ,$(COMPILER_VERSION))
154
155USE_GCC_MAJOR:=$(word 1,$(SPLITTED_VERSION))
156USE_GCC_MINOR:=$(word 2,$(SPLITTED_VERSION))
157USE_GCC_PATCHLEVEL:=$(word 3,$(SPLITTED_VERSION))
158
159USE_GCC_452_OR_HIGHER:=
160USE_GCC_46_OR_HIGHER:=
161USE_GCC_47_OR_HIGHER:=
162USE_GCC_48_OR_HIGHER:=
163USE_GCC_49_OR_HIGHER:=
164USE_GCC_50_OR_HIGHER:=
165USE_GCC_60_OR_HIGHER:=
166USE_GCC_70_OR_HIGHER:=
167USE_GCC_80_OR_HIGHER:=
168
169ifeq ($(USE_CLANG),0)
170 ifeq ($(USE_GCC_MAJOR),4)
171  ifeq ($(USE_GCC_MINOR),5)
172   ifneq ('$(findstring $(USE_GCC_PATCHLEVEL),23456789)','')
173    USE_GCC_452_OR_HIGHER:=yes
174   endif
175  else
176   ifneq ('$(findstring $(USE_GCC_MINOR),6789)','')
177    USE_GCC_452_OR_HIGHER:=yes
178    USE_GCC_46_OR_HIGHER:=yes
179    ifneq ($(USE_GCC_MINOR),6)
180     USE_GCC_47_OR_HIGHER:=yes
181     ifneq ($(USE_GCC_MINOR),7)
182      USE_GCC_48_OR_HIGHER:=yes
183       ifneq ($(USE_GCC_MINOR),8)
184        USE_GCC_49_OR_HIGHER:=yes
185       endif
186     endif
187    endif
188   endif
189  endif
190 else
191  # gcc 5.x or higher
192  USE_GCC_452_OR_HIGHER:=yes
193  USE_GCC_46_OR_HIGHER:=yes
194  USE_GCC_47_OR_HIGHER:=yes
195  USE_GCC_48_OR_HIGHER:=yes
196  USE_GCC_49_OR_HIGHER:=yes
197  USE_GCC_50_OR_HIGHER:=yes
198  ifneq ($(USE_GCC_MAJOR),5)
199   # gcc 6.x or higher
200   USE_GCC_60_OR_HIGHER:=yes
201   ifneq ($(USE_GCC_MAJOR),6)
202    # gcc 7.x or higher
203    USE_GCC_70_OR_HIGHER:=yes
204    ifneq ($(USE_GCC_MAJOR),7)
205     # gcc 8.x or higher
206     USE_GCC_80_OR_HIGHER:=yes
207    endif
208   endif
209  endif
210 endif
211endif
212
213#---------------------- define special directories for non standard builds
214
215ifeq ($(DARWIN),1)
216 OSX_FW:=/System/Library/Frameworks
217 OSX_FW_OPENGL:=$(OSX_FW)/OpenGL.framework/Versions/A/Libraries
218 OSX_FW_GLUT:=$(OSX_FW)/GLUT.framework/Versions/A/Libraries
219 OSX_FW_IMAGEIO:=$(OSX_FW)/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources
220endif
221
222#----------------------
223
224ifeq ($(DARWIN),1)
225 LINK_STATIC=1# link static
226else
227 LINK_STATIC=0# link dynamically
228#  LINK_STATIC=1# link static (testing only)
229endif
230
231shared_cflags :=# flags for shared lib compilation
232clflags :=# linker flags (when passed through gcc)
233extended_warnings :=# warning flags for C and C++-compiler
234extended_cpp_warnings :=# warning flags for C++-compiler only
235
236DISABLE_VECTORIZE_CHECK:=0# for details about vectorization checks see SOURCE_TOOLS/vectorize.README
237
238ifeq ($(DEBUG),0)
239 dflags := -DNDEBUG# defines
240 ifeq ($(USE_CLANG),1)
241  cflags := -O3# compiler flags (C and C++)
242 else
243  clflags += -Wl,-O2# passthrough linker flags
244# ------- standard optimization:
245  cflags := -O3# compiler flags (C and C++)
246# ------- test changed optimization (DISABLE_VECTORIZE_CHECK for -O2 or lower):
247#  cflags := -O2# do not commit uncommented!
248#  DISABLE_VECTORIZE_CHECK:=1
249 endif
250endif
251
252ifeq ($(DEBIAN),1)
253 clflags += -Wl,-rpath=/usr/lib/arb/lib -Wl,-z,relro
254endif
255
256ifeq ($(DEBUG),1)
257 dflags := -DDEBUG
258
259 gdb_common := -g -g3 -ggdb -ggdb3
260
261DBGOPTI:=-O0
262 ifeq ('$(USE_GCC_48_OR_HIGHER)','yes')
263  DBGOPTI:=-Og
264 endif
265
266 ifeq ($(STABS),1)
267  cflags := $(DBGOPTI)  $(gdb_common) -gstabs+  # using stabs+ (enable this for bigger debug session: debugs inlines, quick var inspect, BUT valgrind stops working :/)
268 else
269  cflags := $(DBGOPTI) $(gdb_common) # (using dwarf - cant debug inlines here, incredible slow on showing variable content)
270 endif
271
272# cflags := $(DBGOPTI) $(gdb_common) -gdwarf-3 # (specify explicit dwarf format)
273# cflags := $(DBGOPTI) $(gdb_common) -gstabs  # using stabs (same here IIRC)
274# cflags := -O2 $(gdb_common) # use this for callgrind (force inlining)
275
276 ifeq ($(DARWIN),0)
277  clflags += -Wl,-g
278# Note:
279# Previously '-Wl,-noinhibit-exec' was added to 'clflags' here,
280# to fix some issues with launchpad binutils (see [12972]).
281# But that change also caused 'undefined symbols' NOT to be reported as errors
282# at link time, producing executables that fail at runtime :/
283 endif
284
285 ifeq ($(DEBUG_GRAPHICS),1)
286  dflags += -DDEBUG_GRAPHICS
287 endif
288
289endif # DEBUG only
290
291# control how much you get spammed
292# (please do not change default in SVN, use developer specific setting as below)
293POST_COMPILE := 2>&1 | $(ARBHOME)/SOURCE_TOOLS/postcompile.pl
294# POST_COMPILE := 2>&1 | $(ARBHOME)/SOURCE_TOOLS/postcompile.pl --original# dont modify compiler output
295# POST_COMPILE := 2>&1 | $(ARBHOME)/SOURCE_TOOLS/postcompile.pl --loop-optimization-candi# show candidates for vectorization check
296# POST_COMPILE := 2>&1 | $(ARBHOME)/SOURCE_TOOLS/postcompile.pl --dump-loop-optimization# useful while optimizing code for vectorization
297# POST_COMPILE := 2>&1 | $(ARBHOME)/SOURCE_TOOLS/postcompile.pl --hide-Noncopyable-advices
298# POST_COMPILE := 2>&1 | $(ARBHOME)/SOURCE_TOOLS/postcompile.pl --show-useless-Weff++
299# POST_COMPILE := 2>&1 | $(ARBHOME)/SOURCE_TOOLS/postcompile.pl --no-warnings
300# POST_COMPILE := 2>&1 | $(ARBHOME)/SOURCE_TOOLS/postcompile.pl --only-first-error
301# POST_COMPILE := 2>&1 | $(ARBHOME)/SOURCE_TOOLS/postcompile.pl --no-warnings --only-first-error
302#
303# for details about vectorization checks see SOURCE_TOOLS/vectorize.README
304
305ifeq ($(DEVELOPER),ELMAR)
306 POST_COMPILE := 2>&1 | $(ARBHOME)/SOURCE_TOOLS/postcompile.pl --only-first-error
307endif
308
309# always pass used compiler version to postcompile:
310POST_COMPILE += --compiler=$(COMPILER_VERSION)
311
312# Enable extra warnings
313extended_warnings :=
314extended_cpp_warnings :=
315
316# C and C++
317extended_warnings     += -Wwrite-strings -Wunused -Wno-aggregate-return -Wshadow
318
319# C++ only
320extended_cpp_warnings += -Wnon-virtual-dtor -Wreorder -Wpointer-arith -Wdisabled-optimization -Wmissing-format-attribute
321extended_cpp_warnings += -Wctor-dtor-privacy
322# extended_cpp_warnings += -Wfloat-equal
323
324extended_cpp_warnings += -Wmissing-noreturn
325# extended_cpp_warnings += -Wold-style-cast# (warns about 28405 old-style casts)
326extended_cpp_warnings += -Winit-self
327extended_cpp_warnings += -Wstrict-aliasing
328extended_cpp_warnings += -Wextra
329
330# ------- above only warning-options already available in gcc 4.4.3
331
332#  -Weffc++ broken in 4.7.x series
333# gcc 4.7.3 crashes on GenomeImport.cxx when -Weffc++ is active
334# (bug reported https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56923; apparently wont be fixed for 4.7-series)
335# gcc 4.7.4 crashes on DBwriter.cxx when -Weffc++ is active
336WEFFC_BROKEN:=0
337ifeq ('$(USE_GCC_47_OR_HIGHER)','yes')
338 ifneq ('$(USE_GCC_48_OR_HIGHER)','yes')
339  WEFFC_BROKEN:=1
340 endif
341endif
342ifeq ('$(WEFFC_BROKEN)','0')
343 extended_cpp_warnings += -Weffc++
344endif
345
346# turn off -Wmaybe-uninitialized in debug mode (gets activated with -Wextra). too many bogus warnings
347ifeq ($(DEBUG),1)
348 ifeq ($(USE_CLANG),0)
349  extended_cpp_warnings += -Wno-maybe-uninitialized
350 endif
351endif
352
353ifeq ('$(USE_GCC_452_OR_HIGHER)','yes')
354 extended_cpp_warnings += -Wlogical-op# gcc 4.5.2
355endif
356ifeq ('$(USE_GCC_47_OR_HIGHER)','yes')
357 extended_cpp_warnings += -Wzero-as-null-pointer-constant# gcc 4.7
358endif
359ifeq ('$(USE_GCC_48_OR_HIGHER)','yes')
360 extended_cpp_warnings += -Wunused-local-typedefs# available since gcc 4.7 (but fails for each STATIC_ASSERT, so enable only for Cxx11)
361endif
362 ifeq ('$(USE_GCC_50_OR_HIGHER)','yes')
363  extended_cpp_warnings += -Wswitch-bool
364  extended_cpp_warnings += -Wlogical-not-parentheses
365  extended_cpp_warnings += -Wsizeof-array-argument
366  extended_cpp_warnings += -Wbool-compare
367
368  ifneq ($(DEVELOPER),RELEASE)
369# suggest final:
370   extended_cpp_warnings += -Wsuggest-final-types
371   extended_cpp_warnings += -Wsuggest-final-methods
372   dflags += -DSUGGESTS_FINAL
373  endif
374 endif
375 ifeq ('$(USE_GCC_60_OR_HIGHER)','yes')
376  extended_cpp_warnings += -Wduplicated-cond
377 endif
378
379#---------------------- turn off clang bogus warnings
380
381ifeq ($(USE_CLANG),1)
382# -Wmismatched-tags warns about struct/class mismatch in forward declarations (which is explicitely allowed)
383# -Wchar-subscripts reports too many bogus warnings for "array['x']" (when 'x' is known to be in range [0..128])
384# -Wunused-private-field report too many false positives (currently ~ 2 of 3)
385# -Wstring-plus-int warns about common ARB coding practice
386# -Wgnu-static-float-init warns about accepted GNU extension
387 extended_cpp_warnings += -Wno-mismatched-tags -Wno-char-subscripts -Wno-unused-private-field -Wno-string-plus-int
388 ifeq ('$(COMPILER_VERSION)','4.2.1')
389# jenkins build (doesn't know switch -Wno-gnu-static-float-init)
390  extended_cpp_warnings += -Wno-gnu
391 else
392  extended_cpp_warnings += -Wno-gnu-static-float-init
393 endif
394endif
395
396#---------------------- developer
397
398ifneq ($(DEVELOPER),ANY) # ANY=default setting (skip all developer specific code)
399 dflags += -DDEVEL_$(DEVELOPER)# activate developer/release specific code
400endif
401
402#---------------------- activate TODO warnings?
403
404ifndef SHOWTODO
405 ifeq ($(DEVELOPER),RALF)
406  SHOWTODO:=1
407 else
408  SHOWTODO:=0
409 endif
410endif
411ifeq ($(SHOWTODO),1)
412 dflags += -DWARN_TODO# activate "TODO" warnings
413endif
414
415#---------------------- activate threads?
416# only useful if compiler is able to compile Cxx11 or better
417
418ifeq ('$(USE_GCC_48_OR_HIGHER)','yes')
419# see also ./TEMPLATES/cxxforward.h@USE_Cxx11
420cflags += -pthread
421clflags += -pthread
422endif
423
424#---------------------- activate Sanitizers?
425
426ASAN_OPTIONS:=handle_segv=0:color=0
427ASAN_OPTIONS+=:detect_leaks=1 # comment-out to disable leak-detection
428ASAN_OPTIONS+=:check_initialization_order=1
429# ASAN_OPTIONS+=:abort_on_error=1
430
431# suppressions: SOURCE_TOOLS/arb.leaksan.supp
432LSAN_OPTIONS:=max_leaks=3:suppressions=$(ARBHOME)/SOURCE_TOOLS/arb.leaksan.supp
433
434
435ifndef SANITIZE
436 SANITIZE:=0
437endif
438
439SANITIZE_ADDRESS:=0
440SANITIZE_UNDEFINED:=0
441
442ifneq ($(SANITIZE),0)
443 ifeq ($(SANITIZE),all)
444  SANITIZE:=3
445 endif
446
447 ifeq ($(SANITIZE),1)
448  SANITIZE_ADDRESS:=1
449 else
450  ifeq ($(SANITIZE),2)
451   SANITIZE_UNDEFINED:=1
452  else
453   ifeq ($(SANITIZE),3)
454    SANITIZE_ADDRESS:=1
455    SANITIZE_UNDEFINED:=1
456   else
457    $(error Unknown value '$(SANITIZE)' specified for SANITIZE in config.makefile)
458   endif
459  endif
460 endif
461endif
462
463ifeq ($(SANITIZE_ADDRESS),1)
464 ifneq ('$(USE_GCC_48_OR_HIGHER)','yes')
465  $(info AddressSanitizer not usable with gcc $(COMPILER_VERSION) - disabled)
466  SANITIZE_ADDRESS:=0
467 else
468  ifneq ('$(USE_GCC_49_OR_HIGHER)','yes')
469   $(warning note that LeakSanitizer does not work with gcc $(COMPILER_VERSION))
470  endif
471 endif
472endif
473
474ifeq ($(SANITIZE_UNDEFINED),1)
475 ifneq ('$(USE_GCC_49_OR_HIGHER)','yes')
476  $(info UndefinedBehaviorSanitizer not usable with gcc $(COMPILER_VERSION) - disabled)
477  SANITIZE_UNDEFINED:=0
478 endif
479endif
480
481SANITIZE_ANY:=0
482ifeq ($(SANITIZE_ADDRESS),1)
483 SANITIZE_ANY:=1
484endif
485ifeq ($(SANITIZE_UNDEFINED),1)
486 SANITIZE_ANY:=1
487endif
488
489# vectorization fails if sanitizer active where it normally succeeds -> disable check
490ifeq ($(SANITIZE_ANY),1)
491 DISABLE_VECTORIZE_CHECK:=1
492endif
493
494# deactivate some bogus warnings occurring when sanitizing NDEBUG version
495# (do not disable for future gcc-version >= 8.x -> test again when available)
496ifeq ($(SANITIZE_ANY),1)
497 ifeq ($(DEBUG),0)
498  ifneq ('$(USE_GCC_80_OR_HIGHER)','yes')
499   extended_cpp_warnings += -Wno-format-overflow
500   extended_cpp_warnings += -Wno-maybe-uninitialized
501  endif
502 endif
503endif
504
505#---------------------- 32 or 64 bit
506
507ifndef BUILDHOST_64
508 BUILDHOST_64:=$(ARB_64)# assume build host is same as version (see config.makefile)
509endif
510
511cross_cflags:=
512cross_lflags:=
513cross_clflags:=
514
515ifeq ($(ARB_64),1)
516 dflags += -DARB_64 #-fPIC
517 shared_cflags += -fPIC
518
519 ifeq ($(BUILDHOST_64),1)
520# build 64-bit ARB version on 64-bit host
521  CROSS_LIB:=# empty = autodetect below
522  ifeq ($(DARWIN),1)
523   cross_cflags  += -arch x86_64
524   cross_lflags  += -arch x86_64
525   cross_clflags += -arch x86_64
526  endif
527 else
528# build 64-bit ARB version on 32-bit host
529  CROSS_LIB:=/lib64
530  cross_cflags += -m64
531  cross_lflags += -m64 -m elf_x86_64
532  cross_clflags += -m64 -Wl,-m64,-m,elf_x86_64
533 endif
534else
535 ifeq ($(BUILDHOST_64),1)
536# build 32-bit ARB version on 64-bit host
537  CROSS_LIB:=# empty = autodetect below
538  cross_cflags += -m32
539  cross_lflags += -m32 -m elf_i386
540  cross_clflags += -m32 -Wl,-m32,-m,elf_i386
541 else
542# build 32-bit ARB version on 32-bit host
543  CROSS_LIB:=/lib
544 endif
545endif
546
547cflags  += $(cross_cflags)
548clflags += $(cross_clflags)
549
550ifeq ('$(CROSS_LIB)','')
551# autodetect libdir
552 ifeq ($(ARB_64),1)
553  CROSS_LIB:=$(shell (test -d /lib64 && echo lib64) || echo lib)
554 else
555  CROSS_LIB:=$(shell (test -d /lib32 && echo lib32) || echo lib)
556 endif
557endif
558
559#---------------------- unit tests
560
561ifndef UNIT_TESTS
562 UNIT_TESTS=0#default is "no tests"
563endif
564ifeq ($(UNIT_TESTS),1)
565 dflags += -DUNIT_TESTS
566 UNIT_TESTER_LIB=UNIT_TESTER/UNIT_TESTER.a
567else
568 UNIT_TESTER_LIB=
569endif
570
571#---------------------- use gcov
572
573ifndef COVERAGE
574 COVERAGE=0#default is "no"
575endif
576ifneq ($(COVERAGE),0)
577 GCOV_FLAGS=--coverage
578else
579 GCOV_FLAGS=
580endif
581
582cflags       += $(GCOV_FLAGS)
583clflags      += $(GCOV_FLAGS)
584cross_lflags += $(GCOV_FLAGS)
585
586#---------------------- other flags
587
588dflags += -D$(MACH) # define machine
589
590ifeq ($(DARWIN),1)
591 shared_cflags += -fno-common
592else
593 dflags +=  $(shell getconf LFS_CFLAGS)
594endif
595
596cflags += -pipe
597cflags += -fmessage-length=0# don't wrap compiler output
598cflags += -fshow-column# show columns
599cflags += -funit-at-a-time
600cflags += -fPIC
601cflags += -fno-common# link all global data into one namespace
602cflags += -fstrict-aliasing# gcc 3.4
603ifeq ('$(USE_GCC_48_OR_HIGHER)','yes')
604 cflags += -fno-diagnostics-show-caret#gcc 4.8 (4.7.?)
605endif
606#cflags += -save-temps# uncomment to see preprocessor output
607
608#---------------------- various sanitizers
609# There are some disabled tests in CORE/arb_misc.cxx@sanitizers
610# which trigger sanitizer reports.
611
612ifeq ($(SANITIZE_ANY),1)
613 cflags  += -ggdb3 -fno-omit-frame-pointer
614endif
615
616# activate AddressSanitizer+LeakSanitizer?
617ifeq ($(SANITIZE_ADDRESS),1)
618 cflags  += -fsanitize=address
619 clflags += -fsanitize=address
620 dflags  += -DLEAKS_SANITIZED
621endif
622
623# activate UndefinedBehaviorSanitizer?
624ifeq ($(SANITIZE_UNDEFINED),1)
625 cflags  += -fsanitize=undefined
626 clflags += -fsanitize=undefined
627 dflags  += -DUNDEF_SANITIZED
628 ifeq ('$(USE_GCC_50_OR_HIGHER)','yes')
629   # abort on runtime errors
630   cflags += -fno-sanitize-recover=all
631 endif
632#
633# Note: alignment-sanitizer is deactivated for ARBDB and PROBE!
634 ifeq ('$(DEBUG)','1')
635  ifeq ($(USE_GCC_MAJOR),4)
636   ifeq ($(USE_GCC_MINOR),9)
637    ifneq ('$(findstring $(USE_GCC_PATCHLEVEL),01)','')
638# workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63531 for 4.9.0 + 4.9.1
639# (problem is fixed in 4.9.2 release)
640     extended_cpp_warnings:=$(subst -Weffc++,,$(extended_cpp_warnings))
641    endif
642   endif
643  endif
644 endif
645endif
646
647#---------------------- X11 location
648
649ifeq ($(DARWIN),1)
650 XHOME:=$(PREFIX)
651else
652 ifeq ($(DEBIAN),1)
653  XHOME:=$(PREFIX)
654 else
655  XHOME:=/usr/X11R6
656 endif
657endif
658
659XINCLUDES ?= -I$(XHOME)/include
660XLIBS     ?= -L$(XHOME)/$(CROSS_LIB)
661ifeq ($(DARWIN),1)
662 XINCLUDES += -I$(OSX_FW)/GLUT.framework/Headers -I$(OSX_FW)/OpenGL.framework/Headers -I$(OSX_SDK)/usr/include/krb5
663
664 XLIBS += -lXm -lpng -lz -lXt -lX11 -lXext -lXp -lXmu -lXi
665 XLIBS += -Wl,-dylib_file,$(OSX_FW_OPENGL)/libGL.dylib:$(OSX_FW_OPENGL)/libGL.dylib
666 XLIBS += -Wl,-dylib_file,$(OSX_FW_OPENGL)/libGLU.dylib:$(OSX_FW_OPENGL)/libGLU.dylib
667else
668 XLIBS += -lXm -lXpm -lXt -lXext -lX11
669endif
670
671#---------------------- open GL
672
673ifeq ($(OPENGL),1)
674 cflags += -DARB_OPENGL # activate OPENGL code
675 GL     := gl # this is the name of the OPENGL base target
676 GL_LIB_SYS := -lGL -lGLU
677 GL_LIB_ARB := -L$(ARBHOME)/GL/glAW -lglAW
678
679 ifeq ($(DARWIN),1)
680  GL_LIB_SYS += -lpthread
681 endif
682
683 GL_PNGLIBS_ARB := -L$(ARBHOME)/GL/glpng -lglpng_arb
684 GL_PNGLIBS_SYS := -lpng
685
686 GLEWLIB := -lGLEW -lGLw
687 ifeq ($(DARWIN),1)
688  GLUTLIB := -glut
689 else
690  GLUTLIB := -lglut
691 endif
692
693 GL_LIBS_SYS := $(GL_LIB_SYS) $(GL_PNGLIBS_SYS) $(GLEWLIB) $(GLUTLIB)
694 GL_LIBS_ARB := $(GL_LIB_ARB) $(GL_PNGLIBS_ARB)
695
696 RNA3D_LIB := RNA3D/RNA3D.a
697else
698 GL_LIBS_ARB:=# no opengl -> no libs
699 GL_LIBS_SYS:=# no opengl -> no libs
700 GL:=# don't build ARB openGL libs
701
702 RNA3D_LIB :=
703endif
704
705RNA3D_LIB_4_DEPENDS := RNA3D/RNA3D.a
706
707GL_LIBS:=$(GL_LIBS_ARB) $(GL_LIBS_SYS)
708
709#---------------------- tiff lib:
710
711TIFFLIBS := -ltiff
712
713#---------------------- XML lib:
714
715XMLLIBS := -lxerces-c
716
717#---------------------- glib:
718
719ARB_NEEDED_GLIB=glib-2.0
720
721ARB_GLIB_INCLUDE:=$(strip $(shell pkg-config --cflags $(ARB_NEEDED_GLIB)))
722ARB_GLIB_LIBS:=$(strip    $(shell pkg-config --libs   $(ARB_NEEDED_GLIB)))
723
724#---------------------- basic libs:
725
726SYSLIBS:=
727ifeq ($(DARWIN),1)
728 SYSLIBS += -lstdc++
729else
730 SYSLIBS += -lm $(ARB_GLIB_LIBS)
731endif
732
733#---------------------- include symbols?
734
735ifeq ($(TRACESYM),1)
736 ifeq ($(USE_CLANG),0)
737  cflags  += -rdynamic
738  clflags += -rdynamic -Wl,--export-dynamic
739 endif
740endif
741
742#---------------------- system dependent commands
743
744ifeq ($(DARWIN),1)
745 TIME:=gtime
746else
747 TIME:=/usr/bin/time
748endif
749
750#---------------------- SSE vectorizer
751# for details see SOURCE_TOOLS/vectorize.README
752
753ifeq ($(DEBUG),0)
754 ifeq ($(USE_GCC_49_OR_HIGHER),yes)
755  ifeq ($(DISABLE_VECTORIZE_CHECK),0)
756#  cflags += -fopt-info
757   cflags += -fopt-info-vec
758#  Shows reasons for unsuccessful vectorization:
759#  cflags += -fopt-info-vec-missed
760   POST_COMPILE += --check-loop-optimization
761  endif
762 else
763  ifeq ($(USE_GCC_48_OR_HIGHER),yes)
764# no automatic vectorization-check for gcc<4.9.0
765# -> uncomment the next 2 lines and grep the spam it will produce for 'vectorized.*loops'
766#  cflags += -fopt-info -fopt-info-vec-missed
767#  POST_COMPILE += --original
768  endif
769 endif
770endif
771
772#---------------------- stop early on broken flags/compiler combination
773
774ifeq ($(DEBUG),0)
775 ifeq ($(SANITIZE_ANY),1)
776  ifeq ('$(COMPILER_VERSION)','4.9.1')
777   $(error compiling DEBUG=0 + SANITIZE!=0 crashes with gcc $(COMPILER_VERSION) (gcc 4.9.2 works))
778  endif
779 endif
780endif
781
782#---------------------- differences between linking executables and shared libs:
783
784# executables:
785ifeq ($(DARWIN),1)
786 blflags:=$(clflags)
787else
788 blflags:=$(clflags) -Wl,--no-undefined
789endif
790
791# shared libraries
792llflags:=$(clflags)
793
794# dont use clflags below
795clflags:=
796
797# -------------------------------------------------------------------------
798#       Don't put any machine/version/etc conditionals below!
799#       (instead define variables above)
800# -------------------------------------------------------------------------
801
802cflags += -W -Wall $(dflags) $(extended_warnings)
803cxxflags := $(extended_cpp_warnings)
804
805# add CFLAGS + CPPFLAGS from environment for DEBIAN build
806ifeq ($(DEBIAN),1)
807 cflags := $(CFLAGS) $(cflags)
808 cxxflags += $(CPPFLAGS)
809endif
810
811ifeq ('$(USE_CLANG)','1')
812# none of the following standards works with clang3.3 (under linux) => dont use standard (as done before r15516)
813#  cxxflags += -std=gnu++11
814#  cxxflags += -std=gnu++0x
815else
816 ifeq ('$(USE_GCC_60_OR_HIGHER)','yes')
817  cxxflags += -std=gnu++14# see also TEMPLATES/cxxforward.h@USE_Cxx14
818 else
819  ifeq ('$(USE_GCC_47_OR_HIGHER)','yes')
820   cxxflags += -std=gnu++11# see also TEMPLATES/cxxforward.h@USE_Cxx11
821  else
822#  gcc versions between 4.3 (lowest supported) and <4.7
823   cxxflags += -std=gnu++0x
824  endif
825 endif
826endif
827
828LINK_STATIC_LIB := ar -csq# link static lib
829LINK_EXECUTABLE := $(A_CXX) $(blflags) -o# link executable (c++)
830
831ifeq ($(LINK_STATIC),1)
832 SHARED_LIB_SUFFIX = a# static lib suffix
833 LINK_SHARED_LIB := $(LINK_STATIC_LIB)
834else
835 SHARED_LIB_SUFFIX = so# shared lib suffix
836 LINK_SHARED_LIB := $(A_CXX) $(llflags) -shared -o# link shared lib
837endif
838
839ifeq ($(DARWIN),1)
840 lflags4perl:=
841else
842 lflags4perl:=$(cross_lflags) -shared
843endif
844
845# delete variables unused below
846blflags:=
847llflags:=
848
849# other used tools
850MAKEDEPEND_PLAIN = makedepend
851MAKEDEPEND = $(FORCEMASK);$(MAKEDEPEND_PLAIN)
852
853#SEP:=--------------------------------------------------------------------------------
854SEP=[`date +%M:%S.%N`] ------------------------------------------------
855# to analyse timings run
856# make -j9 clean; make -j9 all  | grep '^\[' | sort
857# make -j9 "TIMED_TARGET=perl" clean_timed_target | grep '^\[' | sort
858
859# ------------------------------------------------------------ DYNLIBDEFS
860# various dynamic library definitions for linking executables:
861#
862# SYSLIBS:    system libraries needed by database lib
863# ARBDB_LIB:  database lib
864# DBSYS_LIBS: executable using database (but no GUI)
865# GUI_LIBS:   executable using database and GUI (arb gui uses database)
866#
867# Note: definitions exported to sub-makefiles are described in SOURCE_TOOLS/parent_make.txt
868
869CORE_LIB=-lCORE
870ARBDB_LIB=-lARBDB $(CORE_LIB)
871DBSYS_LIBS = $(ARBDB_LIB) $(SYSLIBS)
872
873GUI_LIBS_PREFIX:=
874ifeq ($(DARWIN),1)
875# this seem to be added at wrong place, since opengl is only needed to link EDIT4
876 GUI_LIBS_PREFIX:=-framework GLUT -framework OpenGL
877endif
878
879GUI_LIBS=$(GUI_LIBS_PREFIX) $(DBSYS_LIBS) -lAWT -lWINDOW $(XLIBS)
880
881LIBPATH = -L$(ARBHOME)/lib
882
883DEST_LIB = lib
884DEST_BIN = bin
885
886CC_INCLUDES  := -I. -I$(ARBHOME)/INCLUDE $(XINCLUDES) $(ARB_GLIB_INCLUDE)
887CXX_INCLUDES := $(CC_INCLUDES)
888MAKEDEPENDFLAGS := -- -DARB_OPENGL -DUNIT_TESTS -D__cplusplus -I. -Y$(ARBHOME)/INCLUDE
889
890# -------------------------------
891#     old PTSERVER or PTPAN?
892
893ifeq ($(PTPAN),1)
894# PTPAN only libs
895 ARCHS_PT_SERVER = \
896        ptpan/PROBE.a
897else
898 ifeq ($(PTPAN),2)
899# special mode to compile both servers (developers only!)
900  ARCHS_PT_SERVER = \
901        ptpan/PROBE.a \
902        PROBE/PROBE.a
903  ARCHS_PT_SERVER_LINK = PROBE/PROBE.a# default to old ptserver
904 else
905# PT-server only libs
906  ARCHS_PT_SERVER = \
907        PROBE/PROBE.a
908 endif
909endif
910
911ifndef ARCHS_PT_SERVER_LINK
912 ARCHS_PT_SERVER_LINK = $(ARCHS_PT_SERVER)
913endif
914
915# ---------------------------------------
916# wrap main()
917
918use_ARB_main=$(ARBHOME)/SOURCE_TOOLS/arb_main_cpp.o
919use_ARB_main_C=$(ARBHOME)/SOURCE_TOOLS/arb_main_c.o
920
921# -----------------------------------------
922#     export variables to submakefiles
923
924include SOURCE_TOOLS/export2sub
925
926# do not define (exported) variables below this point
927
928# -------------------------
929#     Main arb targets:
930# -------------------------
931
932first_target:
933                $(MAKE) checks
934                @echo $(SEP)
935                @echo 'Main targets:'
936                @echo ''
937                @echo ' all         - Compile ARB + TOOLs + and copy shared libs + link foreign software'
938                @echo '               (That is most likely the target you want)'
939                @echo ''
940                @echo ' clean       - remove generated files ("SUBDIR/SUBDIR.clean" to clean only SUBDIR)'
941                @echo ' rebuild     - clean + all'
942                @echo ' cleanlinked - remove all binaries'
943                @echo ' relink      - cleanlinked + all (=relink all from objects)'
944                @echo ''
945                @echo 'Some often used sub targets (make all makes them all):'
946                @echo ''
947                @echo ' arb         - Just compile ARB (but none of the integrated tools)'
948                @echo ' menus       - create lib/gde/arb.menu from GDEHELP/ARB_GDEmenus.source'
949                @echo ' perl        - Compile the PERL XSUBS into lib/ARB.so  and create links in lib to perl'
950                @echo ' binlink     - Create all links in the bin directory'
951                @echo ''
952                @echo 'Development targets:'
953                @echo ''
954                @echo ' depends      - create or update dependencies ("SUBDIR/SUBDIR.depends" to update only SUBDIR)'
955                @echo ' proto        - create or update prototypes ("SUBDIR/SUBDIR.proto" to update only SUBDIR)'
956                @echo ' tags         - create tags for xemacs'
957                @echo ' show         - show available shortcuts (AKA subtargets)'
958                @echo ' up           - shortcut for depends+proto+tags'
959ifeq ($(UNIT_TESTS),1)
960                @echo ' ut                    - only run tests'
961                @echo ' "UNIT=..." oneunit    - build one unit and run tests (see also UNIT_TESTER/Makefile.setup.local)'
962endif
963ifneq ($(SANITIZE),0)
964                @echo ' sanitize     - all + run arb_ntree with sanitizer (test.arb + execute _logged)'
965endif
966                @echo ' modified     - rebuild files modified in svn checkout (does touch)'
967                @echo ' touch        - touch files modified in svn checkout'
968                @echo ''
969                @echo 'Internal maintenance:'
970                @echo ''
971                @echo ' relinfo     - show help on release targets'
972                @echo ' tarfile     - make rebuild and create arb version tarfile ("tarfile_quick" to skip rebuild)'
973                @echo ' save        - save all basic ARB sources into arbsrc_DATE ("savetest" to check filelist)'
974                @echo ' patch       - save svn diff to patchfile'
975                @echo ' source_doc  - create doxygen documentation'
976                @echo ' relocated   - rebuild partly (use when you have relocated ARBHOME)'
977                @echo ' check_res   - check resource usage'
978                @echo ' dep_graph   - Build dependency graphs'
979                @echo ' clean_cov   - Clean coverage results'
980                @echo ''
981                @echo ' clean_opengl_changed - clean after changing OPENGL setting in config.Makefile'
982                @echo ' clean_checked_vect   - clean units containing vectorization checks'
983                @echo ''
984                @echo ' post_commit_check - Checks whether'
985                @echo '                     * main make targets work,'
986                @echo '                     * dependencies and prototypes are up to date,'
987                @echo '                     * SVN-controlled files remain unaffected by called targets and'
988                @echo '                     * all generated files are ignored.'
989                @echo '                     (has to be called in a clean SVN checkout)'
990                @echo $(SEP)
991                @echo ''
992
993relinfo:
994                @echo ''
995                @echo $(SEP)
996                @echo 'Release targets:'
997                @echo ''
998                @echo ' inc_candi     - increase RC candidate-number  (only possible in "rc" branch, not needed for RC1)'
999                @echo ' inc_patch     - increase release patchlevel   (only possible in "stable" branch)'
1000                @echo ' inc_minor     - increase minor version number (only possible in "trunk")'
1001                @echo ' inc_major     - increase MAJOR version number (only possible in "trunk")'
1002                @echo ''
1003                @echo ' show_version  - show version tag'
1004                @echo ''
1005                @echo $(SEP)
1006                @echo ''
1007
1008# auto-generate config.makefile:
1009
1010CONFIG_MAKEFILE_FOUND=$(wildcard config.makefile)
1011
1012config.makefile : config.makefile.template
1013                @echo --------------------------------------------------------------------------------
1014ifeq ($(strip $(CONFIG_MAKEFILE_FOUND)),)
1015                @cp $< $@
1016                @echo '$(ARBHOME)/$@:1: has been generated.'
1017                @echo 'Please edit $@ to configure your system!'
1018                @echo --------------------------------------------------------------------------------
1019                @false
1020else
1021                @echo '$(ARBHOME)/$<:1: is more recent than'
1022                @echo '$(ARBHOME)/$@:1:'
1023                @ls -al config.makefile*
1024                @echo --------------------------------------------------------------------------------
1025                @echo "Updating $@ (if this fails, check manually)"
1026                SOURCE_TOOLS/update_config_makefile.pl
1027                @echo "Sucessfully updated $@"
1028                @echo --------------------------------------------------------------------------------
1029                @ls -al config.makefile*
1030                @echo --------------------------------------------------------------------------------
1031                @echo "Diff to your old config.makefile:"
1032                @echo --------------------------------------------------------------------------------
1033                -diff $@.bak $@
1034                @echo --------------------------------------------------------------------------------
1035endif
1036
1037# check if everything is configured correctly
1038
1039check_DEVELOPER:
1040ifndef DEVELOPER
1041                @echo 'config.makefile:1: DEVELOPER not defined'
1042                @false
1043endif
1044
1045check_DEBUG:
1046ifndef dflags
1047                @echo 'config.makefile:1: DEBUG has to be defined. Valid values are 0 and 1'
1048                @false
1049endif
1050
1051check_ARB_64:
1052ifndef ARB_64
1053                @echo 'config.makefile:1: ARB_64 has to be defined. Valid values are 0 and 1'
1054                @false
1055endif
1056
1057# ---------------------------------------- check gcc version
1058
1059COMPILER_BROKEN:=0
1060
1061ifeq ('$(COMPILER_VERSION_ALLOWED)', '4.6.4')
1062COMPILER_BROKEN:=1
1063endif
1064ifeq ('$(COMPILER_VERSION_ALLOWED)', '4.8.0')
1065COMPILER_BROKEN:=1
1066endif
1067
1068check_same_GCC_VERSION:
1069                $(ARBHOME)/SOURCE_TOOLS/check_same_compiler_version.pl $(COMPILER_NAME) $(COMPILER_VERSION_ALLOWED)
1070
1071check_GCC_VERSION:
1072                @echo 'Compiler version check:'
1073# see .@ALLOWED_gcc_VERSIONS
1074ifeq ('$(COMPILER_VERSION_ALLOWED)', '')
1075                @echo "  - Your compiler is '$(COMPILER_NAME)' version '$(COMPILER_VERSION)'"
1076                @echo '    This version is not in the list of supported $(COMPILER_NAME)-versions:'
1077                @$(foreach version,$(ALLOWED_COMPILER_VERSIONS),echo '    * $(version)';)
1078                @echo '  - You may either ..'
1079                @echo '    - add your version to ALLOWED_$(COMPILER_NAME)_VERSIONS in the Makefile and try it out or'
1080                @echo '    - switch to one of the allowed versions (see arb_README_gcc.txt for installing'
1081                @echo '      a different version of gcc)'
1082                $(error Unsupported compiler '$(COMPILER_NAME)' version '$(COMPILER_VERSION)')
1083else
1084 ifeq ($(COMPILER_BROKEN),1)
1085                $(error compilation refused for $(COMPILER_NAME) version '$(COMPILER_VERSION_ALLOWED)'. Refer to http://bugs.arb-home.de/wiki/GccVersionInfo for details.)
1086 else
1087                @echo "  - Supported $(COMPILER_NAME) version '$(COMPILER_VERSION_ALLOWED)' detected - fine!"
1088                @echo ''
1089  ifeq ($(USE_CLANG),1)
1090                @echo "Dump clang version:"
1091                $(A_CXX) -v
1092  endif
1093                $(MAKE) check_same_GCC_VERSION
1094 endif
1095endif
1096
1097#---------------------- check ARBHOME
1098
1099# use arb_INSTALL.txt to determine whether ARBHOME points to correct directory
1100ARB_INSTALL_FOUND=$(wildcard $(ARBHOME)/arb_INSTALL.txt)
1101
1102check_ARBHOME:
1103ifeq ($(strip $(ARB_INSTALL_FOUND)),)
1104                @echo ------------------------------------------------------------
1105                @echo "ARBHOME is set to '$(ARBHOME)'"
1106                @echo "The environment variable ARBHOME has to point to the top arb source directory."
1107                @echo "If you use bash enter:"
1108                @echo "          export ARBHOME='`pwd`'"
1109                @echo ------------------------------------------------------------
1110                @false
1111endif
1112
1113ARB_PATH_SET=$(findstring $(ARBHOME)/bin,$(PATH))
1114
1115check_PATH: check_ARBHOME
1116ifeq ($(strip $(ARB_PATH_SET)),)
1117                @echo ------------------------------------------------------------
1118                @echo "The environment variable PATH has to contain $(ARBHOME)/bin"
1119                @echo "If you use bash enter:"
1120                @echo '                 export PATH=$$ARBHOME/bin:$$PATH'
1121                @echo ------------------------------------------------------------
1122                @false
1123endif
1124
1125check_TOOLS:
1126        @util/arb_check_build_env.pl \
1127                "$(A_CC)" \
1128                "$(A_CXX)" \
1129                "$(MAKEDEPEND_PLAIN)" \
1130                "$(LINK_SHARED_LIB)" \
1131                "$(LINK_SHARED_LIB)" \
1132
1133check_ENVIRONMENT : check_PATH check_TOOLS
1134                @echo "-------------------- Environment [start]"
1135                @echo "ARBHOME='$(ARBHOME)'"
1136                @echo "PATH='$(PATH)'"
1137                @echo "LD_LIBRARY_PATH='$(LD_LIBRARY_PATH)'"
1138                @echo "-------------------- Environment [end]"
1139
1140check_tabs: check_setup
1141ifeq ($(DEBUG),1)
1142        @SOURCE_TOOLS/tabBrake.pl
1143endif
1144
1145force_tab_check:
1146        @touch -t 198001010000 SOURCE_TOOLS/stamp.tabBrake
1147        @$(MAKE) check_tabs
1148
1149
1150# ---------------------
1151
1152check_setup: check_ENVIRONMENT check_DEBUG check_ARB_64 check_DEVELOPER check_GCC_VERSION
1153                @echo Your setup seems to be ok.
1154
1155checks: check_setup check_tabs
1156        @rm -f SOURCE_TOOLS/postcompile.sav
1157
1158
1159# end test section ------------------------------
1160
1161# ---------------------------------------
1162# List of standard top level directories
1163#
1164# sub-makefiles have to define the targets
1165# - 'depends' and
1166# - 'clean'
1167#
1168# when adding new libs here, also add a dependency vs 'links' or 'links_non_perl' in .@DD_links_non_perl
1169
1170ARCHS = \
1171                        $(ARCHS_PT_SERVER) \
1172                        AISC/AISC.a \
1173                        AISC_MKPTPS/AISC_MKPTPS.a \
1174                        ARBDB/libARBDB.a \
1175                        CORE/libCORE.a \
1176                        ARB_GDE/ARB_GDE.a \
1177                        AWT/libAWT.a \
1178                        AWTC/AWTC.a \
1179                        AWTI/AWTI.a \
1180                        CONSENSUS_TREE/CONSENSUS_TREE.a \
1181                        CONVERTALN/CONVERTALN.a \
1182                        DBSERVER/DBSERVER.a \
1183                        DIST/DIST.a \
1184                        EDIT4/EDIT4.a \
1185                        EISPACK/EISPACK.a \
1186                        GDE/GDE.a \
1187                        GENOM/GENOM.a \
1188                        GENOM_IMPORT/GENOM_IMPORT.a \
1189                        GL/GL.a \
1190                        ISLAND_HOPPING/ISLAND_HOPPING.a \
1191                        MERGE/MERGE.a \
1192                        MULTI_PROBE/MULTI_PROBE.a \
1193                        NALIGNER/NALIGNER.a \
1194                        NAMES/NAMES.a \
1195                        NAMES_COM/server.a \
1196                        NTREE/NTREE.a \
1197                        PARSIMONY/PARSIMONY.a \
1198                        PERLTOOLS/PERLTOOLS.a \
1199                        PHYLO/PHYLO.a \
1200                        PRIMER_DESIGN/PRIMER_DESIGN.a \
1201                        PROBE_COM/server.a \
1202                        PROBE_DESIGN/PROBE_DESIGN.a \
1203                        PROBE_SET/PROBE_SET.a \
1204                        READSEQ/READSEQ.a \
1205                        RNA3D/RNA3D.a \
1206                        RNACMA/RNACMA.a \
1207                        SECEDIT/SECEDIT.a \
1208                        SEQ_QUALITY/SEQ_QUALITY.a \
1209                        SERVERCNTRL/SERVERCNTRL.a \
1210                        SL/SL.a \
1211                        STAT/STAT.a \
1212                        TOOLS/TOOLS.a \
1213                        TREEGEN/TREEGEN.a \
1214                        UNIT_TESTER/UNIT_TESTER.a \
1215                        WETC/WETC.a \
1216                        WINDOW/libWINDOW.a \
1217                        XML/XML.a \
1218
1219# -----------------------
1220#     library packets
1221
1222ARCHS_CLIENT_PROBE = PROBE_COM/client.a
1223ARCHS_CLIENT_NAMES = NAMES_COM/client.a
1224
1225ARCHS_MAKEBIN = AISC_MKPTPS/AISC_MKPTPS.a AISC/AISC.a
1226
1227# communication libs need aisc and aisc_mkpts:
1228
1229AISC/AISC.dummy: proto_tools
1230
1231comtools: AISC/AISC.dummy
1232
1233ARCHS_SEQUENCE = \
1234                SL/SEQUENCE/SEQUENCE.a \
1235                SL/ALIVIEW/ALIVIEW.a \
1236                SL/PRONUC/PRONUC.a \
1237
1238ARCHS_TREE = \
1239                SL/ARB_TREE/ARB_TREE.a \
1240                SL/FILTER/FILTER.a \
1241                $(ARCHS_SEQUENCE) \
1242
1243# parsimony tree (used by NTREE, PARSIMONY, STAT(->EDIT4), DIST(obsolete!))
1244ARCHS_AP_TREE = \
1245                SL/AP_TREE/AP_TREE.a \
1246                $(ARCHS_TREE) \
1247
1248# --------------------------------------------------------------------------------
1249# dependencies for linking shared libs
1250
1251link_core:      core
1252link_db:        db link_core
1253link_aw:        aw link_db
1254link_awt:       awt link_aw
1255
1256#***************************************************************************************
1257#               Individual_Programs_Section
1258#***************************************************************************************
1259
1260arbmainwrapper:
1261        $(MAKE) -C SOURCE_TOOLS -r mainwrapper
1262
1263
1264#***********************************    arb_ntree **************************************
1265NTREE = bin/arb_ntree
1266ARCHS_NTREE = \
1267                NTREE/NTREE.a \
1268                ARB_GDE/ARB_GDE.a \
1269                SL/GROUP_SEARCH/GROUP_SEARCH.a \
1270                SL/DB_UI/DB_UI.a \
1271                AWTC/AWTC.a \
1272                AWTI/AWTI.a \
1273                CONSENSUS_TREE/CONSENSUS_TREE.a \
1274                GENOM_IMPORT/GENOM_IMPORT.a \
1275                GENOM/GENOM.a \
1276                MERGE/MERGE.a \
1277                MULTI_PROBE/MULTI_PROBE.a \
1278                PRIMER_DESIGN/PRIMER_DESIGN.a \
1279                PROBE_DESIGN/PROBE_DESIGN.a \
1280                SEQ_QUALITY/SEQ_QUALITY.a \
1281                SERVERCNTRL/SERVERCNTRL.a \
1282                SL/ALILINK/ALILINK.a \
1283                SL/AW_NAME/AW_NAME.a \
1284                SL/CONSENSUS/CONSENSUS.a \
1285                SL/DB_SCANNER/DB_SCANNER.a \
1286                SL/DB_QUERY/DB_QUERY.a \
1287                SL/QUERY/QUERY.a \
1288                SL/SEQIO/SEQIO.a \
1289                STAT/STAT.a \
1290                SL/GUI_ALIVIEW/GUI_ALIVIEW.a \
1291                SL/HELIX/HELIX.a \
1292                SL/REGEXPR/REGEXPR.a \
1293                SL/REFENTRIES/REFENTRIES.a \
1294                SL/NDS/NDS.a \
1295                SL/ITEM_SHADER/ITEM_SHADER.a \
1296                SL/ITEMS/ITEMS.a \
1297                SL/INSDEL/INSDEL.a \
1298                SL/LOCATION/LOCATION.a \
1299                SL/MACROS/MACROS.a \
1300                SL/PVP/PVP.a \
1301                SL/TRANSLATE/TRANSLATE.a \
1302                SL/TREEDISP/TREEDISP.a \
1303                SL/TREE_ADMIN/TREE_ADMIN.a \
1304                SL/TREE_READ/TREE_READ.a \
1305                SL/TREE_WRITE/TREE_WRITE.a \
1306                XML/XML.a \
1307                $(ARCHS_AP_TREE) \
1308
1309$(NTREE): $(ARCHS_NTREE:.a=.dummy) link_awt
1310        @SOURCE_TOOLS/binuptodate.pl $@ $(ARCHS_NTREE) $(GUI_LIBS) $(use_ARB_main) || ( \
1311                echo "$(SEP) Link $@"; \
1312                echo "$(LINK_EXECUTABLE) $@ $(use_ARB_main) $(LIBPATH) $(ARCHS_NTREE) $(ARCHS_CLIENT_PROBE) $(GUI_LIBS) $(XMLLIBS)" ; \
1313                $(LINK_EXECUTABLE) $@ $(use_ARB_main) $(LIBPATH) $(ARCHS_NTREE) $(ARCHS_CLIENT_PROBE) $(GUI_LIBS) $(XMLLIBS) && \
1314                echo "$(SEP) Link $@ [done]"; \
1315                )
1316
1317#***********************************    arb_edit4 **************************************
1318EDIT4 = bin/arb_edit4
1319
1320ARCHS_EDIT4 := \
1321                EDIT4/EDIT4.a \
1322                ARB_GDE/ARB_GDE.a \
1323                SL/FAST_ALIGNER/FAST_ALIGNER.a \
1324                AWTC/AWTC.a \
1325                ISLAND_HOPPING/ISLAND_HOPPING.a \
1326                SECEDIT/SECEDIT.a \
1327                SERVERCNTRL/SERVERCNTRL.a \
1328                SL/AW_HELIX/AW_HELIX.a \
1329                SL/AW_NAME/AW_NAME.a \
1330                SL/CONSENSUS/CONSENSUS.a \
1331                SL/ITEMS/ITEMS.a \
1332                STAT/STAT.a \
1333                SL/GUI_ALIVIEW/GUI_ALIVIEW.a \
1334                SL/HELIX/HELIX.a \
1335                SL/TRANSLATE/TRANSLATE.a \
1336                SL/MACROS/MACROS.a \
1337                SL/NDS/NDS.a \
1338                $(ARCHS_AP_TREE) \
1339                XML/XML.a \
1340
1341ifeq ($(OPENGL),1)
1342ARCHS_EDIT4 += RNA3D/RNA3D.a
1343endif
1344
1345LIBS_EDIT4 := $(GL_LIBS)
1346
1347$(EDIT4): $(ARCHS_EDIT4:.a=.dummy) link_awt
1348        @SOURCE_TOOLS/binuptodate.pl $@ $(ARCHS_EDIT4) $(GUI_LIBS) $(use_ARB_main) || ( \
1349                echo "$(SEP) Link $@"; \
1350                echo "$(LINK_EXECUTABLE) $@ $(use_ARB_main) $(LIBPATH) $(ARCHS_EDIT4) $(ARCHS_CLIENT_NAMES) $(GUI_LIBS) $(LIBS_EDIT4)" ; \
1351                $(LINK_EXECUTABLE) $@ $(use_ARB_main) $(LIBPATH) $(ARCHS_EDIT4) $(ARCHS_CLIENT_NAMES) $(GUI_LIBS) $(LIBS_EDIT4) && \
1352                echo "$(SEP) Link $@ [done]"; \
1353                )
1354
1355#***********************************    arb_rnacma **************************************
1356RNACMA = bin/arb_rnacma
1357ARCHS_RNACMA = \
1358                RNACMA/RNACMA.a \
1359
1360$(RNACMA) : $(ARCHS_RNACMA:.a=.dummy) link_db
1361        @SOURCE_TOOLS/binuptodate.pl $@ $(ARCHS_RNACMA) || ( \
1362                echo "$(SEP) Link $@"; \
1363                echo "$(LINK_EXECUTABLE) $@ $(LIBPATH) $(ARCHS_RNACMA) $(DBSYS_LIBS)"; \
1364                $(LINK_EXECUTABLE) $@ $(LIBPATH) $(ARCHS_RNACMA) $(DBSYS_LIBS) && \
1365                echo "$(SEP) Link $@ [done]"; \
1366                )
1367
1368#***********************************    arb_wetc **************************************
1369WETC = bin/arb_wetc
1370ARCHS_WETC = \
1371                WETC/WETC.a \
1372                SL/HELIX/HELIX.a \
1373                SL/FILTER/FILTER.a \
1374                XML/XML.a \
1375
1376$(WETC): $(ARCHS_WETC:.a=.dummy) link_awt
1377        @SOURCE_TOOLS/binuptodate.pl $@ $(ARCHS_WETC) $(GUI_LIBS) $(use_ARB_main) || ( \
1378                echo "$(SEP) Link $@"; \
1379                echo "$(LINK_EXECUTABLE) $@ $(use_ARB_main) $(LIBPATH) $(ARCHS_WETC) $(GUI_LIBS)" ; \
1380                $(LINK_EXECUTABLE) $@ $(use_ARB_main) $(LIBPATH) $(ARCHS_WETC) $(GUI_LIBS) && \
1381                echo "$(SEP) Link $@ [done]"; \
1382                )
1383
1384#***********************************    arb_dist **************************************
1385DIST = bin/arb_dist
1386ARCHS_DIST = \
1387                DIST/DIST.a \
1388                CONSENSUS_TREE/CONSENSUS_TREE.a \
1389                EISPACK/EISPACK.a \
1390                SERVERCNTRL/SERVERCNTRL.a \
1391                SL/GUI_ALIVIEW/GUI_ALIVIEW.a \
1392                SL/HELIX/HELIX.a \
1393                SL/MATRIX/MATRIX.a \
1394                SL/MACROS/MACROS.a \
1395                SL/NDS/NDS.a \
1396                SL/ITEMS/ITEMS.a \
1397                SL/NEIGHBOURJOIN/NEIGHBOURJOIN.a \
1398                XML/XML.a \
1399                $(ARCHS_AP_TREE) \
1400
1401$(DIST): $(ARCHS_DIST:.a=.dummy) link_awt
1402        @SOURCE_TOOLS/binuptodate.pl $@ $(ARCHS_DIST) $(GUI_LIBS) $(use_ARB_main) || ( \
1403                echo "$(SEP) Link $@"; \
1404                echo "$(LINK_EXECUTABLE) $@ $(use_ARB_main) $(LIBPATH) $(ARCHS_DIST) $(ARCHS_CLIENT_PROBE) $(GUI_LIBS)" ; \
1405                $(LINK_EXECUTABLE) $@ $(use_ARB_main) $(LIBPATH) $(ARCHS_DIST) $(ARCHS_CLIENT_PROBE) $(GUI_LIBS) && \
1406                echo "$(SEP) Link $@ [done]"; \
1407                )
1408
1409#***********************************    arb_pars **************************************
1410PARSIMONY = bin/arb_pars
1411ARCHS_PARSIMONY = \
1412                PARSIMONY/PARSIMONY.a \
1413                SERVERCNTRL/SERVERCNTRL.a \
1414                SL/AW_NAME/AW_NAME.a \
1415                SL/GUI_ALIVIEW/GUI_ALIVIEW.a \
1416                SL/HELIX/HELIX.a \
1417                SL/MACROS/MACROS.a \
1418                SL/NDS/NDS.a \
1419                SL/ITEMS/ITEMS.a \
1420                SL/TRANSLATE/TRANSLATE.a \
1421                SL/TREEDISP/TREEDISP.a \
1422                XML/XML.a \
1423                $(ARCHS_AP_TREE) \
1424
1425$(PARSIMONY): $(ARCHS_PARSIMONY:.a=.dummy) link_awt
1426        @SOURCE_TOOLS/binuptodate.pl $@ $(ARCHS_PARSIMONY) $(GUI_LIBS) $(use_ARB_main) || ( \
1427                echo "$(SEP) Link $@"; \
1428                echo "$(LINK_EXECUTABLE) $@ $(use_ARB_main) $(LIBPATH) $(ARCHS_PARSIMONY) $(ARCHS_CLIENT_NAMES) $(GUI_LIBS)" ; \
1429                $(LINK_EXECUTABLE) $@ $(use_ARB_main) $(LIBPATH) $(ARCHS_PARSIMONY) $(ARCHS_CLIENT_NAMES) $(GUI_LIBS) && \
1430                echo "$(SEP) Link $@ [done]"; \
1431                )
1432
1433#*********************************** arb_convert_aln **************************************
1434CONVERT_ALN = bin/arb_convert_aln
1435ARCHS_CONVERT_ALN =     \
1436                CONVERTALN/CONVERTALN.a \
1437
1438$(CONVERT_ALN) : $(ARCHS_CONVERT_ALN:.a=.dummy) link_db
1439        @SOURCE_TOOLS/binuptodate.pl $@ $(ARCHS_CONVERT_ALN) $(use_ARB_main) || ( \
1440                echo "$(SEP) Link $@"; \
1441                echo "$(LINK_EXECUTABLE) $@ $(use_ARB_main) $(LIBPATH) $(ARCHS_CONVERT_ALN) $(DBSYS_LIBS)"; \
1442                $(LINK_EXECUTABLE) $@ $(use_ARB_main) $(LIBPATH) $(ARCHS_CONVERT_ALN) $(DBSYS_LIBS) && \
1443                echo "$(SEP) Link $@ [done]"; \
1444                )
1445
1446#*********************************** arb_treegen **************************************
1447
1448TREEGEN = bin/arb_treegen
1449ARCHS_TREEGEN = \
1450                TREEGEN/TREEGEN.a \
1451
1452$(TREEGEN) :  $(ARCHS_TREEGEN:.a=.dummy)
1453        @SOURCE_TOOLS/binuptodate.pl $@ $(ARCHS_TREEGEN) $(use_ARB_main_C) || ( \
1454                echo "$(SEP) Link $@"; \
1455                echo "$(LINK_EXECUTABLE) $@ $(use_ARB_main_C) $(LIBPATH) $(ARCHS_TREEGEN)" ; \
1456                $(LINK_EXECUTABLE) $@ $(use_ARB_main_C) $(LIBPATH) $(ARCHS_TREEGEN) && \
1457                echo "$(SEP) Link $@ [done]"; \
1458                )
1459
1460#***********************************    arb_naligner **************************************
1461NALIGNER = bin/arb_naligner
1462ARCHS_NALIGNER = \
1463                NALIGNER/NALIGNER.a \
1464                SERVERCNTRL/SERVERCNTRL.a \
1465                SL/HELIX/HELIX.a \
1466
1467$(NALIGNER): $(ARCHS_NALIGNER:.a=.dummy) link_db
1468        @SOURCE_TOOLS/binuptodate.pl $@ $(ARCHS_NALIGNER) $(use_ARB_main) || ( \
1469                echo "$(SEP) Link $@"; \
1470                echo "$(LINK_EXECUTABLE) $@ $(use_ARB_main) $(LIBPATH) $(ARCHS_NALIGNER) $(ARCHS_CLIENT_PROBE) $(DBSYS_LIBS)" ; \
1471                $(LINK_EXECUTABLE) $@ $(use_ARB_main) $(LIBPATH) $(ARCHS_NALIGNER) $(ARCHS_CLIENT_PROBE) $(DBSYS_LIBS) && \
1472                echo "$(SEP) Link $@ [done]"; \
1473                )
1474
1475#***********************************    arb_phylo **************************************
1476PHYLO = bin/arb_phylo
1477ARCHS_PHYLO = \
1478                PHYLO/PHYLO.a \
1479                SL/HELIX/HELIX.a \
1480                SL/FILTER/FILTER.a \
1481                SL/MACROS/MACROS.a \
1482                XML/XML.a \
1483
1484$(PHYLO): $(ARCHS_PHYLO:.a=.dummy) link_awt
1485        @SOURCE_TOOLS/binuptodate.pl $@ $(ARCHS_PHYLO) $(GUI_LIBS) $(use_ARB_main) || ( \
1486                echo "$(SEP) Link $@"; \
1487                echo "$(LINK_EXECUTABLE) $@ $(use_ARB_main) $(LIBPATH) $(ARCHS_PHYLO) $(GUI_LIBS)" ; \
1488                $(LINK_EXECUTABLE) $@ $(use_ARB_main) $(LIBPATH) $(ARCHS_PHYLO) $(GUI_LIBS) && \
1489                echo "$(SEP) Link $@ [done]"; \
1490                )
1491
1492#***************************************************************************************
1493#                                       SERVER SECTION
1494#***************************************************************************************
1495
1496#***********************************    arb_db_server **************************************
1497DBSERVER = bin/arb_db_server
1498ARCHS_DBSERVER = \
1499                DBSERVER/DBSERVER.a \
1500                SERVERCNTRL/SERVERCNTRL.a \
1501
1502$(DBSERVER): $(ARCHS_DBSERVER:.a=.dummy) link_db
1503        @SOURCE_TOOLS/binuptodate.pl $@ $(ARCHS_DBSERVER) $(ARBDB_LIB) $(use_ARB_main) || ( \
1504                echo "$(SEP) Link $@"; \
1505                echo "$(LINK_EXECUTABLE) $@ $(use_ARB_main) $(LIBPATH) $(ARCHS_DBSERVER) $(ARBDB_LIB) $(ARCHS_CLIENT_PROBE) $(SYSLIBS)" ; \
1506                $(LINK_EXECUTABLE) $@ $(use_ARB_main) $(LIBPATH) $(ARCHS_DBSERVER) $(ARBDB_LIB) $(ARCHS_CLIENT_PROBE) $(SYSLIBS) && \
1507                echo "$(SEP) Link $@ [done]"; \
1508                )
1509
1510#***********************************    arb_pt_server **************************************
1511PROBE = bin/arb_pt_server
1512ARCHS_PROBE_COMMON = \
1513                SL/PTCLEAN/PTCLEAN.a \
1514                SERVERCNTRL/SERVERCNTRL.a \
1515                SL/HELIX/HELIX.a \
1516
1517ARCHS_PROBE_LINK = \
1518                $(ARCHS_PT_SERVER_LINK) \
1519                $(ARCHS_PROBE_COMMON) \
1520
1521ARCHS_PROBE_DEPEND = \
1522                $(ARCHS_PT_SERVER) \
1523                $(ARCHS_PROBE_COMMON) \
1524
1525$(PROBE): $(ARCHS_PROBE_DEPEND:.a=.dummy) link_db
1526        @SOURCE_TOOLS/binuptodate.pl $@ $(ARCHS_PROBE_LINK) $(ARBDB_LIB) $(ARCHS_SERVER_PROBE) config.makefile $(use_ARB_main) || ( \
1527                echo "$(SEP) Link $@"; \
1528                echo "$(LINK_EXECUTABLE) $@ $(use_ARB_main) $(LIBPATH) $(ARCHS_PROBE_LINK) $(ARCHS_CLIENT_PROBE) $(ARBDB_LIB) $(SYSLIBS)" ; \
1529                $(LINK_EXECUTABLE) $@ $(use_ARB_main) $(LIBPATH) $(ARCHS_PROBE_LINK) $(ARCHS_CLIENT_PROBE) $(ARBDB_LIB) $(SYSLIBS) && \
1530                echo "$(SEP) Link $@ [done]"; \
1531                )
1532
1533#***********************************    arb_name_server **************************************
1534NAMES = bin/arb_name_server
1535ARCHS_NAMES = \
1536                NAMES/NAMES.a \
1537                SERVERCNTRL/SERVERCNTRL.a \
1538
1539$(NAMES): $(ARCHS_NAMES:.a=.dummy) link_db
1540        @SOURCE_TOOLS/binuptodate.pl $@ $(ARCHS_NAMES) $(ARBDB_LIB) $(ARCHS_CLIENT_NAMES) $(use_ARB_main) || ( \
1541                echo "$(SEP) Link $@"; \
1542                echo "$(LINK_EXECUTABLE) $@ $(use_ARB_main) $(LIBPATH) $(ARCHS_NAMES) $(ARBDB_LIB) $(ARCHS_CLIENT_NAMES) NAMES_COM/server.a $(SYSLIBS)" ; \
1543                $(LINK_EXECUTABLE) $@ $(use_ARB_main) $(LIBPATH) $(ARCHS_NAMES) $(ARBDB_LIB) $(ARCHS_CLIENT_NAMES) NAMES_COM/server.a $(SYSLIBS) && \
1544                echo "$(SEP) Link $@ [done]"; \
1545                )
1546
1547#***********************************    SHARED LIBRARIES SECTION  **************************************
1548
1549prepare_libdir: addlibs
1550
1551addlibs:
1552        (perl $(ARBHOME)/SOURCE_TOOLS/provide_libs.pl \
1553                                "arbhome=$(ARBHOME)" \
1554                                "opengl=$(OPENGL)" \
1555                                "link_static=$(LINK_STATIC)" \
1556        )
1557
1558#***************************************************************************************
1559#                       Recursive calls to sub-makefiles
1560#***************************************************************************************
1561
1562%.depends:
1563        @cp -p $(@D)/Makefile $(@D)/Makefile.old # save old Makefile
1564        @$(MAKE) -C $(@D) -r \
1565                "AUTODEPENDS=1" \
1566                "MAIN=nothing" \
1567                "cflags=noCflagsHere_use_MAKEDEPENDFLAGS" \
1568                "cxxflags=noCxxflagsHere_use_MAKEDEPENDFLAGS" \
1569                depends
1570        @grep "^# DO NOT DELETE" $(@D)/Makefile >/dev/null
1571        @cat $(@D)/Makefile \
1572                | SOURCE_TOOLS/fix_depends.pl "(from main)" \
1573                >$(@D)/Makefile.2
1574        @mv $(@D)/Makefile.old $(@D)/Makefile # restore old Makefile
1575        @$(ARBHOME)/SOURCE_TOOLS/mv_if_diff $(@D)/Makefile.2 $(@D)/Makefile # update Makefile if changed
1576
1577%.proto:
1578        @($(MAKE) -C $(@D) \
1579                "AUTODEPENDS=0" \
1580                "MAIN=nothing" \
1581                "cflags=noCflags" \
1582                "cxxflags=noCxxflags" \
1583                proto 2>&1 ) | $(ARBHOME)/SOURCE_TOOLS/asan2msg.pl
1584
1585%.clean:
1586        @$(MAKE) -C $(@D) \
1587                "AUTODEPENDS=0" \
1588                "MAIN=nothing" \
1589                "cflags=noCflags" \
1590                "cxxflags=noCxxflags" \
1591                clean
1592
1593
1594# stop wrong targets
1595target_is_missing_lib_prefix:
1596        @echo "Error: Denied to build shared library target with missing 'lib'-prefix"
1597        false
1598
1599ARBDB/ARBDB.dummy:   target_is_missing_lib_prefix
1600CORE/CORE.dummy:     target_is_missing_lib_prefix
1601AWT/AWT.dummy:       target_is_missing_lib_prefix
1602WINDOW/WINDOW.dummy: target_is_missing_lib_prefix
1603
1604# rule to generate main target (normally a library):
1605# @@@ check effect of setting LANG=C below
1606%.dummy:
1607        @( export ID=$$$$; LANG=C; \
1608        (( \
1609            echo "$(SEP) Make $(@D)"; \
1610            $(MAKE) -C $(@D) -r \
1611                "AUTODEPENDS=1" \
1612                "MAIN=$(@F:.dummy=.a)" \
1613                "cflags=$(cflags) -DIN_ARB_$(subst /,_,$(@D))" \
1614                && \
1615            echo "$(SEP) Make $(@D) [done]"; \
1616        ) >$(@D).$$ID.log 2>&1 && (cat $(@D).$$ID.log;rm $(@D).$$ID.log)) || (cat $(@D).$$ID.log;rm $(@D).$$ID.log;false))
1617
1618# Additional dependencies for subtargets:
1619
1620PROBE_COM/PROBE_COM.dummy : comtools
1621NAMES_COM/NAMES_COM.dummy : comtools
1622
1623com: PROBE_COM/PROBE_COM.dummy NAMES_COM/NAMES_COM.dummy
1624
1625PROBE_COM/server.dummy:
1626        @echo Unwanted request to make target $<
1627        false
1628
1629PROBE_COM/client.dummy:
1630        @echo Unwanted request to make target $<
1631        false
1632
1633NAMES_COM/server.dummy:
1634        @echo Unwanted request to make target $<
1635        false
1636
1637NAMES_COM/client.dummy:
1638        @echo Unwanted request to make target $<
1639        false
1640
1641
1642ARBDB/libARBDB.dummy:                   links
1643CORE/libCORE.dummy:                     links
1644
1645PERLTOOLS/PERLTOOLS.dummy:              core db
1646
1647# all subdirs perl not depends on go here (ADD_links_non_perl)
1648AWT/libAWT.dummy:                       links_non_perl
1649AWTI/AWTI.dummy:                        links_non_perl
1650CONSENSUS_TREE/CONSENSUS_TREE.dummy:    links_non_perl
1651CONVERTALN/CONVERTALN.dummy:            links_non_perl
1652DBSERVER/DBSERVER.dummy:                links_non_perl
1653DIST/DIST.dummy:                        links_non_perl
1654EDIT4/EDIT4.dummy:                      links_non_perl com
1655EISPACK/EISPACK.dummy:                  links_non_perl
1656GDE/GDE.dummy:                          links_non_perl
1657GENOM/GENOM.dummy:                      links_non_perl
1658GENOM_IMPORT/GENOM_IMPORT.dummy:        links_non_perl
1659ISLAND_HOPPING/ISLAND_HOPPING.dummy:    links_non_perl
1660MERGE/MERGE.dummy:                      links_non_perl
1661NTREE/NTREE.dummy:                      links_non_perl
1662PARSIMONY/PARSIMONY.dummy:              links_non_perl
1663PHYLO/PHYLO.dummy:                      links_non_perl
1664PRIMER_DESIGN/PRIMER_DESIGN.dummy:      links_non_perl
1665PROBE_SET/PROBE_SET.dummy:              links_non_perl link_db
1666READSEQ/READSEQ.dummy:                  links_non_perl
1667RNACMA/RNACMA.dummy:                    links_non_perl header_libs
1668SECEDIT/SECEDIT.dummy:                  links_non_perl
1669SEQ_QUALITY/SEQ_QUALITY.dummy:          links_non_perl
1670SERVERCNTRL/SERVERCNTRL.dummy:          links_non_perl com
1671SL/ALILINK/ALILINK.dummy:               links_non_perl
1672SL/ALIVIEW/ALIVIEW.dummy:               links_non_perl
1673SL/AP_TREE/AP_TREE.dummy:               links_non_perl
1674SL/ARB_TREE/ARB_TREE.dummy:             links_non_perl
1675SL/AW_HELIX/AW_HELIX.dummy:             links_non_perl
1676SL/CONSENSUS/CONSENSUS.dummy:           links_non_perl
1677SL/DB_QUERY/DB_QUERY.dummy:             links_non_perl
1678SL/DB_SCANNER/DB_SCANNER.dummy:         links_non_perl
1679SL/DB_UI/DB_UI.dummy:                   links_non_perl
1680SL/FAST_ALIGNER/FAST_ALIGNER.dummy:     links_non_perl
1681SL/FILTER/FILTER.dummy:                 links_non_perl
1682SL/FILTSEQEXP/FILTSEQEXP.dummy:         links_non_perl
1683SL/GROUP_SEARCH/GROUP_SEARCH.dummy:     links_non_perl
1684SL/GUI_ALIVIEW/GUI_ALIVIEW.dummy:       links_non_perl
1685SL/HELIX/HELIX.dummy:                   links_non_perl
1686SL/INSDEL/INSDEL.dummy:                 links_non_perl
1687SL/ITEM_SHADER/ITEM_SHADER.dummy:       links_non_perl
1688SL/ITEMS/ITEMS.dummy:                   links_non_perl
1689SL/LOCATION/LOCATION.dummy:             links_non_perl
1690SL/MACROS/MACROS.dummy:                 links_non_perl
1691SL/MATRIX/MATRIX.dummy:                 links_non_perl
1692SL/NDS/NDS.dummy:                       links_non_perl
1693SL/NEIGHBOURJOIN/NEIGHBOURJOIN.dummy:   links_non_perl
1694SL/PRONUC/PRONUC.dummy:                 links_non_perl
1695SL/PTCLEAN/PTCLEAN.dummy:               links_non_perl link_db
1696SL/PVP/PVP.dummy:                       links_non_perl
1697SL/QUERY/QUERY.dummy:                   links_non_perl link_db
1698SL/REFENTRIES/REFENTRIES.dummy:         links_non_perl
1699SL/REGEXPR/REGEXPR.dummy:               links_non_perl
1700SL/SEQIO/SEQIO.dummy:                   links_non_perl
1701SL/SEQUENCE/SEQUENCE.dummy:             links_non_perl
1702SL/TRANSLATE/TRANSLATE.dummy:           links_non_perl
1703SL/TREE_ADMIN/TREE_ADMIN.dummy:         links_non_perl
1704SL/TREE_READ/TREE_READ.dummy:           links_non_perl
1705SL/TREE_WRITE/TREE_WRITE.dummy:         links_non_perl
1706SL/TREEDISP/TREEDISP.dummy:             links_non_perl
1707STAT/STAT.dummy:                        links_non_perl
1708TREEGEN/TREEGEN.dummy:                  links_non_perl
1709WETC/WETC.dummy:                        links_non_perl
1710WINDOW/libWINDOW.dummy:                 links_non_perl
1711XML/XML.dummy:                          links_non_perl
1712
1713ifeq ($(OPENGL),1)
1714GL/glAW/glAW.dummy: links_non_perl
1715GL/glpng/glpng.dummy: links_non_perl
1716GL/GL.dummy: GL/glAW/glAW.dummy GL/glpng/glpng.dummy
1717RNA3D/RNA3D.dummy: links_non_perl gl
1718endif
1719
1720UNIT_TESTER/UNIT_TESTER.dummy:          link_db \
1721        SERVERCNTRL/SERVERCNTRL.dummy \
1722
1723# see also TOOLS/Makefile@TOOLSLIBDEPENDS
1724TOOLS/TOOLS.dummy : links_non_perl link_db \
1725        CONSENSUS_TREE/CONSENSUS_TREE.dummy \
1726        SERVERCNTRL/SERVERCNTRL.dummy \
1727        SL/FILTER/FILTER.dummy \
1728        SL/FILTSEQEXP/FILTSEQEXP.dummy \
1729        SL/INSDEL/INSDEL.dummy \
1730        SL/REGEXPR/REGEXPR.dummy \
1731        SL/SEQIO/SEQIO.dummy \
1732        SL/TREE_READ/TREE_READ.dummy \
1733        SL/TREE_WRITE/TREE_WRITE.dummy \
1734        XML/XML.dummy \
1735
1736AWTC/AWTC.dummy :                       com
1737
1738NAMES/NAMES.dummy :                     com
1739SL/AW_NAME/AW_NAME.dummy :              com
1740
1741PROBE/PROBE.dummy :                     com
1742ptpan/PROBE.dummy :                     com
1743MULTI_PROBE/MULTI_PROBE.dummy :         com
1744PROBE_DESIGN/PROBE_DESIGN.dummy :       com
1745NALIGNER/NALIGNER.dummy :               com
1746
1747ARB_GDE/ARB_GDE.dummy :                 proto_tools
1748
1749compile_compatibility: SOURCE_TOOLS/COMPILE_COMPAT/COMPILE_COMPAT.dummy
1750
1751#***************************************************************************************
1752#                       Short aliases to make targets
1753#***************************************************************************************
1754
1755show:
1756                @echo $(SEP)
1757                @echo 'Aliases for often needed targets:'
1758                @echo ''
1759                @echo ' executables:'
1760                @echo ''
1761                @echo '  nt     arb_ntree'
1762                @echo '  e4     arb_edit4 (includes secedit)'
1763                @echo '  di     arb_dist'
1764                @echo '  ph     arb_phylo'
1765                @echo '  pa     arb_parsimony'
1766                @echo '  tg     arb_treegen'
1767                @echo '  ds     arb_dbserver'
1768                @echo '  pt     arb_pt_server'
1769                @echo '  na     arb_name_server'
1770                @echo ''
1771                @echo ' libraries:'
1772                @echo ''
1773                @echo '  com    communication libraries'
1774                @echo '  db     ARB database'
1775                @echo '  aw     GUI lib'
1776                @echo '  awt    GUI toolkit'
1777                @echo '  awtc   general purpose library'
1778                @echo '  awti   import/export library'
1779                @echo '  mp     multi probe library'
1780                @echo '  ge     genome library'
1781                @echo '  pd     probe design lib'
1782                @echo '  prd    primer design lib'
1783                @echo ''
1784                @echo ' other targets:'
1785                @echo ''
1786                @echo '  help   recompile help files'
1787                @echo '  tools  make small tools used by arb'
1788                @echo ''
1789                @echo ' foreign targets:'
1790                @echo ''
1791                @echo '  gde    GDE'
1792                @echo '  agde   ARB_GDE'
1793                @echo ''
1794                @echo 'for other targets inspect $(ARBHOME)/Makefile'
1795                @echo ''
1796                @echo $(SEP)
1797
1798source_doc:
1799        @echo "Remove some links (doxygen crashes otherwise):"
1800        find . \( -name "AISC" -o -name "C" -o -name "GDEHELP" \) -type l -exec rm {} \;
1801        doxygen 2>&1 1>/dev/null
1802        $(MAKE) forcelinks
1803
1804dep_graph:
1805        @echo "Building some dependency graphs"
1806        SOURCE_TOOLS/dependency_graphs.pl
1807
1808help:   HELP_SOURCE/HELP_SOURCE.dummy
1809
1810HELP_SOURCE/HELP_SOURCE.dummy: link_core xml menus
1811
1812db:     ARBDB/libARBDB.dummy
1813core:   CORE/libCORE.dummy
1814aw:     WINDOW/libWINDOW.dummy
1815awt:    AWT/libAWT.dummy
1816awtc:   AWTC/AWTC.dummy
1817awti:   AWTI/AWTI.dummy
1818
1819mp:     MULTI_PROBE/MULTI_PROBE.dummy
1820mg:     MERGE/MERGE.dummy
1821ge:     GENOM/GENOM.dummy
1822prd:    PRIMER_DESIGN/PRIMER_DESIGN.dummy
1823
1824nt:     menus $(NTREE)
1825
1826nal:    $(NALIGNER)
1827
1828di:     $(DIST)
1829ph:     $(PHYLO)
1830pa:     $(PARSIMONY)
1831tg:     $(TREEGEN)
1832
1833ifeq ($(OPENGL),1)
18343d:     RNA3D/RNA3D.dummy
1835gl:     GL/GL.dummy
1836else
1837noopengl:
1838        @echo "invalid target for OPENGL=0"
18393d: noopengl
1840gl: noopengl
1841endif
1842
1843SL/SL.dummy: com
1844
1845ds:     $(DBSERVER)
1846pt:     $(PROBE)
1847pst:    PROBE_SET/PROBE_SET.dummy
1848pd:     PROBE_DESIGN/PROBE_DESIGN.dummy
1849na:     $(NAMES)
1850sq:     SEQ_QUALITY/SEQ_QUALITY.dummy
1851cma:    $(RNACMA)
1852
1853sec:    SECEDIT/SECEDIT.dummy
1854
1855e4:     $(EDIT4) readseq menus
1856
1857gi:     GENOM_IMPORT/GENOM_IMPORT.dummy
1858wetc:   $(WETC)
1859
1860xml:    XML/XML.dummy
1861xmlin:  XML_IMPORT/XML_IMPORT.dummy# broken
1862stat:   STAT/STAT.dummy $(NTREE) $(EDIT4)
1863fa:     SL/FAST_ALIGNER/FAST_ALIGNER.dummy
1864
1865#********************************************************************************
1866
1867up_by_remake: depends proto vectorize_checks
1868
1869up: up_by_remake tags valgrind_update
1870
1871#********************************************************************************
1872
1873touch:
1874        SOURCE_TOOLS/touch_modified.pl
1875
1876modified: touch
1877        $(MAKE) all
1878
1879#********************************************************************************
1880
1881libdepends:
1882        $(MAKE) -C "SOURCE_TOOLS" \
1883                "RNA3D_LIB=$(RNA3D_LIB_4_DEPENDS)" \
1884                libdepends
1885
1886#********************************************************************************
1887
1888# create generated headers:
1889genheaders: TEMPLATES/TEMPLATES.dummy
1890
1891clrdotdepends:
1892        rm PROBE_COM/.depends || true
1893        rm NAMES_COM/.depends || true
1894        rm PERL2ARB/.depends || true
1895
1896comdepends: comtools clrdotdepends
1897        @echo "$(SEP) Partially build com interface"
1898        $(MAKE) PROBE_COM/PROBE_COM.depends NAMES_COM/NAMES_COM.depends
1899        $(MAKE) PROBE_COM/server.depends    NAMES_COM/server.depends
1900
1901depends: genheaders comdepends vectorize_checks
1902        @echo "$(SEP) Updating other dependencies"
1903        $(MAKE) $(subst NAMES_COM/server.depends,,$(subst PROBE_COM/server.depends,,$(ARCHS:.a=.depends))) \
1904                HELP_SOURCE/HELP_SOURCE.depends \
1905                SOURCE_TOOLS/COMPILE_COMPAT/COMPILE_COMPAT.depends \
1906
1907        $(MAKE) libdepends
1908
1909depend: depends
1910
1911# ------------------------------------------------------------
1912# dependency generation tests for AISC code
1913#(all should work w/o creating wrong dependencies;
1914# neither in XXX_COM/Makefile nor in code using AISC interface)
1915dependstest1: silent_clean
1916        $(MAKE) depends
1917dependstest2: silent_clean
1918        $(MAKE) com
1919dependstest3: silent_clean
1920        $(MAKE) aw
1921dependstest4: silent_clean
1922        $(MAKE) pt
1923dependstest5: silent_clean
1924        $(MAKE) na
1925dependstest6: silent_clean
1926        $(MAKE) nt
1927dependstest7: silent_clean
1928        $(MAKE) all
1929# ------------------------------------------------------------
1930
1931vectorize_checks:
1932        $(MAKE) -C SOURCE_TOOLS -r vectorize_checks
1933
1934clean_checked_vect: lib/lib.clean
1935        SOURCE_TOOLS/clean_checked_vectorizations.sh
1936
1937# ------------------------------------------------------------
1938
1939AISC_MKPTPS/AISC_MKPTPS.dummy: links
1940
1941proto_tools: AISC_MKPTPS/AISC_MKPTPS.dummy
1942
1943proto: proto_tools
1944        @echo $(SEP) Updating prototypes
1945        $(MAKE) \
1946                ARBDB/ARBDB.proto \
1947                AISC_COM/AISC_COM.proto \
1948                ARB_GDE/ARB_GDE.proto \
1949                CORE/CORE.proto \
1950                CONVERTALN/CONVERTALN.proto \
1951                NTREE/NTREE.proto \
1952                MERGE/MERGE.proto \
1953                $(ARCHS_PT_SERVER:.a=.proto) \
1954                SERVERCNTRL/SERVERCNTRL.proto \
1955                SL/SL.proto \
1956
1957#********************************************************************************
1958
1959valgrind_update: links
1960        @echo $(SEP) Updating for valgrind
1961        $(MAKE) -C SOURCE_TOOLS valgrind_update
1962
1963#********************************************************************************
1964
1965TAGFILE=TAGS
1966TAGFILE_TMP=TAGS.tmp
1967
1968TAG_SOURCE_HEADERS=TAGS.headers
1969TAG_SOURCE_CODE=TAGS.codefiles
1970TAG_SOURCE_LISTS=$(TAG_SOURCE_HEADERS) $(TAG_SOURCE_CODE)
1971
1972ETAGS_IGNORE_LIST=SOURCE_TOOLS/etags_ignore.lst
1973
1974ETAGS=ctags -e -I @$(ETAGS_IGNORE_LIST) --sort=no --if0=no --extra=q
1975ETAGS_TYPES=--C-kinds=cgnsut --C++-kinds=cgnsut
1976ETAGS_FUN  =--C-kinds=fm     --C++-kinds=fm
1977ETAGS_REST =--C-kinds=dev    --C++-kinds=dev
1978
1979FILTER_TAGS_SOURCES= \
1980        $(SED) -e 's/^.\///g' | \
1981        grep -vi '^HEADERLIBS\|^GDE/\|/GEN[CH]/'
1982
1983$(TAG_SOURCE_HEADERS): links
1984        find . \( -name '*.hxx' -o -name "*.h" \) -type f | $(FILTER_TAGS_SOURCES) > $@
1985
1986$(TAG_SOURCE_CODE): links
1987        find . \( -name '*.cxx' -o -name "*.c" \) -type f | $(FILTER_TAGS_SOURCES) > $@
1988
1989TAGS.1.tmp: $(TAG_SOURCE_HEADERS)
1990        $(ETAGS) -f $@ $(ETAGS_TYPES) -L $<
1991TAGS.2.tmp: $(TAG_SOURCE_HEADERS)
1992        $(ETAGS) -f $@ $(ETAGS_FUN) -L $<
1993TAGS.3.tmp: $(TAG_SOURCE_HEADERS)
1994        $(ETAGS) -f $@ $(ETAGS_REST) -L $<
1995TAGS.4.tmp: $(TAG_SOURCE_CODE)
1996        $(ETAGS) -f $@ $(ETAGS_TYPES) -L $<
1997TAGS.5.tmp: $(TAG_SOURCE_CODE)
1998        $(ETAGS) -f $@ $(ETAGS_FUN) -L $<
1999TAGS.6.tmp: $(TAG_SOURCE_CODE)
2000        $(ETAGS) -f $@ $(ETAGS_REST) -L $<
2001
2002TAGS_ALL_PARTS=TAGS.1.tmp TAGS.2.tmp TAGS.3.tmp TAGS.4.tmp TAGS.5.tmp TAGS.6.tmp
2003
2004$(TAGFILE_TMP) : $(TAGS_ALL_PARTS)
2005        cat $(TAGS_ALL_PARTS) > $@
2006        rm $(TAGS_ALL_PARTS) $(TAG_SOURCE_LISTS)
2007
2008tags: $(TAGFILE_TMP) 
2009        mv_if_diff $(TAGFILE_TMP) $(TAGFILE)
2010
2011#********************************************************************************
2012
2013LINKSTAMP=SOURCE_TOOLS/stamp.generate_all_links
2014
2015links: checks $(LINKSTAMP) arbmainwrapper
2016links_no_checks: $(LINKSTAMP) arbmainwrapper
2017
2018forcelinks:
2019        -rm $(LINKSTAMP)
2020        $(MAKE) links
2021
2022$(LINKSTAMP): SOURCE_TOOLS/generate_all_links.sh genheaders
2023        +SOURCE_TOOLS/generate_all_links.sh
2024        touch $(LINKSTAMP)
2025
2026clean_links:
2027#       avoid to delete linked pts, nas or arb_tcp.dat:
2028        find . -path './lib' -prune -o -type l -exec rm {} \;
2029#       removed obsolete file - refuses to disappear due to 'prune' above
2030        @rm -f lib/help/GDEHELP
2031        @rm -f $(LINKSTAMP) lib/inputMasks/format.readme
2032
2033redo_links: clean_links
2034        $(MAKE) links_no_checks
2035
2036#********************************************************************************
2037
2038header_libs:
2039        @(( \
2040                echo "$(SEP) Make HEADERLIBS"; \
2041                $(MAKE) -C HEADERLIBS all && \
2042                echo "$(SEP) Make HEADERLIBS [done]"; \
2043        ) > HEADERLIBS.log 2>&1 && (cat HEADERLIBS.log;rm HEADERLIBS.log)) || (cat HEADERLIBS.log;rm HEADERLIBS.log;false)
2044
2045#********************************************************************************
2046
2047gde:            GDE/GDE.dummy
2048GDE:            gde
2049agde:           ARB_GDE/ARB_GDE.dummy
2050tools:          TOOLS/TOOLS.dummy
2051convert:        $(CONVERT_ALN)
2052readseq:        READSEQ/READSEQ.dummy
2053
2054#***************************************************************************************
2055#                       Some user commands
2056#***************************************************************************************
2057
2058menus: binlink links
2059        @(( \
2060                echo "$(SEP) Make GDEHELP"; \
2061                $(MAKE) -C GDEHELP -r all && \
2062                echo "$(SEP) Make GDEHELP [done]"; \
2063        ) > GDEHELP.log 2>&1 && (cat GDEHELP.log;rm GDEHELP.log)) || (cat GDEHELP.log;rm GDEHELP.log;false)
2064
2065ifeq ($(DEBUG),1)
2066BIN_TARGET=develall
2067else
2068BIN_TARGET=all
2069endif
2070
2071
2072binlink:
2073        $(MAKE) -C bin $(BIN_TARGET)
2074
2075check_bin_dep: binlink
2076        SOURCE_TOOLS/check_bin_dependencies.pl
2077
2078preplib:
2079        (cd lib;$(MAKE) all)
2080
2081# --------------------------------------------------------------------------------
2082# This section is quite tricky:
2083#
2084# make 'perl' is a BIG target, so when it has to be made, it has to be started
2085# as early as possible to reduce overall compile time. Since 'make' does not
2086# provide any priotities, i force it to build all 'perl'-prerequisites early, by
2087# adding  artificial dependencies to these prerequisites
2088#
2089# That behavior is likely to be system-dependent.
2090# My goal was only to make it work on my current development system,
2091# where this saves about 20% of overall build time.
2092
2093ifeq ($(WITHPERL),1)
2094links_non_perl: PERLTOOLS/PERLTOOLS.dummy
2095perltools:      links_non_perl
2096perl:           realperl
2097else
2098links_non_perl: links
2099perl:
2100        $(MAKE) "WITHPERL=1" perl
2101endif
2102
2103# ---------------------------------------- perl
2104
2105ifeq ($(ARB_64),$(BUILDHOST_64))
2106TEST_PERL_SCRIPTS=$(MAKE) -C PERL_SCRIPTS/test test
2107else
2108TEST_PERL_SCRIPTS=echo "skipping perl script compilation (when cross-compiling)"
2109endif
2110
2111realperl: perltools
2112        (( \
2113                echo "$(SEP) Make PERL2ARB" ; \
2114                $(TIME) $(MAKE) -C PERL2ARB -r -f Makefile.main \
2115                        "AUTODEPENDS=1" \
2116                        "dflags=$(dflags)" \
2117                        "cflags4perl=$(cflags) $(cxxflags) $(dflags)" \
2118                        "lflags4perl=$(lflags4perl)" \
2119                        "COMPILER_VERSION=$(COMPILER_VERSION)" \
2120                        all && \
2121                $(TEST_PERL_SCRIPTS) && \
2122                echo "$(SEP) Make PERL2ARB [done]" ; \
2123        ) > PERL2ARB.log 2>&1 && (cat PERL2ARB.log;rm PERL2ARB.log)) || (cat PERL2ARB.log;rm PERL2ARB.log;false)
2124
2125perl_clean:
2126        @$(MAKE) -C PERL2ARB -r -f Makefile.main \
2127                "AUTODEPENDS=0" \
2128                clean
2129
2130PERL2ARB/PERL2ARB.clean:
2131        $(MAKE) perl_clean
2132        $(MAKE) -C PERL_SCRIPTS/test clean
2133
2134# ---------------------------------------- bindings to script languages
2135
2136bindings: lib/libCORE.so lib/libARBDB.so
2137        $(MAKE) -C BINDINGS all ARBDEPENDS="$(^:%=../%)" DFLAGS="$(dflags)"
2138
2139bindings_clean:
2140        $(MAKE) -C BINDINGS clean
2141
2142# ----------------------------------------
2143
2144CLOC=cloc-1.08.pl
2145CLOCFLAGS=--no3 --quiet --progress-rate=0
2146CLOCARB=--exclude-dir=GDE .
2147CLOCEXT=GDE
2148CLOCCODE=--read-lang-def=$(ARBHOME)/SOURCE_TOOLS/arb.cloc.code.def
2149CLOCREST=--read-lang-def=$(ARBHOME)/SOURCE_TOOLS/arb.cloc.rest.def
2150CLOCFILT=tail --lines=+4
2151
2152cloc:
2153        @echo 'Arb code:'
2154        @$(CLOC) $(CLOCFLAGS) $(CLOCCODE) $(CLOCARB) | $(CLOCFILT)
2155        @echo 'Arb rest:'
2156        @$(CLOC) $(CLOCFLAGS) $(CLOCREST) $(CLOCARB) | $(CLOCFILT)
2157        @echo 'External code:'
2158        @$(CLOC) $(CLOCFLAGS) $(CLOCCODE) $(CLOCEXT) | $(CLOCFILT)
2159        @echo 'External rest:'
2160        @$(CLOC) $(CLOCFLAGS) $(CLOCREST) $(CLOCEXT) | $(CLOCFILT)
2161
2162# ---------------------------------------- check resources
2163
2164check_res:
2165        $(ARBHOME)/SOURCE_TOOLS/check_resources.pl
2166
2167# ---------------------------------------- cleaning
2168
2169rmbak:
2170        @echo "[cleanup backup/core files]"
2171        @find . \(      -name '*%' \
2172                        -o -name '*.bak' \
2173                        -o -name '*~' \) \
2174                        -o \( -name 'core' -a \! -type d \) \
2175                -exec rm -v {} \; || \
2176        echo "Warning: target 'rmbak' reported problems when removing misc. backup files (ignored)"
2177        @echo "[cleanup done]"
2178
2179bin_reinit:
2180        $(MAKE) bin/bin.clean
2181        $(MAKE) -C "bin" all
2182
2183clean_directories:
2184        -rm -rf \
2185                $(ARBHOME)/PROBE_SET/bin \
2186                $(ARBHOME)/INCLUDE \
2187
2188libclean:
2189        -find $(ARBHOME) -type f \( -name '*.a' ! -type l \) -exec rm -f {} \;
2190
2191objclean:
2192        -find $(ARBHOME) -type f \( -name '*.o' ! -type l \) -exec rm -f {} \;
2193
2194# bin.clean and HELP_SOURCE.clean interfere
2195clean3:
2196        $(MAKE) bin/bin.clean
2197        $(MAKE) HELP_SOURCE/HELP_SOURCE.clean
2198
2199clean2: $(ARCHS:.a=.clean) \
2200                clean3 \
2201                rmbak \
2202                libclean \
2203                objclean \
2204                lib/lib.clean \
2205                GDEHELP/GDEHELP.clean \
2206                HEADERLIBS/HEADERLIBS.clean \
2207                SOURCE_TOOLS/SOURCE_TOOLS.clean \
2208                SOURCE_TOOLS/COMPILE_COMPAT/COMPILE_COMPAT.clean \
2209                UNIT_TESTER/UNIT_TESTER.clean \
2210                TEMPLATES/TEMPLATES.clean \
2211                perl_clean \
2212                clean_directories \
2213
2214        rm -f *.last_gcc *.last_compiler config.makefile.bak
2215
2216# links are needed for cleanup
2217clean: redo_links motif_xpm_hack_clean
2218        $(MAKE) clean2
2219        $(MAKE) clean_cov_all clean_links
2220
2221silent_clean:
2222        $(MAKE) clean >/dev/null
2223
2224# 'relocated' is about 50% faster than 'rebuild'
2225reloc_clean: links
2226        @echo "---------------------------------------- Relocation cleanup"
2227        $(MAKE) \
2228                perl_clean \
2229                GDEHELP/GDEHELP.clean \
2230                HELP_SOURCE/genhelp/genhelp.clean \
2231                bin/bin.clean \
2232                libclean \
2233                objclean
2234
2235relocated: links
2236        $(MAKE) reloc_clean
2237        @echo "---------------------------------------- and remake"
2238        $(MAKE) build
2239
2240# -----------------------------------
2241# some stress tests
2242# (helpful to reveal race conditions with -j)
2243
2244rebuild4ever: rebuild
2245        $(MAKE) rebuild4ever
2246
2247build4ever: build
2248        $(MAKE) build4ever
2249
2250clean4ever: clean
2251        $(MAKE) clean4ever
2252
2253test4ever: ut
2254        $(MAKE) test4ever
2255
2256perl4ever: clean
2257        $(MAKE) links
2258        $(MAKE) perl
2259        $(MAKE) perl4ever
2260
2261help4ever: clean
2262        $(MAKE) help
2263        $(MAKE) help4ever
2264
2265# -----------------------------------
2266
2267rebuild: clean
2268        $(MAKE) all
2269
2270cleanlinked: bin/bin.clean libclean
2271
2272relink: cleanlinked
2273        $(MAKE) all
2274
2275tarfile: rebuild
2276        $(MAKE) prepare_libdir
2277        util/arb_compress
2278
2279tarfile_quick: build
2280        $(MAKE) prepare_libdir
2281        util/arb_compress
2282
2283save: sourcetarfile
2284
2285patch:
2286        SOURCE_TOOLS/arb_create_patch.sh arbPatch
2287
2288# test early whether save will work
2289savetest:
2290        @util/arb_srclst.pl >/dev/null
2291
2292testsave: savetest
2293
2294sourcetarfile: rmbak
2295        util/arb_save
2296
2297save2: rmbak
2298        util/arb_save ignore
2299
2300save_test: rmbak
2301        @echo "Testing source list.."
2302        @util/arb_srclst.pl > /dev/null
2303
2304save_test_no_error:
2305        @-$(MAKE) save_test
2306
2307inc_candi:
2308        touch SOURCE_TOOLS/inc_candi.stamp
2309        $(MAKE) do_version_update
2310
2311inc_patch:
2312        touch SOURCE_TOOLS/inc_patch.stamp
2313        $(MAKE) do_version_update
2314
2315inc_minor:
2316        touch SOURCE_TOOLS/inc_minor.stamp
2317        $(MAKE) do_version_update
2318
2319inc_major:
2320        touch SOURCE_TOOLS/inc_major.stamp
2321        $(MAKE) do_version_update
2322
2323do_version_update:
2324        @echo Incrementing version information
2325        $(MAKE) savetest
2326        $(MAKE) genheaders # auto upgrades version early
2327
2328show_version:
2329        $(MAKE) genheaders # updates version info
2330        @echo "$(SEP) ARB version info"
2331        @grep ARB_VERSION TEMPLATES/arb_build.h
2332        @echo "$(SEP)"
2333
2334release_quick:
2335        -rm arb.tgz arbsrc.tgz
2336        $(MAKE) tarfile_quick
2337        $(MAKE) sourcetarfile
2338
2339# --------------------------------------------------------------------------------
2340# special cleanups
2341
2342clean_opengl_changed: RNA3D/RNA3D.clean EDIT4/EDIT4.clean WINDOW/WINDOW.clean GL/GL.clean
2343
2344# --------------------------------------------------------------------------------
2345
2346MAKE_IF_COMMITTED=$(MAKE) -C SOURCE_TOOLS -f Makefile.commitbuild
2347
2348build_CTARGET:
2349        +$(MAKE_IF_COMMITTED) "CTARGET=$(CTARGET)" build_CTARGET
2350
2351reset_committed_build:
2352        +$(MAKE_IF_COMMITTED) reset
2353
2354# --------------------------------------------------------------------------------
2355
2356arbapplications: nt pa e4 wetc pt na nal di ph ds wetc cma
2357
2358arb_external: convert tools gde readseq tg pst xmlin
2359
2360arb_no_perl: arbapplications help arb_external
2361
2362arb: motif_xpm_hack
2363        $(MAKE) "WITHPERL=1" perl arb_no_perl
2364
2365motif_xpm_hack:
2366        $(MAKE) -r -C "lib/motifHack" all
2367
2368motif_xpm_hack_clean:
2369        $(MAKE) -r -C "lib/motifHack" clean
2370
2371# --------------------------------------------------------------------------------
2372# special targets for SOURCE_TOOLS/remake_after_change.pl
2373
2374rac_arb_dist:           di
2375rac_arb_edit4:          e4
2376rac_arb_ntree:          nt
2377rac_arb_pars:           pa
2378rac_arb_phylo:          ph
2379rac_arb_wetc:           wetc
2380rac_arb_naligner:       nal
2381rac_arb_pt_server:      pt
2382rac_arb_db_server:      ds
2383rac_arb_name_server:    na
2384rac_arb_convert_aln:    convert
2385rac_arb_treegen:        tg
2386rac_arb_rnacma:         cma
2387rac_arb_help2xml:       help
2388
2389rac_arb_a2ps:           tools
2390rac_arb_consensus_tree: tools
2391rac_arb_dnarates:       tools
2392rac_arb_export_rates:   tools
2393rac_arb_export_tree:    tools
2394rac_arb_gene_probe:     tools
2395rac_arb_message:        tools
2396rac_arb_primer:         tools
2397rac_arb_probe:          tools
2398rac_arb_read_tree:      tools
2399
2400# --------------------------------------------------------------------------------
2401# unit testing
2402# @@@ work in progress
2403#
2404# goal is to automatically test all libraries/executables using TESTED_UNITS_AUTO
2405#
2406# currently not all test executables link w/o error
2407# (see UNITS_WORKING, UNITS_UNTESTABLE_ATM and UNITS_NEED_FIX)
2408
2409# define RNA3D/RNA3D.test
2410RNA3D_TEST := $(subst .a,.test,$(RNA3D_LIB))
2411
2412TESTED_UNITS_AUTO = $(ARCHS:.a=.test)
2413
2414UNITS_WORKING = \
2415        $(RNA3D_TEST) \
2416        EISPACK/EISPACK.test \
2417        GENOM/GENOM.test \
2418        GL/glAW/libglAW.test \
2419        GL/glpng/libglpng_arb.test \
2420        ISLAND_HOPPING/ISLAND_HOPPING.test \
2421        NALIGNER/NALIGNER.test \
2422        NAMES/NAMES.test \
2423        PHYLO/PHYLO.test \
2424        PRIMER_DESIGN/PRIMER_DESIGN.test \
2425        PROBE_DESIGN/PROBE_DESIGN.test \
2426        SECEDIT/SECEDIT.test \
2427        SEQ_QUALITY/SEQ_QUALITY.test \
2428        SERVERCNTRL/SERVERCNTRL.test \
2429        SL/ALIVIEW/ALIVIEW.test \
2430        SL/AP_TREE/AP_TREE.test \
2431        SL/ARB_TREE/ARB_TREE.test \
2432        SL/AW_HELIX/AW_HELIX.test \
2433        SL/AW_NAME/AW_NAME.test \
2434        SL/DB_SCANNER/DB_SCANNER.test \
2435        SL/GUI_ALIVIEW/GUI_ALIVIEW.test \
2436        SL/HELIX/HELIX.test \
2437        SL/LOCATION/LOCATION.test \
2438        SL/MATRIX/MATRIX.test \
2439        SL/QUERY/QUERY.test \
2440        SL/REFENTRIES/REFENTRIES.test \
2441        SL/SEQUENCE/SEQUENCE.test \
2442        SL/TRANSLATE/TRANSLATE.test \
2443        SL/TREE_ADMIN/TREE_ADMIN.test \
2444        SL/TREE_WRITE/TREE_WRITE.test \
2445        STAT/STAT.test \
2446        TREEGEN/TREEGEN.test \
2447        WETC/WETC.test \
2448        XML/XML.test \
2449
2450# untestable units
2451
2452UNITS_NEED_FIX = \
2453        ptpan/PROBE.test \
2454
2455UNITS_UNTESTABLE_ATM = \
2456        XML_IMPORT/XML_IMPORT.test \
2457
2458# for the moment, put all units containing tests into the following 4 sections (see also TESTED_UNITS below)
2459
2460# recent development
2461UNITS_TESTED_FIRST = \
2462        SL/PVP/PVP.test \
2463        AWTI/AWTI.test \
2464        SL/FILTSEQEXP/FILTSEQEXP.test \
2465        SL/GROUP_SEARCH/GROUP_SEARCH.test \
2466
2467# start units with long duration early
2468UNITS_RUNNING_LONG = \
2469        ARBDB/libARBDB.test \
2470        AWTC/AWTC.test \
2471        TOOLS/arb_test.test \
2472
2473# plain test-libaries that are not linked anywhere
2474TEST_SANDBOXES = \
2475        SL/CB/CB.test \
2476
2477UNITS_TESTED = \
2478        AISC_MKPTPS/mkptypes.test \
2479        ARB_GDE/ARB_GDE.test \
2480        AWT/libAWT.test \
2481        CONSENSUS_TREE/CONSENSUS_TREE.test \
2482        CONVERTALN/CONVERTALN.test \
2483        CORE/libCORE.test \
2484        DBSERVER/DBSERVER.test \
2485        DIST/DIST.test \
2486        EDIT4/EDIT4.test \
2487        GENOM_IMPORT/GENOM_IMPORT.test \
2488        HELP_SOURCE/arb_help2xml.test \
2489        MERGE/MERGE.test \
2490        MULTI_PROBE/MULTI_PROBE.test \
2491        NTREE/NTREE.test \
2492        PARSIMONY/PARSIMONY.test \
2493        PERLTOOLS/arb_proto_2_xsub.test \
2494        PROBE/PROBE.test \
2495        PROBE_SET/fb_test.test \
2496        SERVERCNTRL/SERVERCNTRL.test \
2497        SL/ALILINK/ALILINK.test \
2498        SL/CONSENSUS/CONSENSUS.test \
2499        SL/DB_QUERY/DB_QUERY.test \
2500        SL/FAST_ALIGNER/FAST_ALIGNER.test \
2501        SL/FILTER/FILTER.test \
2502        SL/INSDEL/INSDEL.test \
2503        SL/ITEM_SHADER/ITEM_SHADER.test \
2504        SL/ITEMS/ITEMS.test \
2505        SL/MACROS/MACROS.test \
2506        SL/NDS/NDS.test \
2507        SL/NEIGHBOURJOIN/NEIGHBOURJOIN.test \
2508        SL/PRONUC/PRONUC.test \
2509        SL/PTCLEAN/PTCLEAN.test \
2510        SL/REGEXPR/REGEXPR.test \
2511        SL/SEQIO/SEQIO.test \
2512        SL/TREE_READ/TREE_READ.test \
2513        SL/TREEDISP/TREEDISP.test \
2514        TOOLS/arb_consensus_tree.test \
2515        TOOLS/arb_probe.test \
2516        WINDOW/libWINDOW.test \
2517
2518TESTED_UNITS = \
2519        $(UNITS_TESTED_FIRST) \
2520        $(UNITS_RUNNING_LONG) \
2521        $(TEST_SANDBOXES) \
2522        $(UNITS_TESTED) \
2523
2524# see UNIT_TESTER/sym2testcode.pl@disableErrorOnUnitsWithoutTests
2525
2526# ----------------------------------------
2527
2528TEST_LOG_DIR = UNIT_TESTER/logs
2529TEST_RUN_SUITE=$(MAKE) $(NODIR) -C UNIT_TESTER -f Makefile.suite -r
2530TEST_MAKE_FLAGS=
2531TEST_POST_CLEAN=
2532ifeq ($(COVERAGE),1)
2533TEST_POST_CLEAN=$(MAKE) clean_cov
2534TEST_MAKE_FLAGS+=-j1
2535endif
2536
2537
2538%.test:
2539        -@( export ID=$$$$; mkdir -p $(TEST_LOG_DIR); \
2540        ( \
2541            echo "fake[1]: Entering directory \`$(ARBHOME)/UNIT_TESTER'"; \
2542            $(MAKE) -C UNIT_TESTER -f Makefile.test -r \
2543                "UNITDIR=$(@D)" \
2544                "UNITLIBNAME=$(@F:.test=)" \
2545                "COVERAGE=$(COVERAGE)" \
2546                "ARB_PID=$(ARB_PID)_$(@F)" \
2547                runtest; \
2548            echo "fake[1]: Leaving directory \`$(ARBHOME)/UNIT_TESTER'"; \
2549            $(TEST_POST_CLEAN) \
2550        ) >$(TEST_LOG_DIR)/$(@F).log 2>&1; \
2551        UNIT_TESTER/log_result.pl $(TEST_LOG_DIR)/$(@F).log )
2552
2553
2554test_base: $(UNIT_TESTER_LIB:.a=.dummy) $(subst .test,.dummy,$(TEST_SANDBOXES))
2555
2556clean_cov:
2557        find . \( -name "*.gcda" -o -name "*.gcov" -o -name "*.cov" \) -exec rm {} \;
2558
2559clean_cov_all: clean_cov
2560        find . \( -name "*.gcno" \) -exec rm {} \;
2561
2562run_tests: test_base clean_cov
2563        $(MAKE) "ARB_PID=UT_$$$$" run_tests_faked_arbpid
2564
2565cleanup_faked_arbpids:
2566        @rm ~/.arb_tmp/tmp/arb_pids_${USER}_${ARB_PID}_* || true
2567
2568cleanup_faked_arbpids_and_fail: cleanup_faked_arbpids
2569        @false
2570
2571run_tests_faked_arbpid:
2572        +@$(TEST_RUN_SUITE) init
2573        @echo "fake[2]: Entering directory \`$(ARBHOME)/UNIT_TESTER'"
2574        $(MAKE) $(TEST_MAKE_FLAGS) $(NODIR) $(TESTED_UNITS) || $(MAKE) cleanup_faked_arbpids_and_fail
2575        @echo "fake[2]: Leaving directory \`$(ARBHOME)/UNIT_TESTER'"
2576        +@$(TEST_RUN_SUITE) cleanup || $(MAKE) cleanup_faked_arbpids_and_fail
2577        @$(MAKE) clean_cov >/dev/null
2578        @$(MAKE) cleanup_faked_arbpids
2579
2580ut:
2581ifeq ($(UNIT_TESTS),1)
2582        @echo $(MAKE) run_tests
2583        @$(MAKE) run_tests
2584else
2585        @echo "Not compiled with unit tests"
2586endif
2587
2588
2589aut:
2590        +@$(TEST_RUN_SUITE) unskip
2591        $(MAKE) ut
2592
2593# --------------------------------------------------------------------------------
2594
2595TIMELOG=$(ARBHOME)/arb_time.log
2596TIMEARGS=--append --output=$(TIMELOG) --format=" %E(%S+%U) %P [%C]"
2597TIMECMD=$(TIME) $(TIMEARGS)
2598
2599time_one:
2600ifeq ($(ONE_TIMED_TARGET),)
2601        @echo "Error: You have to pass ONE_TIMED_TARGET to $@"
2602        false
2603else
2604        @echo "$(SEP) $(MAKE) $(ONE_TIMED_TARGET)"
2605        @$(TIMECMD) $(MAKE) $(ONE_TIMED_TARGET)
2606        @echo "$(SEP) $(MAKE) $(ONE_TIMED_TARGET) [done]"
2607endif
2608
2609timed_target:
2610ifeq ($(TIMED_TARGET),)
2611        @echo "Error: You have to pass TIMED_TARGET to $@"
2612        false
2613else
2614        @echo "Build time:" > $(TIMELOG)
2615        $(MAKE) "ONE_TIMED_TARGET=$(TIMED_TARGET)" time_one
2616        @cat $(TIMELOG)
2617        @rm $(TIMELOG)
2618endif
2619
2620timed_target_tested:
2621ifeq ($(TIMED_TARGET),)
2622        @echo "Error: You have to pass TIMED_TARGET to $@"
2623        false
2624else
2625        @echo "Build time:" > $(TIMELOG)
2626        $(MAKE) "ONE_TIMED_TARGET=$(TIMED_TARGET)" time_one
2627        $(MAKE) "ONE_TIMED_TARGET=ut" time_one
2628        @cat $(TIMELOG)
2629        @rm $(TIMELOG)
2630endif
2631
2632clean_timed_target:
2633ifeq ($(TIMED_TARGET),)
2634        @echo "Error: You have to pass TIMED_TARGET to $@"
2635        false
2636else
2637        @echo "Build time:" > $(TIMELOG)
2638        $(MAKE) "ONE_TIMED_TARGET=clean" time_one
2639        $(MAKE) "ONE_TIMED_TARGET=$(TIMED_TARGET)" time_one
2640        @cat $(TIMELOG)
2641        @rm $(TIMELOG)
2642endif
2643
2644# --------------------------------------------------------------------------------
2645
2646CHECKOUT_MODIFIED=0# set to 1 to temporarily skip test for modifications (do not check in if set to 1)
2647
2648check_svn_does_not_contain_generated:
2649ifeq ($(CHECKOUT_MODIFIED),0)
2650        @echo "Testing that build does not modify files in SVN"
2651        @test 0 = `svn status | wc -l` || ( \
2652                echo "The checkout is not/no longer clean:"; \
2653                svn status; \
2654                echo "- if this fails instantly, your checkout is not clean"; \
2655                echo "- if this fails after other targets, these targets modify checked in data"; \
2656                echo "  (a common cause may be that depends are not up to date)"; \
2657                false)
2658else
2659        grep -Hn 'CHECKOUT_MODIFIED' Makefile
2660endif
2661
2662check_svn_ignores_generated:
2663        @test 0 = `svn status | grep '^\?' | wc -l` || ( \
2664                echo "There are svn-unignored files:"; \
2665                svn status | grep '^\?'; \
2666                echo "(all generated files should be svn-ignored)"; \
2667                false)
2668
2669check_svn_state: check_svn_does_not_contain_generated
2670        $(MAKE) check_svn_ignores_generated
2671        $(MAKE) savetest
2672
2673things_that_always_should_work: depends proto
2674
2675post_commit_check:
2676        @echo "---------------------------------------- [Initial]"
2677        $(MAKE) check_svn_state
2678
2679        $(MAKE) clean
2680        @echo "---------------------------------------- [After 'make clean']"
2681        $(MAKE) check_svn_state
2682
2683        $(MAKE) things_that_always_should_work
2684        @echo "---------------------------------------- [After 'make things_that_always_should_work']"
2685        $(MAKE) check_svn_state
2686
2687        $(MAKE) all
2688        @echo "---------------------------------------- [After 'make all']"
2689        $(MAKE) check_svn_state
2690
2691        $(MAKE) things_that_always_should_work
2692        @echo "---------------------------------------- [Final]"
2693        $(MAKE) check_svn_state
2694
2695# --------------------------------------------------------------------------------
2696# sanitize arb_ntree; also works for clients (arb_edit4, ...) started from there.
2697
2698sanitize: all
2699        ( \
2700                export "LSAN_OPTIONS=max_leaks=30:suppressions=$(ARBHOME)/SOURCE_TOOLS/arb.leaksan.supp"; \
2701                echo "sake[1]: Entering directory \`$(ARBHOME)'"; \
2702                $(ARBHOME)/bin/arb_ntree --execute _logged ~/data/test.arb 2>&1 ; \
2703                echo "sake[1]: Leaving directory \`$(ARBHOME)'" \
2704        ) | $(ARBHOME)/SOURCE_TOOLS/asan2msg.pl
2705
2706# --------------------------------------------------------------------------------
2707# build and test one unit:
2708
2709make_oneunit:
2710        $(MAKE) "WITHPERL=1" $(UNIT).dummy
2711
2712oneunit:
2713ifndef UNIT
2714        @echo "Please define UNIT, e.g. using"
2715        @echo "      make \"UNIT=ARBDB/libARBDB\"       oneunit"
2716        @echo "      make \"UNIT=SL/TREEDISP/TREEDISP\" oneunit"
2717        @echo "(Note: 1st is a shared library, 2nd isn't)"
2718        false
2719else
2720        @echo "Build time" > $(TIMELOG)
2721        @echo "$(SEP) $(MAKE) make_oneunit"
2722        @$(TIMECMD) $(MAKE) make_oneunit
2723 ifeq ($(UNIT_TESTS),1)
2724        @echo $(MAKE) run_tests
2725        @$(TIMECMD) $(MAKE) run_tests
2726 endif
2727        @cat $(TIMELOG)
2728        @rm $(TIMELOG)
2729endif
2730
2731# --------------------------------------------------------------------------------
2732
2733build: arb
2734        $(MAKE) check_bin_dep preplib compile_compatibility
2735
2736all:
2737        @echo "Build time" > $(TIMELOG)
2738#       $(MAKE) clean_checked_vect # uncomment to rebuild sources where expected vectorization gets tested
2739        @echo "$(SEP) $(MAKE) build"
2740        @$(TIMECMD) $(MAKE) build
2741        @echo $(SEP)
2742        @echo "made 'all' with success."
2743        @echo "to start arb enter 'arb'"
2744ifeq ($(UNIT_TESTS),1)
2745        @echo $(MAKE) run_tests
2746        @$(TIMECMD) $(MAKE) run_tests
2747endif
2748        @echo "$(SEP) $(MAKE) build [done]"
2749ifeq ($(DEBUG),1)
2750        @$(MAKE) save_test_no_error >/dev/null # just show hints
2751endif
2752        @cat $(TIMELOG)
2753        @rm $(TIMELOG)
2754
Note: See TracBrowser for help on using the repository browser.