Commit 22eced89 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

build: simplify vtophys test Makefile



Use the standard pattern of OBJS automatically generated from C_SRCS,
and also link against libspdk_memory instead of including the object
file directly.

Change-Id: I0c8cd8996cde2bcc1f25d9d97811fff3b0bbc88b
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent d6cf6b44
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -34,18 +34,25 @@
SPDK_ROOT_DIR := $(CURDIR)/../../..
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk

APP = vtophys

C_SRCS = vtophys.c

CFLAGS += $(DPDK_INC)
OBJS =	$(SPDK_ROOT_DIR)/lib/memory/vtophys.o

all: vtophys
SPDK_LIBS += $(SPDK_ROOT_DIR)/lib/memory/libspdk_memory.a

LIBS += $(SPDK_LIBS) -lpthread $(DPDK_LIB) -lrt

OBJS  = $(C_SRCS:.c=.o)

all: $(APP)

vtophys: vtophys.o $(OBJS)
$(APP): $(OBJS) $(SPDK_LIBS)
	@echo "  LINK $@"
	$(Q)$(CC) $(LDFLAGS) -o vtophys vtophys.o $(OBJS) -lpthread $(DPDK_LIB) -lrt
	$(Q)$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)

clean:
	$(Q)rm -f vtophys vtophys.o *.d
	$(Q)rm -f $(OBJS) *.d $(APP)

include $(SPDK_ROOT_DIR)/mk/spdk.deps.mk