Minor fixes to get-abc script and configure stuff.
[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 : ${as_me:=mkbuilddir}
25 : ${as_echo:=echo}
26 : ${RM:=rm -f}
27 : ${MKDIR_P:=mkdir -p}
28 : ${LN_S:=ln -s}
29
30 $as_echo "$as_me: Setting up builds/$target/$build_type..."
31 $RM config.log config.status confdefs.h builds/Makefile
32 $MKDIR_P "builds/$target/$build_type"
33 $LN_S "$target/$build_type/Makefile.builds" builds/Makefile
34
35 $as_echo "$as_me: Creating builds/current..."
36 (echo "# This is the most-recently-configured CVC4 build"; \
37 echo "# 'make' in the top-level source directory applies to this build"; \
38 echo "CURRENT_BUILD = $target/$build_type") > builds/current
39
40 for dir in src test; do
41 $as_echo "$as_me: Linking builds/$dir..."
42 $RM "builds/$dir"
43 $LN_S "$target/$build_type/$dir" "builds/$dir"
44 done
45