source: tags/ms_ra2q2/Makefile

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