Chris@29
|
1
|
Chris@29
|
2 # Add to VECTOR_DEFINES the relevant options for your desired
|
Chris@29
|
3 # third-party library support.
|
Chris@29
|
4 #
|
Chris@29
|
5 # Available options are
|
Chris@29
|
6 #
|
Chris@29
|
7 # -DHAVE_IPP Intel's Integrated Performance Primitives are available
|
Chris@29
|
8 # -DHAVE_VDSP Apple's Accelerate framework is available
|
Chris@29
|
9 #
|
Chris@29
|
10 # These are optional (they affect performance, not function) and you
|
Chris@29
|
11 # may define more than one of them.
|
Chris@29
|
12 #
|
Chris@29
|
13 # Add any relevant -I flags for include paths as well.
|
Chris@29
|
14 #
|
Chris@29
|
15 # Note that you must supply the same flags when including bqvec
|
Chris@29
|
16 # headers later as you are using now when compiling the library. (You
|
Chris@29
|
17 # may find it simplest to just add the bqvec source files to your
|
Chris@29
|
18 # application's build system and not build a bqvec library at all.)
|
Chris@29
|
19
|
Chris@29
|
20 VECTOR_DEFINES := -DHAVE_VDSP
|
Chris@29
|
21
|
Chris@29
|
22
|
Chris@29
|
23 # Add to ALLOCATOR_DEFINES options relating to aligned malloc.
|
Chris@29
|
24 #
|
Chris@29
|
25 # Available options are
|
Chris@29
|
26 #
|
Chris@29
|
27 # -DHAVE_POSIX_MEMALIGN The posix_memalign call is available in sys/mman.h
|
Chris@29
|
28 # -DLACK_POSIX_MEMALIGN The posix_memalign call is not available
|
Chris@29
|
29 #
|
Chris@29
|
30 # -DMALLOC_IS_ALIGNED The malloc call already returns aligned memory
|
Chris@29
|
31 # -DMALLOC_IS_NOT_ALIGNED The malloc call does not return aligned memory
|
Chris@29
|
32 #
|
Chris@29
|
33 # -DUSE_OWN_ALIGNED_MALLOC No aligned malloc is available, roll your own
|
Chris@29
|
34 #
|
Chris@29
|
35 # -DLACK_BAD_ALLOC The C++ library lacks the std::bad_alloc exception
|
Chris@29
|
36 #
|
Chris@29
|
37 # Here "aligned" is assumed to mean "aligned enough for whatever
|
Chris@29
|
38 # vector stuff the space will be used for" which most likely means
|
Chris@29
|
39 # 16-byte alignment.
|
Chris@29
|
40 #
|
Chris@29
|
41 # The default is to use _aligned_malloc when building with Visual C++,
|
Chris@29
|
42 # system malloc when building on OS/X, and posix_memalign otherwise.
|
Chris@29
|
43 #
|
Chris@29
|
44 # Note that you must supply the same flags when including bqvec
|
Chris@29
|
45 # headers later as you are using now when compiling the library. (You
|
Chris@29
|
46 # may find it simplest to just add the bqvec source files to your
|
Chris@29
|
47 # application's build system and not build a bqvec library at all.)
|
Chris@29
|
48
|
Chris@29
|
49 ALLOCATOR_DEFINES := -DMALLOC_IS_ALIGNED
|
Chris@29
|
50
|
Chris@29
|
51
|
Chris@29
|
52 SRC_DIR := src
|
Chris@29
|
53 HEADER_DIR := bqvec
|
Chris@29
|
54
|
Chris@29
|
55 SOURCES := $(wildcard $(SRC_DIR)/*.cpp)
|
Chris@29
|
56 HEADERS := $(wildcard $(HEADER_DIR)/*.h) $(wildcard $(SRC_DIR)/*.h)
|
Chris@29
|
57
|
Chris@29
|
58 OBJECTS := $(SOURCES:.cpp=.o)
|
Chris@29
|
59 OBJECTS := $(OBJECTS:.c=.o)
|
Chris@29
|
60
|
Chris@29
|
61 CXXFLAGS := $(VECTOR_DEFINES) $(ALLOCATOR_DEFINES) -I$(HEADER_DIR) -O3 -ffast-math -Wall -Werror -fpic
|
Chris@29
|
62
|
Chris@29
|
63 LIBRARY := libbqvec.a
|
Chris@29
|
64
|
Chris@29
|
65 all: $(LIBRARY)
|
Chris@29
|
66
|
Chris@29
|
67 $(LIBRARY): $(OBJECTS)
|
Chris@29
|
68 $(AR) rc $@ $^
|
Chris@29
|
69
|
Chris@29
|
70 clean:
|
Chris@29
|
71 rm -f $(OBJECTS)
|
Chris@29
|
72
|
Chris@29
|
73 distclean: clean
|
Chris@29
|
74 rm -f $(LIBRARY)
|
Chris@29
|
75
|
Chris@29
|
76 depend:
|
Chris@29
|
77 makedepend -Y -fMakefile $(SOURCES) $(HEADERS)
|
Chris@29
|
78
|
Chris@29
|
79
|
Chris@29
|
80 # DO NOT DELETE
|
Chris@29
|
81
|
Chris@29
|
82 src/VectorOpsComplex.o: bqvec/VectorOpsComplex.h bqvec/VectorOps.h
|
Chris@29
|
83 src/VectorOpsComplex.o: bqvec/Restrict.h bqvec/ComplexTypes.h
|
Chris@29
|
84 src/Allocators.o: bqvec/Allocators.h bqvec/VectorOps.h bqvec/Restrict.h
|
Chris@29
|
85 bqvec/RingBuffer.o: bqvec/Barrier.h bqvec/Allocators.h bqvec/VectorOps.h
|
Chris@29
|
86 bqvec/RingBuffer.o: bqvec/Restrict.h
|
Chris@29
|
87 bqvec/VectorOpsComplex.o: bqvec/VectorOps.h bqvec/Restrict.h
|
Chris@29
|
88 bqvec/VectorOpsComplex.o: bqvec/ComplexTypes.h
|
Chris@29
|
89 bqvec/VectorOps.o: bqvec/Restrict.h
|
Chris@29
|
90 bqvec/Allocators.o: bqvec/VectorOps.h bqvec/Restrict.h
|