Coq.py 563 Bytes
Newer Older
Robbert Krebbers's avatar
Robbert Krebbers committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# Copyright (c) 2012-2015, Robbert Krebbers.
# This file is distributed under the terms of the BSD license.
import SCons.Defaults, SCons.Tool, SCons.Util, os

def coq_emitter(target, source, env):
  base, _ = os.path.splitext(str(target[0]))
  target.append(base + ".glob")
  return target, source
Coq = SCons.Builder.Builder(
  action = '$COQC $COQFLAGS -q $SOURCE',
  suffix = '.vo',
  src_suffix = '.v',
  emitter = coq_emitter
)

def generate(env):
  env['COQC'] = 'coqc'
18
  env.Append(BUILDERS = { 'Coq' : Coq })
Robbert Krebbers's avatar
Robbert Krebbers committed
19 20 21

def exists(env):
  return env.Detect('coqc')