Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / BUILDER / makefile / private / common / common.mk
1 # Version : 0.0.1
2 # Author : Cedric.Bilat@he-arc.ch
3 #
4
5 ifndef __COMMON_MK__
6 __COMMON_MK__=true
7
8 ###############################################
9 # COMMON #
10 ###############################################
11
12 ########################
13 # pivate #
14 ########################
15
16 API_ROOT:=${ROOT_MAKEFILE_PRIVATE}/api
17 API:=${API_ROOT}/cpp
18 API_CUDA:=${API_ROOT}/cuda
19
20 include dataProject.mk
21
22 ########
23 #c++11 #
24 ########
25
26 include ${ROOT_MAKEFILE_PRIVATE_COMMON}/c++11.mk
27
28 ########################
29 # macro #
30 ########################
31
32 #http://stackoverflow.com/questions/12315834/makefile-how-to-apply-an-equivalent-to-filter-on-multiple-wildcards
33 not-containing = $(foreach v,$2,$(if $(findstring $1,$v),,$v))
34 containing = $(foreach v,$2,$(if $(findstring $1,$v),$v))
35
36 #example
37 #LIST := a_old_tt x_old_da a_new_da q_ty_we
38 #LIST_OLD := $(call containing,old,$(LIST))
39 #LIST_NOT_OLD := $(call not-containing,old,$(LIST))
40
41 #http://stackoverflow.com/questions/16144115/makefile-remove-duplicate-words-without-sorting
42
43 #v1: linux : ko : win : ok
44 #define uniq =
45 # $(eval seen :=)
46 # $(foreach _,$1,$(if $(filter $_,${seen}),,$(eval seen += $_)))
47 # ${seen}
48 #endef
49 #exemple
50 #w := z z x x y c x
51 #w:=$(call uniq,${w})
52 #w:=$(strip ${w})
53 #${info ${w}}#print immediately ww
54
55 #v2 : linux ok : win ok
56 uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
57 #exemple
58 #w := z z x x y c x
59 #w:=$(call uniq,${w})
60 #${info ${w}}#print immediately ww
61
62 ###############################################
63 # End #
64 ###############################################
65
66 endif#__COMMON_MK__