~rcr/rirc

ref: 3677744e47d9547597f5f28747614cb8d5437b8c rirc/scripts/build.sh -rwxr-xr-x 449 bytes
3677744e — Richard Robbins fix debug build linker flags 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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) "$@"