Dan Albert | 2175caa | 2014-10-23 10:45:53 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | CXX=$1 |
| 3 | ARGS=${*:2} |
| 4 | DIR=external/libcxx/buildcmds |
| 5 | echo $ANDROID_BUILD_TOP/$CXX > $DIR/cxx_under_test |
| 6 | |
| 7 | echo $ARGS | grep -P '\S+\.cpp\b' > /dev/null |
| 8 | if [ $? -eq 0 ]; then |
| 9 | echo $ARGS | perl -ne 's/\S+\.cpp\b/%SOURCE%/; print' \ |
| 10 | | perl -ne 's/\S+\.o\b/%OUT%/; print' > $DIR/cxx.cmds |
| 11 | else |
Dan Albert | 90ed14b | 2015-05-12 10:05:09 -0700 | [diff] [blame] | 12 | echo $ARGS | perl -ne 's/out\/\S+\/EXECUTABLES\/\S+\.o\b/%SOURCE%/; print' \ |
Dan Albert | 2175caa | 2014-10-23 10:45:53 -0700 | [diff] [blame] | 13 | | perl -ne 's/-o\s+\S+\b/-o %OUT%/; print' > $DIR/link.cmds |
| 14 | fi |
| 15 | |
| 16 | $CXX $ARGS |