Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/nccl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Jeaugey <sjeaugey@nvidia.com>2016-06-16 02:54:57 +0300
committerSylvain Jeaugey <sjeaugey@nvidia.com>2016-06-16 04:18:44 +0300
commit08ddfe03d21198d8040e1a6dab7d3b1cff48cd67 (patch)
tree38fa6fc99843370b313e39ec9d1798f539a78b8b /Makefile
parent620491a64915354a827839dd8a2b86651cb0c187 (diff)
Rework debian packaging
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 29 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 90bb40f..70c4c27 100644
--- a/Makefile
+++ b/Makefile
@@ -62,7 +62,7 @@ else
endif
-.PHONY : lib clean test mpitest install
+.PHONY : lib clean debclean test mpitest install
.DEFAULT : lib
INCEXPORTS := nccl.h
@@ -168,3 +168,31 @@ $(MPITSTDIR)/% : test/mpi/%.cu $(TSTDEP)
@sed -e 's/.*://' -e 's/\\$$//' < $(@:%=%.d.tmp) | fmt -1 | \
sed -e 's/^ *//' -e 's/$$/:/' >> $(@:%=%.d)
@rm -f $(@:%=%.d.tmp)
+
+#### PACKAGING ####
+
+CUDA_VERSION ?= $(shell ls $(CUDA_LIB)/libcudart.so.* | head -1 | rev | cut -d "." -f -2 | rev)
+
+
+DEB_GEN_IN := $(shell ls debian/*.in)
+DEB_GEN := $(DEB_GEN_IN:.in=)
+
+DEB_REVISION ?= 1
+DEB_TIMESTAMP := $(shell date -R)
+
+deb : lib $(DEB_GEN)
+ @printf "Building Debian package"
+ debuild -eLD_LIBRARY_PATH -uc -us -d -b
+
+debclean :
+ rm -f $(DEB_GEN)
+
+debian/% : debian/%.in
+ @printf "Generating %-25s > %-24s\n" $< $@
+ sed -e "s/\$${nccl:Major}/$(VER_MAJOR)/g" \
+ -e "s/\$${nccl:Minor}/$(VER_MINOR)/g" \
+ -e "s/\$${nccl:Patch}/$(VER_PATCH)/g" \
+ -e "s/\$${nccl:Cuda}/$(CUDA_VERSION)/g" \
+ -e "s/\$${nccl:Debian}/$(DEB_REVISION)/g" \
+ -e "s/\$${nccl:Timestamp}/$(DEB_TIMESTAMP)/g" \
+ $< > $@