Skip to content

Commit bdde4a4

Browse files
committed
Light preprocessing scripts
1 parent 2f616ec commit bdde4a4

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

scripts/mock-includes.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
COMPILER=$1
2+
OUTPUT=$2
3+
4+
shift
5+
shift
6+
7+
${COMPILER} -nostdinc -nostdinc++ -E -I${OUTPUT} $* 2>&1 > /dev/null | \
8+
sed -n 's/^\(.*\)fatal error: '"'"'\(.*\)'"'"' file not found\(.*\)$/\2/p' |
9+
while read FILE
10+
do
11+
ADDENDUM="${OUTPUT}/$FILE"
12+
mkdir -p $(dirname $ADDENDUM)
13+
echo $ADDENDUM
14+
echo "__include_directive__ <$FILE>" > ${ADDENDUM}
15+
done

scripts/redirective.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#! /usr/bin/bash
2+
3+
COMPILER=$1
4+
5+
shift
6+
7+
${COMPILER} -D__include_directive__='#include' -E -CC $*

0 commit comments

Comments
 (0)