Blame build.sh

452870
#!/bin/bash
452870
452870
set -e
452870
20803a
20803a
TARGET="coolkbd"
e3897e
FLAGS="$(pkg-config --cflags --libs x11 xft xtst xrandr)"
20803a
FLAGS="$FLAGS -Wall"
20803a
MODE_FLAGS="-O3 -DNDEBUG"
20803a
20803a
20803a
if [ "$1" = "-debug" ]; then
20803a
  echo "debug mode"
20803a
  MODE_FLAGS="-g -O0"
20803a
  shift
20803a
elif [ "$1" = "-release" ]; then
20803a
  shift
20803a
fi
20803a
20803a
if [ ! -z "$1" ]; then
20803a
  TARGET="$1"
20803a
  shift
20803a
fi
20803a
3c2742
if [ ! -f "config.h" ]; then
3c2742
  echo "copy config.h from example"
3c2742
  cp config.h.example config.h
3c2742
fi
3c2742
3c2742
20803a
echo "build target: $TARGET"
20803a
echo cc main.c $MODE_FLAGS $FLAGS -o "$TARGET"
20803a
     cc main.c $MODE_FLAGS $FLAGS -o "$TARGET"
452870
452870
452870
echo done