diff options
| author | Lieuwe <lieuwemo@gmail.com> | 2011-03-15 19:48:23 (GMT) |
|---|---|---|
| committer | Lieuwe <lieuwemo@gmail.com> | 2011-03-15 19:48:23 (GMT) |
| commit | f7bd1198b10d9cfe322988ff94816c76bfb2389f (patch) | |
| tree | d64fbbcd199b03c5f60f0ad1e04b9ff3bac726d9 /syntaxcheck.py | |
| parent | 2339084d15d72fdfc140ae4174936a64a6f02798 (diff) | |
| parent | fe5e4a6ddcdfcf501521be38ce7dba073dbfcb2a (diff) | |
| download | powder-f7bd1198b10d9cfe322988ff94816c76bfb2389f.zip powder-f7bd1198b10d9cfe322988ff94816c76bfb2389f.tar.gz | |
MERGE
Diffstat (limited to 'syntaxcheck.py')
| -rw-r--r-- | syntaxcheck.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/syntaxcheck.py b/syntaxcheck.py new file mode 100644 index 0000000..32335f1 --- /dev/null +++ b/syntaxcheck.py @@ -0,0 +1,18 @@ +import sys +import subprocess +if len(sys.argv)<2: + print("usage: syntaxcheck.py <filename>") + raise SystemExit + +fname=sys.argv[1] +cppargs=["-E"]+sys.argv[2:] + +p=subprocess.Popen(["gcc",fname]+cppargs,stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE) +ret=p.communicate() +if len(ret[1])>0: + print("errors hapened!") + print(repr(ret[1].decode())) + raise SystemExit(-1) + +print(len(ret[0].decode())) +#python syntaxcheck.py ./src/main.c -DINTERNAL -opowder -w -std=c99 -D_POSIX_C_SOURCE=200112L -Iincludes/ -O3 -ffast-math -ftree-vectorize -funsafe-math-optimizations -lSDL -lm -lbz2 -lpython2.7 -lm -L/usr/lib/python2.7/config -I/usr/include/python2.7 -march=native -DX86 -DX86_SSE3 -msse3 src/*.c src/elements/*.c -DLIN64
\ No newline at end of file |
