X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=WCudaMSE%2FBUILDER%2Fmakefile%2Fprivate%2Fcommon%2Fcommon.mk;fp=WCudaMSE%2FBUILDER%2Fmakefile%2Fprivate%2Fcommon%2Fcommon.mk;h=93de0b6d9a7d36b0471a6fecb4c1554d89f28d9a;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/BUILDER/makefile/private/common/common.mk b/WCudaMSE/BUILDER/makefile/private/common/common.mk new file mode 100755 index 0000000..93de0b6 --- /dev/null +++ b/WCudaMSE/BUILDER/makefile/private/common/common.mk @@ -0,0 +1,66 @@ +# Version : 0.0.1 +# Author : Cedric.Bilat@he-arc.ch +# + +ifndef __COMMON_MK__ +__COMMON_MK__=true + +############################################### +# COMMON # +############################################### + +######################## +# pivate # +######################## + +API_ROOT:=${ROOT_MAKEFILE_PRIVATE}/api +API:=${API_ROOT}/cpp +API_CUDA:=${API_ROOT}/cuda + +include dataProject.mk + +######## +#c++11 # +######## + +include ${ROOT_MAKEFILE_PRIVATE_COMMON}/c++11.mk + +######################## +# macro # +######################## + +#http://stackoverflow.com/questions/12315834/makefile-how-to-apply-an-equivalent-to-filter-on-multiple-wildcards +not-containing = $(foreach v,$2,$(if $(findstring $1,$v),,$v)) +containing = $(foreach v,$2,$(if $(findstring $1,$v),$v)) + +#example +#LIST := a_old_tt x_old_da a_new_da q_ty_we +#LIST_OLD := $(call containing,old,$(LIST)) +#LIST_NOT_OLD := $(call not-containing,old,$(LIST)) + +#http://stackoverflow.com/questions/16144115/makefile-remove-duplicate-words-without-sorting + +#v1: linux : ko : win : ok +#define uniq = +# $(eval seen :=) +# $(foreach _,$1,$(if $(filter $_,${seen}),,$(eval seen += $_))) +# ${seen} +#endef +#exemple +#w := z z x x y c x +#w:=$(call uniq,${w}) +#w:=$(strip ${w}) +#${info ${w}}#print immediately ww + +#v2 : linux ok : win ok +uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1))) +#exemple +#w := z z x x y c x +#w:=$(call uniq,${w}) +#${info ${w}}#print immediately ww + +############################################### +# End # +############################################### + +endif#__COMMON_MK__