From f6435ca8cbbaafd16c32adc82cd4e8b75041fc10 Mon Sep 17 00:00:00 2001
From: Simone Bna <s.bn@cineca.it>
Date: Mon, 16 Nov 2020 18:37:53 +0100
Subject: [PATCH] added wmake rules

---
 Make/files   |  3 +++
 Make/nvcc    | 14 ++++++++++++++
 Make/options | 13 +++++++++++++
 3 files changed, 30 insertions(+)
 create mode 100644 Make/files
 create mode 100644 Make/nvcc
 create mode 100644 Make/options

diff --git a/Make/files b/Make/files
new file mode 100644
index 0000000..cb0a247
--- /dev/null
+++ b/Make/files
@@ -0,0 +1,3 @@
+FOAM2CSR.cu
+
+LIB = $(FOAM_MODULE_LIBBIN)/libfoam2csr
diff --git a/Make/nvcc b/Make/nvcc
new file mode 100644
index 0000000..2140fdc
--- /dev/null
+++ b/Make/nvcc
@@ -0,0 +1,14 @@
+SUFFIXES += .cu
+
+NVARCH = 70
+
+NVCC        = nvcc -std=c++14 --compiler-options='-fPIC' -arch=sm_$(NVARCH)
+
+cuFLAGS     = -O3
+
+cutoo       = $(WM_SCHEDULER) $(NVCC) $(cuFLAGS) -I$(*D) $(LIB_HEADER_DIRS) -c $*.cu -o $@
+
+$(OBJECTS_DIR)/%.o : %.cu
+	$(cutoo)
+
+LINKLIBSO   = $(NVCC) -shared
diff --git a/Make/options b/Make/options
new file mode 100644
index 0000000..fdf5ba6
--- /dev/null
+++ b/Make/options
@@ -0,0 +1,13 @@
+include $(OBJECTS_DIR)/../nvcc
+
+sinclude $(GENERAL_RULES)/module-path-user
+
+/* Failsafe - default to user location */
+ifeq (,$(strip $(FOAM_MODULE_LIBBIN)))
+    FOAM_MODULE_LIBBIN = $(FOAM_USER_LIBBIN)
+endif
+
+EXE_INC = \
+    -I. \
+    -I$(CUBROOT)
+
-- 
GitLab