forked from flame/libflame
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
1114 lines (910 loc) · 35.2 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#
# Makefile
#
# Field G. Van Zee
#
# Top-level makefile for libflame linear algebra library.
#
#
#
# --- Makefile PHONY target definitions ----------------------------------------
#
.PHONY: all \
libs libflame \
check-env check-env-config check-env-fragments \
flat-headers \
test check checklibflame\
checkcpp cleancpptest \
install-headers install-libs install-lib-symlinks \
clean cleanmk cleanh cleanlib cleanleaves distclean \
install \
uninstall-libs uninstall-lib-symlinks uninstall-headers
# Accept an abbreivated request for verbosity (e.g. 'make V=1 ...')
ifeq ($(V),1)
ENABLE_VERBOSE := yes
endif
ifeq ($(V),0)
ENABLE_VERBOSE := no
endif
#
# --- Include architecture-specific variable definitions ----------------------
#
# Avoid catting the config.sys_type file unless it exists. This makes the
# output of things like 'make distclean' (when the directory is already
# clean) less confusing.
ifneq ($(wildcard config.sys_type),)
# The host string will uniquely identify the current host (as much
# as is reasonable) for purposes of separating the configure products and
# object files of one architecture from another.
HOST := $(shell cat config.sys_type)
else
HOST := unknown-generic
endif
# --- Important directories for source code and build products ---
SRC_DIR := src
CONFIG_DIR := config
OBJ_DIR := obj
LIB_DIR := lib
INC_DIR := include
LAPACKE_DIR := lapacke
AOCLDTL_DIR := aocl_dtl
LAPACKE_SRC_DIR := LAPACKE/src
LAPACKE_UTIL_DIR := LAPACKE/utils
TEST_DIR := test/legacyflame
TEST_DIR_MAIN_TEST := test/main
CPP_TEST_DIR := testcpp
LAPACKE_S_SRC_PATH := $(SRC_DIR)/$(LAPACKE_DIR)/$(LAPACKE_SRC_DIR)
LAPACKE_U_SRC_PATH := $(SRC_DIR)/$(LAPACKE_DIR)/$(LAPACKE_UTIL_DIR)
LIBAOCLUTILS_DIR := libaoclutils
LIBAOCLUTILS_REPO := aocl-utils
LIBAOCLUTILS_OBJ_DIR := libaoclutils_objdir
SCRIPTS_DIR := scripts
# Use the system type to name the config, object, and library directories.
# These directories are special in that they will contain products specific
# to this particular architecture.
BASE_CONFIG_PATH := ./$(CONFIG_DIR)/$(HOST)
BASE_OBJ_PATH := ./$(OBJ_DIR)/$(HOST)/$(SRC_DIR)
BASE_LIB_PATH := ./$(LIB_DIR)/$(HOST)
BASE_INC_PATH := ./$(INC_DIR)/$(HOST)
# Pathname to the makefile fragment containing lots of various definitions,
# most of which were substituted via configure.
CONFIG_MK_FILE := $(BASE_CONFIG_PATH)/config.mk
# Include the definitions in the config makefile fragment.
-include $(CONFIG_MK_FILE)
# Detect whether we actually got the config makefile fragment. If we didn't,
# then it is likely that the user has not yet generated it (via configure).
ifeq ($(strip $(CONFIG_MK_INCLUDED)),yes)
CONFIG_MK_PRESENT := yes
IS_CONFIGURED := yes
else
CONFIG_MK_PRESENT := no
IS_CONFIGURED := no
endif
#
# --- Library name and local paths ---------------------------------------------
#
# --- Shared library extension ---
# The shared (dynamic) library file suffix is different for Linux and OS X.
ifeq ($(OS_NAME),Darwin)
SHLIB_EXT := dylib
else
SHLIB_EXT := so
endif
# --- Library names ---
LIBFLAME := libflame
LIBFLAME_A := $(LIBFLAME).a
LIBFLAME_SO := $(LIBFLAME).$(SHLIB_EXT)
LAPACKE_A := liblapacke.a
AOCLDTL_A := libaocldtl.a
AOCLDTL_SO := libaocldtl.$(SHLIB_EXT)
# --- Library filepaths ---
# Append the base library path to the library names.
LIBFLAME_A_PATH := $(BASE_LIB_PATH)/$(LIBFLAME_A)
LIBFLAME_SO_PATH := $(BASE_LIB_PATH)/$(LIBFLAME_SO)
ifeq ($(OS_NAME),Darwin)
# OS X shared library extensions.
LIBFLAME_SO_MAJ_EXT := $(SO_MAJOR).$(SHLIB_EXT)
LIBFLAME_SO_MMB_EXT := $(SO_MMB).$(SHLIB_EXT)
else
# Linux shared library extensions.
LIBFLAME_SO_MAJ_EXT := $(SHLIB_EXT).$(SO_MAJOR)
LIBFLAME_SO_MMB_EXT := $(SHLIB_EXT).$(SO_MMB)
endif
LIBFLAME_SONAME := $(LIBFLAME).$(LIBFLAME_SO_MAJ_EXT)
LIBFLAME_SO_MAJ_PATH := $(BASE_LIB_PATH)/$(LIBFLAME_SONAME)
AOCLDTL_A_PATH := $(SRC_DIR)/$(AOCLDTL_DIR)/$(AOCLDTL_A)
AOCLDTL_SO_PATH := $(SRC_DIR)/$(AOCLDTL_DIR)/$(AOCLDTL_SO)
AOCLDTL_obj_PATH := $(SRC_DIR)/$(AOCLDTL_DIR)/*.o
AOCLDTL_gch_PATH := $(SRC_DIR)/$(AOCLDTL_DIR)/*.gch
LAPACKE_S_OBJS_PATH := $(SRC_DIR)/$(LAPACKE_DIR)/$(LAPACKE_SRC_DIR)/*.o
LAPACKE_U_OBJS_PATH := $(SRC_DIR)/$(LAPACKE_DIR)/$(LAPACKE_UTIL_DIR)/*.o
# Construct the output path when building a shared library.
LIBFLAME_SO_OUTPUT_NAME := $(LIBFLAME_SO_PATH)
#
# --- Shared library flags ----------------------------------------------------
#
# Specify the shared library's 'soname' field.
# NOTE: The flag for creating shared objects is different for Linux and OS X.
ifeq ($(OS_NAME),Darwin)
# OS X shared library link flags.
SOFLAGS := -dynamiclib
SOFLAGS += -Wl,-install_name,$(LIBFLAME_SONAME)
else
SOFLAGS := -shared
# Linux shared library link flags.
SOFLAGS += -Wl,-soname,$(LIBFLAME_SONAME)
endif
#
# --- Main target variable definitions ----------------------------------------
#
MK_BASE_FLAMEC_SRC :=
MK_BASE_FLAMEC_OBJS :=
MK_BLAS_FLAMEC_SRC :=
MK_BLAS_FLAMEC_OBJS :=
MK_LAPACK_FLAMEC_SRC :=
MK_LAPACK_FLAMEC_OBJS :=
MK_MAP_LAPACK2FLAMEC_SRC :=
MK_MAP_LAPACK2FLAMEC_OBJS :=
MK_MAP_LAPACK2FLAMEC_F2C_SRC :=
MK_MAP_LAPACK2FLAMEC_F2C_OBJS :=
MK_MAP_LAPACK2FLAMEC_F2C_FLAMEC_SRC :=
MK_MAP_LAPACK2FLAMEC_F2C_FLAMEC_OBJS :=
MK_MAP_LAPACK2FLAMEC_F2C_INSTALL_SRC :=
MK_MAP_LAPACK2FLAMEC_F2C_INSTALL_OBJS :=
MK_FLABLAS_F2C_SRC :=
MK_FLABLAS_F2C_OBJS :=
MK_LAPACK_X86_SRC :=
MK_LAPACK_X86_OBJS :=
MK_LAPACK_FBLAS_SRC :=
MK_LAPACK_FBLAS_OBJS :=
# --- Define install target names for static libraries ---
LIBFLAME_A_INST := $(INSTALL_LIBDIR)/$(LIBFLAME_A)
LIBFLAME_DTL_A_INST := $(INSTALL_LIBDIR)/$(AOCLDTL_A)
# --- Define install target names for dynamic libraries ---
LIBFLAME_SO_INST := $(INSTALL_LIBDIR)/$(LIBFLAME_SO)
LIBFLAME_SO_MAJ_INST := $(INSTALL_LIBDIR)/$(LIBFLAME_SONAME)
LIBFLAME_SO_MMB_INST := $(INSTALL_LIBDIR)/$(LIBFLAME).$(LIBFLAME_SO_MMB_EXT)
LIBFLAME_DTL_SO_INST := $(INSTALL_LIBDIR)/$(AOCLDTL_SO)
# --- Determine which libraries to build ---
MK_LIBS :=
MK_LIBS_INST :=
MK_LIBS_SYML :=
MK_DTL_LIBS_INST :=
ifeq ($(FLA_ENABLE_STATIC_BUILD),yes)
MK_LIBS += $(LIBFLAME_A_PATH)
MK_LIBS_INST += $(LIBFLAME_A_INST)
MK_LIBS_SYML +=
MK_DTL_LIBS_INST += $(LIBFLAME_DTL_A_INST)
endif
MK_LIBS += $(AOCLDTL_A_PATH)
ifeq ($(FLA_ENABLE_DYNAMIC_BUILD),yes)
MK_LIBS += $(LIBFLAME_SO_PATH) \
$(LIBFLAME_SO_MAJ_PATH)
MK_LIBS_INST += $(LIBFLAME_SO_MMB_INST)
MK_LIBS_SYML += $(LIBFLAME_SO_INST) \
$(LIBFLAME_SO_MAJ_INST)
MK_DTL_LIBS_INST += $(LIBFLAME_DTL_SO_INST)
endif
# Strip leading, internal, and trailing whitespace.
MK_LIBS_INST := $(strip $(MK_LIBS_INST))
MK_LIBS_SYML := $(strip $(MK_LIBS_SYML))
# Set the path to the subdirectory of the include installation directory.
MK_INCL_DIR_INST := $(INSTALL_INCDIR)
#
# --- Test definitions --------------------------------------------------------
#
#
# --- Include sub-tree makefile fragments --------------------------------------
#
# Makefile fragment name.
FRAGMENT_MK := .fragment.mk
# Initialize our list of directory paths to makefile fragments with the empty list.
FRAGMENT_DIR_PATHS :=
# The only fragment subdirectory that we build from the top-level directory is the
# source directory.
SRC_PATH := $(DIST_PATH)/$(SRC_DIR)
SRC_FRAG_PATH := ./$(OBJ_DIR)/$(HOST)/$(SRC_DIR)
# These variables are used by the include statements as they recursively include
# one another. We initialize them to the distribution path and the base object
# path.
PARENT_SRC_PATH := $(DIST_PATH)
PARENT_PATH := ./$(OBJ_DIR)/$(HOST)
# Recursively include all the makefile fragments.
#-include $(addsuffix /$(FRAGMENT_MK), $(FRAGMENT_SUB_DIRS))
-include $(addsuffix /$(FRAGMENT_MK), $(SRC_FRAG_PATH))
# Create a list of the makefile fragments.
MAKEFILE_FRAGMENTS := $(addsuffix /$(FRAGMENT_MK), $(FRAGMENT_DIR_PATHS))
# Detect whether we actually got any makefile fragments. If we didn't, then it
# is likely that the user has not yet generated them (via configure).
ifeq ($(strip $(MAKEFILE_FRAGMENTS)),)
MAKEFILE_FRAGMENTS_PRESENT := no
else
MAKEFILE_FRAGMENTS_PRESENT := yes
endif
#
# --- Compiler include path definitions ----------------------------------------
#
# A script (originating from BLIS) that creates a monolithic header file from
# many header files that are recursively #included from one another.
BUILD_PATH := $(DIST_PATH)/build
FLATTEN_H := $(PYTHON) $(BUILD_PATH)/flatten-headers.py
# The path to the main header files.
FLAF2C_H_SRC_PATH := $(DIST_PATH)/src/base/flamec/include/FLA_f2c.h
FLAME_H_SRC_PATH := $(DIST_PATH)/src/base/flamec/include/FLAME.h
BLIS1_H_SRC_PATH := $(DIST_PATH)/src/base/flamec/blis/include/blis1.h
# Construct the path to what will be the intermediate flattened/monolithic
# header files.
FLAME_H := FLAME.h
FLAME_H_FLAT := $(BASE_INC_PATH)/$(FLAME_H)
BLIS1_H := blis1.h
BLIS1_H_FLAT := $(BASE_INC_PATH)/$(BLIS1_H)
FLAF2C_H := FLA_f2c.h
FLAF2C_H_FLAT := $(BASE_INC_PATH)/$(FLAF2C_H)
#Define path of CPP Template header files
CPP_TEMPLATE_H_PATH := ./$(SRC_DIR)/src_cpp
# Expand the fragment paths that contain .h files to attain the set of header
# files present in all fragment paths.
MK_HEADER_FILES := $(foreach frag_path, $(FRAGMENT_DIR_PATHS), $(wildcard $(frag_path)/*.h))
MK_HEADER_FILES += $(BASE_CONFIG_PATH)/FLA_config.h
# Strip the leading, internal, and trailing whitespace from our list of header
# files. This makes the "make install-headers" much more readable.
MK_HEADER_FILES := $(strip $(MK_HEADER_FILES))
# Expand the fragment paths that contain .h files, and take the first expansion.
# Then, strip the header filename to leave the path to each header location.
# Notice this process even weeds out duplicates! Add the config directory manually
# since it contains FLA_config.h.
MK_HEADER_DIR_PATHS := $(dir $(foreach frag_path, $(FRAGMENT_DIR_PATHS), \
$(firstword $(wildcard $(frag_path)/*.h))))
MK_HEADER_DIR_PATHS += $(BASE_CONFIG_PATH)
# Create list of header file paths to be not included for flattening.
# These paths will be removed from the list of search directories used
# for flattening.
MK_EXC_HEADER_PATHS := ./src/lapack/x86/
MK_EXC_HEADER_PATHS += ./src/lapack/x86/avx2/
MK_EXC_HEADER_PATHS += ./src/lapack/x86/avx512/
MK_EXC_HEADER_PATHS += ./src/lapack/x86/front/
MK_EXC_HEADER_PATHS += ./src/lapack/x86/generic/
# Remove the header paths in exclude list
MK_HEADER_DIR_PATHS := $(filter-out $(MK_EXC_HEADER_PATHS), $(MK_HEADER_DIR_PATHS))
# Define a list of headers to flatten. We have to flatten blis1.h and FLA_f2c.h
# because a few files #include only those files, but they aren't needed after
# libflame is compiled.
HEADERS_TO_FLATTEN := $(FLAME_H_FLAT) $(BLIS1_H_FLAT) $(FLAF2C_H_FLAT)
# Define a list of headers to install and their installation path. The default
# is to only install FLAME.h.
HEADERS_TO_INSTALL := $(FLAME_H_FLAT)
HEADERS_TO_INSTALL += $(CPP_TEMPLATE_H_PATH)/*.hh
#LAPACKE headers for cpp interface
LAPACKE_HEADERS_DIR := $(SRC_DIR)/$(LAPACKE_DIR)/LAPACKE/include
LAPACKE_HEADERS := $(LAPACKE_HEADERS_DIR)/lapacke.h
LAPACKE_HEADERS += $(LAPACKE_HEADERS_DIR)/lapacke_mangling.h
LAPACKE_HEADERS += $(LAPACKE_HEADERS_DIR)/lapack.h
HEADERS_TO_INSTALL += $(LAPACKE_HEADERS)
HEADERS_INST := $(addprefix $(MK_INCL_DIR_INST)/, $(notdir $(HEADERS_TO_INSTALL)))
# Add -I to each header path so we can specify our include search paths to the
# C and Fortran compilers. NOTE: This is primarily for access to the monolithic
# (flattened) FLAME.h file, athough a few other files are placed there too (see
# above).
#INCLUDE_PATHS := $(strip $(patsubst %, -I%, $(MK_HEADER_DIR_PATHS)))
INCLUDE_PATHS := $(strip $(patsubst %, -I%, $(BASE_INC_PATH)))
# When lapack2flame is enabled, we need to add a -I option for the directory
# in which the lapack2flame headers reside.
ifeq ($(FLA_ENABLE_LAPACK2FLAME),yes)
L2F_FRAG_DIR_PATHS := $(filter $(DIST_PATH)/src/map/lapack2flamec%,$(FRAGMENT_DIR_PATHS))
L2F_HEADER_DIR_PATHS := $(dir $(foreach frag_path, $(L2F_FRAG_DIR_PATHS), \
$(firstword $(wildcard $(frag_path)/*.h))))
INCLUDE_PATHS += $(strip $(patsubst %, -I%, $(L2F_HEADER_DIR_PATHS)))
endif
INCLUDE_PATHS += $(strip $(patsubst %, -I%, $(LAPACKE_HEADERS_DIR)))
ifeq ($(ENABLE_EMBED_AOCLUTILS),1)
ifeq ($(strip $(LIBAOCLUTILS_LIBRARY_PATH)),)
INCLUDE_PATHS += "-I$(LIBAOCLUTILS_DIR)/$(LIBAOCLUTILS_REPO)/include"
endif
endif
$(info MK_EXC_HEADER_PATHS is $(MK_EXC_HEADER_PATHS))
$(info INCLUDE_PATHS is $(INCLUDE_PATHS))
# Add the paths of non-flattened header files to INCLUDE_PATHS
MK_EXC_HEADER_PATHS := $(strip $(patsubst %, -I%, $(MK_EXC_HEADER_PATHS)))
INCLUDE_PATHS += $(MK_EXC_HEADER_PATHS)
# Add the include flags determined above to various compiler flags variables.
CFLAGS := $(CFLAGS) $(INCLUDE_PATHS)
CFLAGS_NOOPT := $(CFLAGS_NOOPT) $(INCLUDE_PATHS)
CPPFLAGS := $(CPPFLAGS) $(INCLUDE_PATHS)
FFLAGS := $(FFLAGS) $(INCLUDE_PATHS)
CFLAGS_AVX := $(CFLAGS_AVX) $(INCLUDE_PATHS)
CFLAGS_AVX512 := $(CFLAGS_AVX512) $(INCLUDE_PATHS)
#
# --- Library object definitions -----------------------------------------------
#
# Convert source file paths to object file paths by replaying the base source
# directory with the base object directory, and also replacing the source file
# suffix (ie: '.c' or '.f') with '.o'.
MK_LAPACK_FBLAS_OBJS := $(patsubst $(SRC_PATH)/%.c, $(BASE_OBJ_PATH)/%.o, \
$(filter %.c, $(MK_LAPACK_FBLAS_SRC)))
MK_LAPACK_X86_OBJS := $(patsubst $(SRC_PATH)/%.c, $(BASE_OBJ_PATH)/%.o, \
$(filter %.c, $(MK_LAPACK_X86_SRC)))
MK_FLABLAS_F2C_OBJS := $(patsubst $(SRC_PATH)/%.c, $(BASE_OBJ_PATH)/%.o, \
$(filter %.c, $(MK_FLABLAS_F2C_SRC)))
MK_BASE_FLAMEC_OBJS := $(patsubst $(SRC_PATH)/%.c, $(BASE_OBJ_PATH)/%.o, \
$(filter %.c, $(MK_BASE_FLAMEC_SRC)))
MK_BLAS_FLAMEC_OBJS := $(patsubst $(SRC_PATH)/%.c, $(BASE_OBJ_PATH)/%.o, \
$(filter %.c, $(MK_BLAS_FLAMEC_SRC)))
MK_LAPACK_FLAMEC_OBJS := $(patsubst $(SRC_PATH)/%.c, $(BASE_OBJ_PATH)/%.o, \
$(filter %.c, $(MK_LAPACK_FLAMEC_SRC)))
MK_MAP_LAPACK2FLAMEC_OBJS := $(patsubst $(SRC_PATH)/%.c, $(BASE_OBJ_PATH)/%.o, \
$(filter %.c, $(MK_MAP_LAPACK2FLAMEC_SRC)))
MK_MAP_LAPACK2FLAMEC_F2C_OBJS := $(patsubst $(SRC_PATH)/%.c, $(BASE_OBJ_PATH)/%.o, \
$(filter %.c, $(MK_MAP_LAPACK2FLAMEC_F2C_SRC)))
MK_MAP_LAPACK2FLAMEC_F2C_FLAMEC_OBJS := $(patsubst $(SRC_PATH)/%.c, $(BASE_OBJ_PATH)/%.o, \
$(filter %.c, $(MK_MAP_LAPACK2FLAMEC_F2C_FLAMEC_SRC)))
MK_MAP_LAPACK2FLAMEC_F2C_INSTALL_OBJS := $(patsubst $(SRC_PATH)/%.c, $(BASE_OBJ_PATH)/%.o, \
$(filter %.c, $(MK_MAP_LAPACK2FLAMEC_F2C_INSTALL_SRC)))
LAPACKE_S_OBJS := $(patsubst $(LAPACKE_S_SRC_PATH)/%.c, $(LAPACKE_S_SRC_PATH)/%.o, \
$(shell find $(LAPACKE_S_SRC_PATH) -maxdepth 1 -name '*.c'))
LAPACKE_U_OBJS := $(patsubst $(LAPACKE_U_SRC_PATH)/%.c, $(LAPACKE_U_SRC_PATH)/%.o, \
$(shell find $(LAPACKE_U_SRC_PATH) -maxdepth 1 -name '*.c'))
# Combine the base, blas, and lapack libraries.
MK_ALL_FLAMEC_OBJS := $(MK_BASE_FLAMEC_OBJS) \
$(MK_BLAS_FLAMEC_OBJS) \
$(LAPACKE_S_OBJS) \
$(LAPACKE_U_OBJS) \
$(MK_LAPACK_FLAMEC_OBJS) \
$(MK_LAPACK_X86_OBJS) \
$(MK_LAPACK_FBLAS_OBJS)
# Prepend the flablas source code files, if requested
# LAPACK
ifeq ($(FLA_ENABLE_LAPACK2FLAME),yes)
MK_ALL_FLAMEC_OBJS := $(MK_MAP_LAPACK2FLAMEC_OBJS) \
$(MK_MAP_LAPACK2FLAMEC_F2C_OBJS) \
$(MK_MAP_LAPACK2FLAMEC_F2C_FLAMEC_OBJS) \
$(MK_MAP_LAPACK2FLAMEC_F2C_INSTALL_OBJS) \
$(MK_ALL_FLAMEC_OBJS)
endif
# BLAS
ifeq ($(FLA_ENABLE_BUILTIN_BLAS),yes)
ifeq ($(FLA_ENABLE_LAPACK2FLAME),no)
MK_FLABLAS_F2C_OBJS := $(MK_MAP_LAPACK2FLAMEC_F2C_INSTALL_OBJS) \
$(MK_FLABLAS_F2C_OBJS)
endif
MK_ALL_FLAMEC_OBJS := $(MK_FLABLAS_F2C_OBJS) \
$(MK_ALL_FLAMEC_OBJS)
endif
ifeq ($(ENABLE_EMBED_AOCLUTILS),1)
ifeq ($(strip $(LIBAOCLUTILS_LIBRARY_PATH)),)
LIBAOCLUTILS_OBJS :=
else
LIBAOCLUTILS_OBJS := $(shell mkdir -p $(LIBAOCLUTILS_OBJ_DIR); \
cd $(LIBAOCLUTILS_OBJ_DIR); \
ar -x $(LIBAOCLUTILS_LIBRARY_PATH); \
cd ..)
MK_ALL_FLAMEC_OBJS := $(LIBAOCLUTILS_OBJS) \
$(MK_ALL_FLAMEC_OBJS)
endif
endif
### Kyungjoo 2015.10.21
#AR_CHUNK_SIZE=4096
AR_CHUNK_SIZE=1024
#
# --- Targets/rules ------------------------------------------------------------
#
# --- Primary targets ---
ifeq ($(ENABLE_EMBED_AOCLUTILS),1)
ifeq ($(strip $(LIBAOCLUTILS_LIBRARY_PATH)),)
all: aoclutillib libs
endif
else
all: libs
endif
libs: libflame
check: checklibflame
install: libs install-libs install-lib-symlinks install-headers
uninstall: uninstall-libs uninstall-lib-symlinks uninstall-headers
clean: cleanh cleanlib
# --- Environment check rules ---
check-env: check-env-config check-env-fragments
check-env-config:
ifeq ($(CONFIG_MK_PRESENT),no)
$(error Cannot proceed: config.mk not detected! Run configure first)
endif
check-env-fragments: check-env-config
ifeq ($(MAKEFILE_FRAGMENTS_PRESENT),no)
$(error Cannot proceed: makefile fragments not detected! Run configure first)
endif
aoclutillib:
bash $(SCRIPTS_DIR)/script_aoclutil.sh LIBAOCLUTILS_GIT_URL=$(LIBAOCLUTILS_GIT_URL) LIBAOCLUTILS_GIT_TAG=$(LIBAOCLUTILS_GIT_TAG)
# --- Cosolidated header creation ---
flat-headers: check-env $(FLAME_H_FLAT) $(BLIS1_H_FLAT) $(FLAF2C_H_FLAT)
# Consolidated FLAME.h header creation
$(FLAME_H_FLAT): $(MK_HEADER_FILES)
ifeq ($(ENABLE_VERBOSE),yes)
$(FLATTEN_H) -c -v1 $(FLAME_H_SRC_PATH) $@ $(BASE_INC_PATH) "$(MK_HEADER_DIR_PATHS)"
else
@echo -n "Generating monolithic $(@)"
@$(FLATTEN_H) -c -v1 $(FLAME_H_SRC_PATH) $@ $(BASE_INC_PATH) "$(MK_HEADER_DIR_PATHS)"
@echo "Generated monolithic $@"
endif
# Consolidated blis1.h header creation
$(BLIS1_H_FLAT): $(MK_HEADER_FILES) $(FLAME_H_FLAT)
ifeq ($(ENABLE_VERBOSE),yes)
$(FLATTEN_H) -c -v1 $(BLIS1_H_SRC_PATH) $@ $(BASE_INC_PATH) "$(MK_HEADER_DIR_PATHS)"
else
@echo -n "Generating monolithic $(@)"
@$(FLATTEN_H) -c -v1 $(BLIS1_H_SRC_PATH) $@ $(BASE_INC_PATH) "$(MK_HEADER_DIR_PATHS)"
@echo "Generated monolithic $@"
endif
# Consolidated FLA_f2c.h header creation
# NOTE: This file doesn't actually need any inlining, but we do need to
# "install" it to $(BASE_INC_PATH), so we opt to go through the same
# motions as for FLAME.h and FLA_f2c.h.
$(FLAF2C_H_FLAT): $(MK_HEADER_FILES) $(FLAME_H_FLAT) $(BLIS1_H_FLAT)
ifeq ($(ENABLE_VERBOSE),yes)
$(FLATTEN_H) -c -v1 $(FLAF2C_H_SRC_PATH) $@ $(BASE_INC_PATH) "$(MK_HEADER_DIR_PATHS)"
else
@echo -n "Generating monolithic $(@)"
@$(FLATTEN_H) -c -v1 $(FLAF2C_H_SRC_PATH) $@ $(BASE_INC_PATH) "$(MK_HEADER_DIR_PATHS)"
@echo "Generated monolithic $@"
endif
# Consolidated FLA_f2c.h header creation
# --- Special source code / object code rules ---
FLA_AVXPATH=lapack/x86/avx2
$(BASE_OBJ_PATH)/$(FLA_AVXPATH)/%.o: $(SRC_PATH)/$(FLA_AVXPATH)/%.c $(CONFIG_MK_FILE) $(HEADERS_TO_FLATTEN)
ifeq ($(ENABLE_VERBOSE),yes)
$(CC) $(CFLAGS_AVX) -c $< -o $@
else
@echo "Compiling $<"
@$(CC) $(CFLAGS_AVX) -c $< -o $@
endif
FLA_AVX512PATH=lapack/x86/avx512
$(BASE_OBJ_PATH)/$(FLA_AVX512PATH)/%.o: $(SRC_PATH)/$(FLA_AVX512PATH)/%.c $(CONFIG_MK_FILE) $(HEADERS_TO_FLATTEN)
ifeq ($(ENABLE_VERBOSE),yes)
$(CC) $(CFLAGS_AVX512) -c $< -o $@
else
@echo "Compiling $<"
@$(CC) $(CFLAGS_AVX512) -c $< -o $@
endif
FLA_SLAMCH=base/flamec/util/lapack/mch/fla_slamch
$(BASE_OBJ_PATH)/$(FLA_SLAMCH).o: $(SRC_PATH)/$(FLA_SLAMCH).c $(CONFIG_MK_FILE) $(HEADERS_TO_FLATTEN)
ifeq ($(ENABLE_VERBOSE),yes)
$(CC) $(CFLAGS_NOOPT) -c $< -o $@
else
@echo "Compiling $<"
@$(CC) $(CFLAGS_NOOPT) -c $< -o $@
endif
ifeq ($(OS_NAME),Darwin)
ifeq ($(FLA_ENABLE_MAX_ARG_LIST_HACK),yes)
@echo $@ >> $(AR_OBJ_LIST_FILE)
endif
endif
FLA_DLAMCH=base/flamec/util/lapack/mch/fla_dlamch
$(BASE_OBJ_PATH)/$(FLA_DLAMCH).o: $(SRC_PATH)/$(FLA_DLAMCH).c $(CONFIG_MK_FILE) $(HEADERS_TO_FLATTEN)
ifeq ($(ENABLE_VERBOSE),yes)
$(CC) $(CFLAGS_NOOPT) -c $< -o $@
else
@echo "Compiling $<"
@$(CC) $(CFLAGS_NOOPT) -c $< -o $@
endif
ifeq ($(OS_NAME),Darwin)
ifeq ($(FLA_ENABLE_MAX_ARG_LIST_HACK),yes)
@echo $@ >> $(AR_OBJ_LIST_FILE)
endif
endif
# --- General source code / object code rules ---
# Default compilation rules
$(BASE_OBJ_PATH)/%.o: $(SRC_PATH)/%.c $(CONFIG_MK_FILE) $(HEADERS_TO_FLATTEN)
ifeq ($(ENABLE_VERBOSE),yes)
$(CC) $(CFLAGS) -c $< -o $@
else
@echo "Compiling $<"
@$(CC) $(CFLAGS) -c $< -o $@
endif
ifeq ($(OS_NAME),Darwin)
ifeq ($(FLA_ENABLE_MAX_ARG_LIST_HACK),yes)
@echo $@ >> $(AR_OBJ_LIST_FILE)
endif
endif
# --- All-purpose library rule (static and shared) ---
libflame: check-env $(MK_LIBS)
# --- Static library archiver rules ---
$(AOCLDTL_A_PATH):
ifeq ($(ENABLE_VERBOSE),yes)
$(MAKE) -e -C $(SRC_DIR)/$(AOCLDTL_DIR)
else
@echo -n "Generating AOCLDTL library"
$(MAKE) -e -C $(SRC_DIR)/$(AOCLDTL_DIR)
@echo "Generated AOCLDTL library"
endif
$(LIBFLAME_A_PATH): $(MK_ALL_FLAMEC_OBJS)
ifeq ($(ENABLE_VERBOSE),yes)
ifeq ($(FLA_ENABLE_MAX_ARG_LIST_HACK),yes)
ifeq ($(OS_NAME),Darwin)
### Kyungjoo 2015.10.21
$(CAT) $(AR_OBJ_LIST_FILE) | xargs -n$(AR_CHUNK_SIZE) $(AR) $(ARFLAGS) $@
### Previous hack (works on linux, not on osx; osx's ar does not support @file)
# echo $(ARFLAGS) $@ > $(AR_ARG_LIST_FILE)
# $(CAT) $(AR_OBJ_LIST_FILE) >> $(AR_ARG_LIST_FILE)
# $(AR) @$(AR_ARG_LIST_FILE)
else
ifeq ($(ENABLE_EMBED_AOCLUTILS),1)
$(file > [email protected],$^ $(shell ls $(LIBAOCLUTILS_OBJ_DIR)/*.o))
else
$(file > [email protected],$^)
endif
$(AR) $(ARFLAGS) $@ @[email protected]
$(RM_F) [email protected]
endif
else
# NOTE: Can't use $^ automatic variable as long as $(AR_OBJ_LIST_FILE) is in
# the list of prerequisites.
$(AR) $(ARFLAGS) $@ $^
endif
$(RANLIB) $@
# $(MKDIR) include_local
# cp -f $(MK_HEADER_FILES) include_local
else
@echo "Archiving $@"
ifeq ($(FLA_ENABLE_MAX_ARG_LIST_HACK),yes)
ifeq ($(OS_NAME),Darwin)
### Kyungjoo 2015.10.21
@$(CAT) $(AR_OBJ_LIST_FILE) | xargs -n$(AR_CHUNK_SIZE) $(AR) $(ARFLAGS) $@
### Previous hack (works on linux, not on osx; osx's ar does not support @file)
# @echo $(ARFLAGS) $@ > $(AR_ARG_LIST_FILE)
# @$(CAT) $(AR_OBJ_LIST_FILE) >> $(AR_ARG_LIST_FILE)
# @$(AR) @$(AR_ARG_LIST_FILE)
else
ifeq ($(ENABLE_EMBED_AOCLUTILS),1)
@$(file > [email protected],$^ $(shell ls $(LIBAOCLUTILS_OBJ_DIR)/*.o))
else
@$(file > [email protected],$^)
endif
@$(AR) $(ARFLAGS) $@ @[email protected]
@$(RM_F) [email protected]
endif
else
# NOTE: Can't use $^ automatic variable as long as $(AR_OBJ_LIST_FILE) is in
# the list of prerequisites.
@$(AR) $(ARFLAGS) $@ $^
endif
@$(RANLIB) $@
# @$(MKDIR) include_local
# @cp -f $(MK_HEADER_FILES) include_local
endif
# --- Shared library linker rules ---
$(LIBFLAME_SO_PATH): $(MK_ALL_FLAMEC_OBJS)
ifeq ($(ENABLE_VERBOSE),yes)
ifeq ($(FLA_ENABLE_MAX_ARG_LIST_HACK),yes)
ifeq ($(OS_NAME),Darwin)
$(CAT) $(AR_OBJ_LIST_FILE) | xargs -n$(AR_CHUNK_SIZE) $(AR) $(ARFLAGS) $(LIBFLAME_A)
$(LINKER) $(SOFLAGS) -o $@ -Wl,-force_load,$(LIBFLAME_A) $(LDFLAGS)
else
ifeq ($(ENABLE_EMBED_AOCLUTILS),1)
$(file > [email protected],$^ $(shell ls $(LIBAOCLUTILS_OBJ_DIR)/*.o))
else
@$(file > [email protected],$^)
endif
$(LINKER) $(SOFLAGS) -o $(LIBFLAME_SO_OUTPUT_NAME) @[email protected] $(LDFLAGS)
$(RM_F) [email protected]
endif
else
# NOTE: Can't use $^ automatic variable as long as $(AR_OBJ_LIST_FILE) is in
# the list of prerequisites.
$(LINKER) $(SOFLAGS) -o $(LIBFLAME_SO_OUTPUT_NAME) $^ $(LDFLAGS)
endif
else
@echo "Dynamically linking $@"
ifeq ($(FLA_ENABLE_MAX_ARG_LIST_HACK),yes)
ifeq ($(OS_NAME),Darwin)
@$(CAT) $(AR_OBJ_LIST_FILE) | xargs -n$(AR_CHUNK_SIZE) $(AR) $(ARFLAGS) $(LIBFLAME_A)
@$(LINKER) $(SOFLAGS) -o $@ -Wl,-force_load,$(LIBFLAME_A) $(LDFLAGS)
else
ifeq ($(ENABLE_EMBED_AOCLUTILS),1)
@$(file > [email protected],$^ $(shell ls $(LIBAOCLUTILS_OBJ_DIR)/*.o))
else
@$(file > [email protected],$^)
endif
@$(LINKER) $(SOFLAGS) -o $(LIBFLAME_SO_OUTPUT_NAME) @[email protected] $(LDFLAGS)
@$(RM_F) [email protected]
endif
else
# NOTE: Can't use $^ automatic variable as long as $(AR_OBJ_LIST_FILE) is in
# the list of prerequisites.
@$(LINKER) $(SOFLAGS) -o $(LIBFLAME_SO_OUTPUT_NAME) $^ $(LDFLAGS)
endif
endif
# Local symlink for shared library.
# NOTE: We use a '.loc' suffix to avoid filename collisions in case this
# rule is executed concurrently with the install-lib-symlinks rule, which
# also creates symlinks in the current directory (before installing them).
$(LIBFLAME_SO_MAJ_PATH): $(LIBFLAME_SO_PATH)
ifeq ($(ENABLE_VERBOSE),yes)
$(SYMLINK) $(<F) $(@F).loc
$(MV) $(@F).loc $(BASE_LIB_PATH)/$(@F)
else # ifeq ($(ENABLE_VERBOSE),no)
@echo "Creating symlink $@"
@$(SYMLINK) $(<F) $(@F).loc
@$(MV) $(@F).loc $(BASE_LIB_PATH)/$(@F)
endif
# Original implementation of the rule above.
# FGVZ: This rule has been observed to not work on at least one system, where
# it appears the ".in" file is not fully written out, or written out at all,
# prior to the shared library link command being executed.
#$(MK_ALL_FLAMEC_DLL): $(MK_ALL_FLAMEC_OBJS)
#ifeq ($(ENABLE_VERBOSE),yes)
#ifeq ($(FLA_ENABLE_MAX_ARG_LIST_HACK),yes)
# $(file > [email protected],$^)
# $(LINKER) -shared -Wl,-soname,libflame.so $(LDFLAGS) -o $@ @[email protected]
# $(RM) [email protected]
#else
# $(LINKER) -shared -Wl,-soname,libflame.so $(LDFLAGS) -o $@ $^
#endif
#else
# @echo "Dynamically linking $@"
#ifeq ($(FLA_ENABLE_MAX_ARG_LIST_HACK),yes)
# @$(file > [email protected],$^)
# @$(LINKER) -shared -Wl,-soname,libflame.so $(LDFLAGS) -o $@ @[email protected]
# @$(RM) [email protected]
#else
# @$(LINKER) -shared -Wl,-soname,libflame.so $(LDFLAGS) -o $@ $^
#endif
#endif
# --- Test suite rules ---
# The test binary executable filename.
#
# $(TEST_WRAPPER) ./$(TEST_BIN) ... > $(TEST_OUT_FILE)
#
# "TEST_WRAPPER can be used to set additional environment variables
# such as LD_LIBRARY_PATH, numactl and others"
#
TEST_BIN := test_$(LIBFLAME).x
TEST_WRAPPER ?=
TEST_CHECK := check-flametest.sh
# The location of the script that checks the BLIS testsuite output.
TEST_CHECK_PATH := $(DIST_PATH)/$(TEST_DIR)/$(TEST_CHECK)
test-bin: check-env $(TEST_BIN)
TEST_OUT_FILE := output.test
# Check the results of the LIBLFLAME tests.
$(TEST_BIN):
ifeq ($(ENABLE_VERBOSE),yes)
$(MAKE) -C $(TEST_DIR) -j
else
@$(MAKE) -C $(TEST_DIR) -j
endif
test-run: test-bin
ifeq ($(ENABLE_VERBOSE),yes)
cd $(TEST_DIR) && $(TEST_WRAPPER) ./$(TEST_BIN) 2>&1 | tee $(TEST_OUT_FILE)
else
@echo "Running $(TEST_BIN) with output redirected to '$(TEST_DIR)/$(TEST_OUT_FILE)'"
@echo "Please wait for tests to complete..."
@cd $(TEST_DIR) && $(TEST_WRAPPER) ./$(TEST_BIN) 2>&1 | tee $(TEST_OUT_FILE)
endif
# Test suite rules
FNAME := lapack
TEST_BIN_MAIN_TEST := test_$(FNAME).x
# The location of the script that checks the BLIS testsuite output.
CHECK_PATH_MAIN_TEST := $(DIST_PATH)/$(TEST_DIR_MAIN_TEST)/$(TEST_CHECK)
test-bin-main-test: check-env $(TEST_BIN_MAIN_TEST)
TEST_OUT_FILE_MAIN_TEST := output.test
# Exporting ILP64 to Main Test Suite
ifeq ($(FLA_ENABLE_ILP64),yes)
ILP64 := 1
endif
export ILP64
# Check the results of the LIBLFLAME tests.
$(TEST_BIN_MAIN_TEST):
ifeq ($(ENABLE_VERBOSE),yes)
$(MAKE) -C $(TEST_DIR_MAIN_TEST) -j
else
@$(MAKE) -C $(TEST_DIR_MAIN_TEST) -j
endif
test-run-main-test: test-bin-main-test
ifeq ($(ENABLE_VERBOSE),yes)
cd $(TEST_DIR_MAIN_TEST) && $(TEST_WRAPPER) ./$(TEST_BIN_MAIN_TEST) 2>&1 | tee $(TEST_OUT_FILE_MAIN_TEST)
else
@echo "Running $(TEST_BIN_MAIN_TEST) with output redirected to '$(TEST_DIR_MAIN_TEST)/$(TEST_OUT_FILE_MAIN_TEST)'"
@echo "Please wait for tests to complete..."
@cd $(TEST_DIR_MAIN_TEST) && $(TEST_WRAPPER) ./$(TEST_BIN_MAIN_TEST) 2>&1 | tee $(TEST_OUT_FILE_MAIN_TEST)
endif
checklibflame:test-run test-run-main-test
ifeq ($(ENABLE_VERBOSE),yes)
-sh $(TEST_CHECK_PATH) $(TEST_DIR)/$(TEST_OUT_FILE)
-sh $(CHECK_PATH_MAIN_TEST) $(TEST_DIR_MAIN_TEST)/$(TEST_OUT_FILE_MAIN_TEST)
else
-@sh $(TEST_CHECK_PATH) $(TEST_DIR)/$(TEST_OUT_FILE)
-@sh $(CHECK_PATH_MAIN_TEST) $(TEST_DIR_MAIN_TEST)/$(TEST_OUT_FILE_MAIN_TEST)
endif
# --- Install rules ---
# --- Install header rules ---
install-headers: check-env $(HEADERS_INST)
$(HEADERS_INST): $(HEADERS_TO_INSTALL) $(CONFIG_MK_FILE)
ifeq ($(ENABLE_VERBOSE),yes)
$(MKDIR) $(MK_INCL_DIR_INST)
$(INSTALL) -m 0644 $(HEADERS_TO_INSTALL) $(MK_INCL_DIR_INST)
else
@$(MKDIR) $(MK_INCL_DIR_INST)
@echo "Installing $(notdir $(HEADERS_TO_INSTALL)) into $(MK_INCL_DIR_INST)/"
@$(INSTALL) -m 0644 $(HEADERS_TO_INSTALL) $(MK_INCL_DIR_INST)
endif
# Run CPP Tests
checkcpp:
$(MAKE) -e -C $(CPP_TEST_DIR)
# --- Install library rules ---
install-libs: check-env $(MK_LIBS_INST)
# Install static library.
$(INSTALL_LIBDIR)/%.a: $(BASE_LIB_PATH)/%.a $(CONFIG_MK_FILE)
ifeq ($(ENABLE_VERBOSE),yes)
$(MKDIR) $(@D)
$(INSTALL) -m 0644 $< $@
$(INSTALL) -m 0644 $(AOCLDTL_A_PATH) $(INSTALL_LIBDIR)/$(AOCLDTL_A)
else
@echo "Installing $(@F) into $(INSTALL_LIBDIR)/"
@$(MKDIR) $(@D)
@$(INSTALL) -m 0644 $< $@
@$(INSTALL) -m 0644 $(AOCLDTL_A_PATH) $(INSTALL_LIBDIR)/$(AOCLDTL_A)
endif
# Install shared library.
$(INSTALL_LIBDIR)/%.$(LIBFLAME_SO_MMB_EXT): $(BASE_LIB_PATH)/%.$(SHLIB_EXT) $(CONFIG_MK_FILE)
ifeq ($(ENABLE_VERBOSE),yes)
$(MKDIR) $(@D)
$(INSTALL) -m 0755 $< $@
$(INSTALL) -m 0644 $(AOCLDTL_SO_PATH) $(INSTALL_LIBDIR)/$(AOCLDTL_SO)
else
@echo "Installing $(@F) into $(INSTALL_LIBDIR)/"
@$(MKDIR) $(@D)
@$(INSTALL) -m 0755 $< $@
@$(INSTALL) -m 0644 $(AOCLDTL_SO_PATH) $(INSTALL_LIBDIR)/$(AOCLDTL_SO)
endif
# --- Install-symlinks rules ---
install-lib-symlinks: check-env $(MK_LIBS_SYML)
$(INSTALL_LIBDIR)/%.$(SHLIB_EXT): $(INSTALL_LIBDIR)/%.$(LIBFLAME_SO_MMB_EXT)
ifeq ($(ENABLE_VERBOSE),yes)
$(SYMLINK) $(<F) $(@F)
$(MV) $(@F) $(INSTALL_LIBDIR)/
else
@echo "Installing symlink $(@F) into $(INSTALL_LIBDIR)/"
@$(SYMLINK) $(<F) $(@F)
@$(MV) $(@F) $(INSTALL_LIBDIR)/
endif
# Install shared library symlink containing only .so major version.
$(INSTALL_LIBDIR)/%.$(LIBFLAME_SO_MAJ_EXT): $(INSTALL_LIBDIR)/%.$(LIBFLAME_SO_MMB_EXT)
ifeq ($(ENABLE_VERBOSE),yes)
$(SYMLINK) $(<F) $(@F)
$(MV) $(@F) $(INSTALL_LIBDIR)/
else
@echo "Installing symlink $(@F) into $(INSTALL_LIBDIR)/"
@$(SYMLINK) $(<F) $(@F)
@$(MV) $(@F) $(INSTALL_LIBDIR)/
endif
# --- Clean rules ---
cleanmk:
ifeq ($(IS_CONFIGURED),yes)
ifeq ($(ENABLE_VERBOSE),yes)
- $(FIND) $(SRC_FRAG_PATH) -name "$(FRAGMENT_MK)" | $(XARGS) $(RM_F)
else
@echo "Removing makefile fragments from $(SRC_FRAG_PATH)"
@$(FIND) $(SRC_FRAG_PATH) -name "$(FRAGMENT_MK)" | $(XARGS) $(RM_F)
endif
endif
cleanh:
ifeq ($(IS_CONFIGURED),yes)
ifeq ($(ENABLE_VERBOSE),yes)
- $(RM_F) $(HEADERS_TO_FLATTEN)
else
@echo "Removing flattened header files from $(BASE_INC_PATH)"
@$(RM_F) $(HEADERS_TO_FLATTEN)
endif
endif
cleanlib:
ifeq ($(IS_CONFIGURED),yes)
ifeq ($(ENABLE_VERBOSE),yes)
- $(FIND) $(BASE_OBJ_PATH) -name "*.o" | $(XARGS) $(RM_F)
- $(FIND) $(LAPACKE_S_OBJS_PATH) -name "*.o" | $(XARGS) $(RM_F)
- $(FIND) $(LAPACKE_U_OBJS_PATH) -name "*.o" | $(XARGS) $(RM_F)
- $(RM_F) $(AOCLDTL_A_PATH)
- $(RM_F) $(AOCLDTL_SO_PATH)
- $(RM_F) $(AOCLDTL_obj_PATH)
- $(RM_F) $(AOCLDTL_gch_PATH)
- $(RM_F) $(BASE_LIB_PATH)/*