7 # http://www.cyberciti.biz/faq/unix-linux-extract-filename-and-extension-in-bash/
8 # http://stackoverflow.com/questions/2625976/sorting-space-delimited-numbers-with-linux-bash
9 # http://stackoverflow.com/questions/3236871/how-to-return-a-string-value-from-a-bash-function
11 #-----------------------------------------------
13 #-----------------------------------------------
15 source .
/workspace_os_management.sh
17 #-----------------------------------------------
18 # CLassification Project
19 #-----------------------------------------------
26 #buildable: os specific only
33 setDataProject
=$(find ${workspaceRoot} -name 'dataProject.mk')
35 for filePath
in ${setDataProject}
38 folderPath
=${filePath%/*}
39 folder
=${folderPath##*/}
42 #echo "folderPath = " ${folderPath}
43 #echo "folder = " ${folder}
45 if [ -d .
/${folder} ] # test si folder est bien sun sous folder de workspaceRoot
49 if [[ ${folder} == *Etude
* ]]
51 setETUDE
="${setETUDE} ${folder}"
55 if [[ ${folder} == *Linux
* ]]
57 setLinux
="${setLinux} ${folder}"
59 elif [[ ${folder} == *Win
* ]]
61 setWin
="${setWin} ${folder}"
65 if [[ ${folder} == *Cuda
* ]]
67 setCUDA
="${setCUDA} ${folder}"
69 elif [[ ${folder} == *Intel
* ]]
71 setIntel
="${setIntel} ${folder}"
74 setCPP
="${setCPP} ${folder}"
80 #-----------------------------------------------
82 #-----------------------------------------------
85 # ie, ce qui est dans $1 mais pas dans $2
90 # result=$(sub "$un" "$deux")
91 # echo "result=" $result # donne a b d
108 #echo "[ $isFound $e2 ]"
109 if [[ $isFound != true
]]
116 #soustarction de Etude
117 setCPP
=$(sub "$setCPP" "$setETUDE")
118 setIntel
=$(sub "$setIntel" "$setETUDE")
119 setCUDA
=$(sub "$setCUDA" "$setETUDE")
121 #soustarction de os specific
122 if [[ $OS == "Linux" ]]
124 setCPP
=$(sub "$setCPP" "$setWin")
125 setIntel
=$(sub "$setIntel" "$setWin")
126 setCUDA
=$(sub "$setCUDA" "$setWin")
128 elif [[ $OS == "Win" ]]
130 setCPP
=$(sub "$setCPP" "$setLinux")
131 setIntel
=$(sub "$setIntel" "$setLinux")
132 setCUDA
=$(sub "$setCUDA" "$setLinux")
135 #-----------------------------------------------
137 #-----------------------------------------------
139 #setCPP=$(printf "%s\n" $setCPP | sort -n)
143 result
=$(printf "%s\n" $input | sort -n)
147 setCPP
=$(sorting "$setCPP")
148 setCUDA
=$(sorting "$setCUDA")
149 setETUDE
=$(sorting "$setETUDE")
150 setIntel
=$(sorting "$setIntel")
151 setLinux
=$(sorting "$setLinux")
152 setWin
=$(sorting "$setWin")
154 #-----------------------------------------------
155 # show classification
156 #-----------------------------------------------
163 for element
in ${input}
172 echo "--------------------------------------------------------------------------------------------------------"
173 echo "[Classification of project]"
175 echo " Workspace = "${workspaceRoot}
176 echo " State = Please wait ..."
179 echo "--------------------------------------------------------------------------------------------------------"
182 echo "[CUDA] Projects :"
185 echo "[CPP] Projects :"
188 echo "[CPP_Intel] Projects :"
191 echo "[Linux] Projects : "
194 echo "[WIN] Projects : "
197 echo "[ETUDE] Projects: (not build here)"
200 #Liasser de temps au user de voir classification
205 #-----------------------------------------------
207 #-----------------------------------------------