blob: b169e92ca83e884f10c04dd5a0df3cb2c687f96b [file] [log] [blame]
Dan Albert2175caa2014-10-23 10:45:53 -07001#!/bin/bash
2CXX=$1
3ARGS=${*:2}
4DIR=external/libcxx/buildcmds
5echo $ANDROID_BUILD_TOP/$CXX > $DIR/cxx_under_test
6
7echo $ARGS | grep -P '\S+\.cpp\b' > /dev/null
8if [ $? -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
11else
Dan Albert90ed14b2015-05-12 10:05:09 -070012 echo $ARGS | perl -ne 's/out\/\S+\/EXECUTABLES\/\S+\.o\b/%SOURCE%/; print' \
Dan Albert2175caa2014-10-23 10:45:53 -070013 | perl -ne 's/-o\s+\S+\b/-o %OUT%/; print' > $DIR/link.cmds
14fi
15
16$CXX $ARGS