Matt Spinler | 12bdf05 | 2017-03-09 16:01:39 -0600 | [diff] [blame] | 1 | #!/bin/bash |
2 | |||||
3 | files=() | ||||
Matt Spinler | cc2403c | 2017-03-17 11:07:06 -0500 | [diff] [blame] | 4 | dir=$1 |
5 | args=("$@") | ||||
6 | |||||
Matt Spinler | 12bdf05 | 2017-03-09 16:01:39 -0600 | [diff] [blame] | 7 | echo "openpower_procedures_cpp_files = \\" |
Matt Spinler | cc2403c | 2017-03-17 11:07:06 -0500 | [diff] [blame] | 8 | for ((i=1; i<${#args[@]}; ++i)); |
Matt Spinler | 12bdf05 | 2017-03-09 16:01:39 -0600 | [diff] [blame] | 9 | do |
Matt Spinler | cc2403c | 2017-03-17 11:07:06 -0500 | [diff] [blame] | 10 | type=${args[$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 |