summaryrefslogtreecommitdiffstats
path: root/src/spdk/ocf/example/simple/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/spdk/ocf/example/simple/Makefile')
-rw-r--r--src/spdk/ocf/example/simple/Makefile37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/spdk/ocf/example/simple/Makefile b/src/spdk/ocf/example/simple/Makefile
new file mode 100644
index 000000000..f19cae0c5
--- /dev/null
+++ b/src/spdk/ocf/example/simple/Makefile
@@ -0,0 +1,37 @@
+#
+# Copyright(c) 2019 Intel Corporation
+# SPDX-License-Identifier: BSD-3-Clause-Clear
+#
+
+OCFDIR=../../
+SRCDIR=src/
+INCDIR=include/
+
+SRC=$(shell find ${SRCDIR} -name \*.c)
+OBJS = $(patsubst %.c, %.o, $(SRC))
+PROGRAM=simple
+
+CC = gcc
+CFLAGS = -g -Wall -I${INCDIR} -I${SRCDIR}/ocf/env/
+LDFLAGS = -lm -lz -pthread
+
+all: sync
+ $(MAKE) $(PROGRAM)
+
+$(PROGRAM): $(OBJS)
+ $(CC) -o $@ $^ $(LDFLAGS)
+
+sync:
+ @$(MAKE) -C ${OCFDIR} inc O=$(PWD)
+ @$(MAKE) -C ${OCFDIR} src O=$(PWD)
+ @$(MAKE) -C ${OCFDIR} env O=$(PWD) OCF_ENV=posix
+
+clean:
+ @rm -rf $(PROGRAM) $(OBJS)
+
+distclean:
+ @rm -rf $(PROGRAM) $(OBJS)
+ @rm -rf src/ocf
+ @rm -rf include/ocf
+
+.PHONY: all clean