Matt Spinler | 12bdf05 | 2017-03-09 16:01:39 -0600 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | files=() |
Matt Spinler | 88d7b4d | 2017-09-18 14:08:01 -0500 | [diff] [blame] | 4 | dir=$1 #Base directory |
| 5 | types=($2) #List of types (convert to array) |
Matt Spinler | cc2403c | 2017-03-17 11:07:06 -0500 | [diff] [blame] | 6 | |
Matt Spinler | 12bdf05 | 2017-03-09 16:01:39 -0600 | [diff] [blame] | 7 | echo "openpower_procedures_cpp_files = \\" |
Matt Spinler | 88d7b4d | 2017-09-18 14:08:01 -0500 | [diff] [blame] | 8 | for ((i=0; i<${#types[@]}; ++i)); |
Matt Spinler | 12bdf05 | 2017-03-09 16:01:39 -0600 | [diff] [blame] | 9 | do |
Matt Spinler | 88d7b4d | 2017-09-18 14:08:01 -0500 | [diff] [blame] | 10 | type=${types[$i]} |
Matt Spinler | 12bdf05 | 2017-03-09 16:01:39 -0600 | [diff] [blame] | 11 | type=${type// /} #remove spaces |
Matt Spinler | cc2403c | 2017-03-17 11:07:06 -0500 | [diff] [blame] | 12 | for file in $(ls $dir/procedures/$type/*.cpp); |
Matt Spinler | 12bdf05 | 2017-03-09 16:01:39 -0600 | [diff] [blame] | 13 | do |
| 14 | files+=($file) |
| 15 | done |
| 16 | done |
| 17 | |
| 18 | for file in ${files[@]}; |
| 19 | do |
| 20 | echo " $file \\" |
| 21 | done |
| 22 | echo |
| 23 | |
| 24 | cat << MAKEFILE |
| 25 | openpower_procedures.cpp: \$(openpower_procedures_cpp_files) |
| 26 | cat \$^ > \$@ |
| 27 | |
| 28 | MAKEFILE |