Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / BUILDER / makefile / private / common / common.mk
diff --git a/WCudaMSE/BUILDER/makefile/private/common/common.mk b/WCudaMSE/BUILDER/makefile/private/common/common.mk
new file mode 100755 (executable)
index 0000000..93de0b6
--- /dev/null
@@ -0,0 +1,66 @@
+# Version      : 0.0.1\r
+# Author       : Cedric.Bilat@he-arc.ch\r
+#\r
+\r
+ifndef __COMMON_MK__\r
+__COMMON_MK__=true\r
+\r
+###############################################\r
+#                                      COMMON                                            #\r
+###############################################\r
+\r
+########################\r
+#      pivate             #\r
+########################\r
+\r
+API_ROOT:=${ROOT_MAKEFILE_PRIVATE}/api\r
+API:=${API_ROOT}/cpp\r
+API_CUDA:=${API_ROOT}/cuda\r
+\r
+include dataProject.mk\r
+\r
+########\r
+#c++11 #\r
+########\r
+\r
+include ${ROOT_MAKEFILE_PRIVATE_COMMON}/c++11.mk\r
+\r
+########################\r
+#      macro              #\r
+########################\r
+\r
+#http://stackoverflow.com/questions/12315834/makefile-how-to-apply-an-equivalent-to-filter-on-multiple-wildcards\r
+not-containing = $(foreach v,$2,$(if $(findstring $1,$v),,$v))\r
+containing = $(foreach v,$2,$(if $(findstring $1,$v),$v))\r
+\r
+#example\r
+#LIST := a_old_tt x_old_da a_new_da q_ty_we\r
+#LIST_OLD := $(call containing,old,$(LIST))\r
+#LIST_NOT_OLD := $(call not-containing,old,$(LIST))\r
+\r
+#http://stackoverflow.com/questions/16144115/makefile-remove-duplicate-words-without-sorting\r
+\r
+#v1: linux : ko : win : ok\r
+#define uniq =\r
+#      $(eval seen :=)\r
+#      $(foreach _,$1,$(if $(filter $_,${seen}),,$(eval seen += $_)))\r
+#      ${seen}\r
+#endef\r
+#exemple\r
+#w := z z x x y c x\r
+#w:=$(call uniq,${w})\r
+#w:=$(strip ${w})\r
+#${info ${w}}#print immediately ww\r
+\r
+#v2 : linux ok : win ok\r
+uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))\r
+#exemple\r
+#w := z z x x y c x\r
+#w:=$(call uniq,${w})\r
+#${info ${w}}#print immediately ww\r
+\r
+###############################################\r
+#                                      End                                               #\r
+###############################################\r
+\r
+endif#__COMMON_MK__\r