about summary refs log tree commit diff stats
path: root/tools/browse_trace
blob: e68b541b9fa1fd0a47e1e62a7de484d0b0fd26c3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
set -e

test "$CXX" || export CXX=c++
test "$CC" || export CC=cc
test "$CFLAGS" || export CFLAGS="-g -O2"
export CFLAGS="$CFLAGS -Wall -Wextra -ftrapv -fno-strict-aliasing"

# build if doesn't exist
[ ! -f `dirname $0`/browse_trace_bin ] && (
  cd `dirname $0`
  [ ! -f termbox/libtermbox.a ] && (
    cd termbox
    $CC $CFLAGS -c utf8.c
    $CC $CFLAGS -c termbox.c
    ar rcs libtermbox.a *.o
  )
  $CXX $CFLAGS browse_trace.cc termbox/libtermbox.a -o browse_trace_bin
)

`dirname $0`/browse_trace_bin $*