summaryrefslogtreecommitdiff
path: root/dma/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'dma/Makefile')
-rw-r--r--dma/Makefile38
1 files changed, 38 insertions, 0 deletions
diff --git a/dma/Makefile b/dma/Makefile
new file mode 100644
index 0000000..7400791
--- /dev/null
+++ b/dma/Makefile
@@ -0,0 +1,38 @@
+CC ?= gcc
+
+TARGET := doca_dma_host_recv
+SRCS := host_recv.c
+
+CFLAGS += -O2 -g -Wall -Wextra -std=gnu11
+CFLAGS += -Wno-deprecated-declarations
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
+# Prefer pkg-config from the upgraded DOCA installation.
+PKGCONFIG_PKGS := doca-common doca-dma
+
+PKG_CFLAGS := $(shell pkg-config --cflags $(PKGCONFIG_PKGS) 2>/dev/null)
+PKG_LIBS := $(shell pkg-config --libs $(PKGCONFIG_PKGS) 2>/dev/null)
+
+# Fallback for common DOCA 2.9 host install paths.
+ifeq ($(strip $(PKG_CFLAGS)),)
+CFLAGS += -I/opt/mellanox/doca/include
+else
+CFLAGS += $(PKG_CFLAGS)
+endif
+
+ifeq ($(strip $(PKG_LIBS)),)
+LDFLAGS += -L/opt/mellanox/doca/lib/x86_64-linux-gnu
+LDLIBS += -ldoca_dma -ldoca_common
+else
+LDLIBS += $(PKG_LIBS)
+endif
+
+LDLIBS += -lpthread -lrt
+
+all: $(TARGET)
+
+$(TARGET): $(SRCS)
+ $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS)
+
+clean:
+ rm -f $(TARGET) descriptor.bin buffer.json