]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/spdk/mk/spdk.app_cxx.mk
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / spdk / mk / spdk.app_cxx.mk
index ac89609a923e0504017b84315c02963e1ceaf14c..d035a18e15db889530b854d85ce4eea8ba74f82d 100644 (file)
 #  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
-
 include $(SPDK_ROOT_DIR)/mk/spdk.app_vars.mk
 
-install: all
+# Applications in app/ go into build/bin/.
+# Applications in examples/ go into build/examples/.
+# Use findstring to identify if the current directory is in the app
+# directory. If it is, change the APP location to build.
+APP_NAME := $(notdir $(APP))
+ifneq (,$(findstring $(SPDK_ROOT_DIR)/app,$(CURDIR)))
+       APP := $(APP_NAME:%=$(SPDK_ROOT_DIR)/build/bin/%)
+else
+ifneq (,$(findstring $(SPDK_ROOT_DIR)/examples,$(CURDIR)))
+       APP := $(APP_NAME:%=$(SPDK_ROOT_DIR)/build/examples/%)
+endif
+endif
+
+LIBS += $(SPDK_LIB_LINKER_ARGS)
+
+CLEAN_FILES = $(APP)
+
+all : $(APP)
+       @:
+
+install: empty_rule
+
+uninstall: empty_rule
 
-uninstall:
+# To avoid overwriting warning
+empty_rule:
        @:
+
+$(APP) : $(OBJS) $(SPDK_LIB_FILES) $(ENV_LIBS)
+       $(LINK_CXX)
+
+clean :
+       $(CLEAN_C) $(CLEAN_FILES)
+
+include $(SPDK_ROOT_DIR)/mk/spdk.deps.mk