1# SPDX-License-Identifier: BSD-3-Clause 2# Copyright (C) 2016 Intel Corporation. 3# All rights reserved. 4# 5 6include $(SPDK_ROOT_DIR)/mk/spdk.app_vars.mk 7 8# Applications in app/ go into build/bin/. 9# Applications in examples/ go into build/examples/. 10# Use findstring to identify if the current directory is in the app 11# directory. If it is, change the APP location to build. 12APP_NAME := $(notdir $(APP)) 13ifneq (,$(findstring $(SPDK_ROOT_DIR)/app,$(CURDIR))) 14 APP := $(APP_NAME:%=$(SPDK_ROOT_DIR)/build/bin/%) 15else 16ifneq (,$(findstring $(SPDK_ROOT_DIR)/examples,$(CURDIR))) 17 APP := $(APP_NAME:%=$(SPDK_ROOT_DIR)/build/examples/%) 18endif 19endif 20 21APP := $(APP)$(EXEEXT) 22 23LIBS += $(SPDK_LIB_LINKER_ARGS) 24 25CLEAN_FILES = $(APP) 26 27all : $(APP) 28 @: 29 30install: empty_rule 31 32uninstall: empty_rule 33 34# To avoid overwriting warning 35empty_rule: 36 @: 37 38$(APP) : $(OBJS) $(SPDK_LIB_FILES) $(ENV_LIBS) 39 $(LINK_CXX) 40 41clean : 42 $(CLEAN_C) $(CLEAN_FILES) 43 44include $(SPDK_ROOT_DIR)/mk/spdk.deps.mk 45