~rcr/rirc

1c0d4140b0e9ef8716cf5685cb48341f2c88c4e9 — Richard Robbins 17 days ago 5c69d72
fix build script
5 files changed, 29 insertions(+), 30 deletions(-)

M .gitignore
A scripts/build.sh
D scripts/compile_commands.sh
D scripts/entr.sh
M scripts/sanitizers_build.sh
M .gitignore => .gitignore +0 -1
@@ 8,7 8,6 @@
*.td
.cache
build
compile_commands.json
config.h
coverage
lib/mbedtls-*

A scripts/build.sh => scripts/build.sh +27 -0
@@ 0,0 1,27 @@
#!/bin/bash

# Development build script.
#
#  Usage:
#
#   $ ./scripts/build.sh [make targets]

set -e

export CC=clang
export LDFLAGS="-fuse-ld=lld"

if [ -x "$(command -v entr)" ]; then
	ENTR="entr -c"
fi

if [ -x "$(command -v bear)" ]; then
	BEAR="bear --append --output ./build/compile_commands.json --"
fi

make clean
make build

find -name '*.c' \
  -o -name '*.h' \
  -o -name Makefile | grep -v './lib/' | $ENTR $BEAR make -j $(nproc) "$@"

D scripts/compile_commands.sh => scripts/compile_commands.sh +0 -10
@@ 1,10 0,0 @@
#!/bin/bash

set -e

export CC=clang
export CFLAGS="-Wno-empty-translation-unit"

rm -f compile_commands.json

bear make clean rirc

D scripts/entr.sh => scripts/entr.sh +0 -17
@@ 1,17 0,0 @@
#!/bin/bash

# Usage: entr.sh [make targets]
#   e.g.:
#     $ clang-entr.sh
#     $ clang-entr.sh check
#     $ clang-entr.sh all check

set -e

export MAKEFLAGS="-j $(nproc)"

make clean

find -name '*.c' \
  -o -name '*.h' \
  -o -name Makefile | grep -v './lib/' | entr -c make "$@"

M scripts/sanitizers_build.sh => scripts/sanitizers_build.sh +2 -2
@@ 5,14 5,14 @@ set -e
export CC=clang

export CFLAGS_DEBUG="-fsanitize=address,undefined -fno-omit-frame-pointer"
export LDFLAGS="-fsanitize=address,undefined"
export LDFLAGS="-fsanitize=address,undefined -fuse-ld=lld"

make -e clean rirc.debug

mv rirc.debug rirc.debug.address

export CFLAGS_DEBUG="-fsanitize=thread,undefined -fno-omit-frame-pointer"
export LDFLAGS="-fsanitize=thread,undefined"
export LDFLAGS="-fsanitize=thread,undefined -fuse-ld=lld"

make -e clean rirc.debug