4 # Copyright (c) Intel Corporation.
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted provided that the following conditions
11 # * Redistributions of source code must retain the above copyright
12 # notice, this list of conditions and the following disclaimer.
13 # * Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in
15 # the documentation and/or other materials provided with the
17 # * Neither the name of Intel Corporation nor the names of its
18 # contributors may be used to endorse or promote products derived
19 # from this software without specific prior written permission.
21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 SPDK_ROOT_DIR
:= $(CURDIR
)
37 include $(SPDK_ROOT_DIR
)/mk
/spdk.common.mk
40 DIRS-
$(CONFIG_SHARED
) += shared_lib
41 DIRS-y
+= examples app
include
42 DIRS-
$(CONFIG_TESTS
) += test
44 .PHONY
: all clean $(DIRS-y
) include/spdk
/config.h mk
/config.mk mk
/cc.mk \
45 cc_version cxx_version .libs_only_other .
ldflags ldflags
47 ifeq ($(SPDK_ROOT_DIR
)/lib
/env_dpdk
,$(CONFIG_ENV
))
48 ifeq ($(CURDIR
)/dpdk
/build
,$(CONFIG_DPDK_DIR
))
49 ifneq ($(SKIP_DPDK_BUILD
),1)
56 ifeq ($(CONFIG_SHARED
),y
)
65 $(Q
)rm -f
include/spdk
/config.h
68 $(Q
)echo
"Installed to $(DESTDIR)$(CONFIG_PREFIX)"
76 sh .
/scripts
/pkgdep.sh
78 $(DIRS-y
): mk
/cc.mk
include/spdk
/config.h
81 $(Q
)scripts
/detect_cc.sh
--cc=$(CC
) --cxx=$(CXX
) --lto
=$(CONFIG_LTO
) > $@.tmp
; \
82 cmp
-s
$@.tmp
$@ || mv
$@.tmp
$@
; \
85 include/spdk
/config.h
: mk
/config.mk scripts
/genconfig.py
86 $(Q
)PYCMD
=$$(cat PYTHON_COMMAND
2>/dev
/null
) ; \
87 test -z
"$$PYCMD" && PYCMD
=python
; \
88 echo
"#ifndef SPDK_CONFIG_H" > $@.tmp
; \
89 echo
"#define SPDK_CONFIG_H" >> $@.tmp
; \
90 $$PYCMD scripts
/genconfig.py
$(MAKEFLAGS
) >> $@.tmp
; \
91 echo
"#endif /* SPDK_CONFIG_H */" >> $@.tmp
; \
92 cmp
-s
$@.tmp
$@ || mv
$@.tmp
$@
; \
96 $(Q
)echo
"SPDK using CC=$(CC)"; $(CC
) -v
99 $(Q
)echo
"SPDK using CXX=$(CXX)"; $(CXX
) -v
102 $(Q
)echo
-n
'$(SYS_LIBS) '
103 $(Q
)if
[ "$(CONFIG_SHARED)" = "y" ]; then \
108 $(Q
)echo
-n
'$(LDFLAGS) '
110 ldflags: .
ldflags .libs_only_other
113 include $(SPDK_ROOT_DIR
)/mk
/spdk.subdirs.mk