Adding AntlrInput::tokenTextSubstr
[cvc5.git] / config / mkbuilddir
1 #!/bin/sh
2 #
3 # mkbuilddir
4 # Morgan Deters <mdeters@cs.nyu.edu> for CVC4
5 #
6 # usage: mkbuilddir target build-type
7 #
8 # Sets up the builds/ directory for building build-type for target:
9 # - removes configure detritus from top-level source directory
10 # - makes builds/$target/$build_type directory if it's not already there
11 # - links builds/Makefile to (possibly nonexistent) build Makefile
12 # - creates the builds/current Makefile include snippet
13 # - links builds/src and builds/test into build directory
14 #
15
16 if [ $# -ne 2 ]; then
17 echo 'usage: mkbuilddir target build_type' >&2
18 exit 1
19 fi
20
21 target=$1
22 build_type=$2
23
24 echo Setting up "builds/$target/$build_type"...
25 rm -fv config.log config.status confdefs.h
26 mkdir -pv "builds/$target/$build_type"
27 ln -sfv "$target/$build_type/Makefile.builds" builds/Makefile
28
29 echo Creating builds/current...
30 (echo "# This is the most-recently-configured CVC4 build"; \
31 echo "# 'make' in the top-level source directory applies to this build"; \
32 echo "CURRENT_BUILD = $target/$build_type") > builds/current
33
34 for dir in src test; do
35 echo Linking builds/$dir...
36 rm -f "builds/$dir"
37 ln -sfv "$target/$build_type/$dir" "builds/$dir"
38 done
39