blob: 8960183d8ece610a93f002577ed2535b36639e1d [file] [log] [blame]
Matt Spinler12bdf052017-03-09 16:01:39 -06001#!/bin/bash
2
3files=()
Matt Spinler88d7b4d2017-09-18 14:08:01 -05004dir=$1 #Base directory
5types=($2) #List of types (convert to array)
Matt Spinlercc2403c2017-03-17 11:07:06 -05006
Matt Spinler12bdf052017-03-09 16:01:39 -06007echo "openpower_procedures_cpp_files = \\"
Matt Spinler88d7b4d2017-09-18 14:08:01 -05008for ((i=0; i<${#types[@]}; ++i));
Matt Spinler12bdf052017-03-09 16:01:39 -06009do
Matt Spinler88d7b4d2017-09-18 14:08:01 -050010 type=${types[$i]}
Matt Spinler12bdf052017-03-09 16:01:39 -060011 type=${type// /} #remove spaces
Matt Spinlercc2403c2017-03-17 11:07:06 -050012 for file in $(ls $dir/procedures/$type/*.cpp);
Matt Spinler12bdf052017-03-09 16:01:39 -060013 do
14 files+=($file)
15 done
16done
17
18for file in ${files[@]};
19do
20 echo " $file \\"
21done
22echo
23
24cat << MAKEFILE
25openpower_procedures.cpp: \$(openpower_procedures_cpp_files)
26 cat \$^ > \$@
27
28MAKEFILE