forked from droundy/fac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsparse.py
30 lines (24 loc) · 790 Bytes
/
sparse.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/python3
from __future__ import print_function
import glob, os, sys, platform, subprocess
myplatform = sys.platform
if myplatform == 'linux2':
myplatform = 'linux'
if myplatform != 'linux':
print('# cannot use sparse on platform', myplatform)
exit(0)
try:
ver = subprocess.check_output(['sparse', '--version'],
stderr=subprocess.STDOUT)
except:
print('# there is no sparse present')
exit(0)
myver = b'v0.5.0-'
if ver[:len(myver)] == myver:
print('# looking good!')
else:
print('# I am not confident with sparse version', ver)
for f in sorted(glob.glob('*.c')):
print('| sparse -Ibigbro -Wsparse-error %s > %s.sparse' % (f, f[:-2]))
print('> %s.sparse' % (f[:-2]))
print('< version-identifier.h')