summaryrefslogtreecommitdiff
path: root/src/trace-driven/traces-generator/Gbit_tool/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/trace-driven/traces-generator/Gbit_tool/Makefile')
-rw-r--r--src/trace-driven/traces-generator/Gbit_tool/Makefile23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/trace-driven/traces-generator/Gbit_tool/Makefile b/src/trace-driven/traces-generator/Gbit_tool/Makefile
new file mode 100644
index 0000000..fc0209a
--- /dev/null
+++ b/src/trace-driven/traces-generator/Gbit_tool/Makefile
@@ -0,0 +1,23 @@
+NVCC=nvcc -ccbin=`which gcc` -D_FORCE_INLINES
+NVBIT_PATH=../../core
+INCLUDES=-I$(NVBIT_PATH)
+LIBS=-L$(NVBIT_PATH) -lnvbit
+NVCC_PATH=-L $(subst bin/nvcc,lib64,$(shell which nvcc | tr -s /))
+SOURCES=$(wildcard *.cu)
+OBJECTS=$(SOURCES:.cu=.o)
+ARCH=35
+
+mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
+current_dir := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
+
+all: $(OBJECTS) $(NVBIT_PATH)/libnvbit.a
+ $(NVCC) -arch=sm_$(ARCH) -O3 *.o $(LIBS) $(NVCC_PATH) -lcuda -lcudart_static -shared -o ${current_dir}.so
+
+%.o: %.cu
+ $(NVCC) -dc -c -std=c++11 $(INCLUDES) -Xptxas -cloning=no -maxrregcount=16 -Xcompiler -Wall -arch=sm_$(ARCH) -O3 -Xcompiler -fPIC $< -o $@
+
+$(NVBIT_PATH)/libnvbit.a:
+ make -C $(NVBIT_PATH)
+
+clean:
+ rm -f *.so *.o