~rcr/rirc

3edc5a832c66e6515c1317148d3be6da3e45700e — Richard Robbins 4 months ago 2263189
fix scripts, add compile flags to make output
M Makefile => Makefile +5 -4
@@ 22,6 22,7 @@ RIRC_CFLAGS += -std=c11 -I. -DVERSION=\"$(VERSION)\"
RIRC_CFLAGS += -D_POSIX_C_SOURCE=200809L
RIRC_CFLAGS += -D_DARWIN_C_SOURCE

LDFLAGS ?= -flto
LDFLAGS += -lpthread

SRC       := $(shell find $(PATH_SRC) -name '*.c' | sort)


@@ 34,20 35,20 @@ OBJS_T := $(patsubst $(PATH_SRC)/%.c, $(PATH_BUILD)/%.t,    $(SRC))
OBJS_T += $(PATH_BUILD)/utils/tree.t # Header only file

rirc: $(RIRC_LIBS) $(SRC_GPERF) $(OBJS_R)
	@echo "  CC    $@"
	@echo "$(CC) $(LDFLAGS) $@"
	@$(CC) $(LDFLAGS) -o $@ $(OBJS_R) $(RIRC_LIBS)

rirc.debug: $(RIRC_LIBS) $(SRC_GPERF) $(OBJS_D)
	@echo "  CC    $@"
	@echo "$(CC) $(LDFLAGS) $@"
	@$(CC) $(LDFLAGS) -o $@ $(OBJS_D) $(RIRC_LIBS)

$(PATH_BUILD)/%.o: $(PATH_SRC)/%.c $(CONFIG) | $(PATH_BUILD)
	@echo "  CC    $<"
	@echo "$(CC) $(CFLAGS) $<"
	@$(CPP) $(CFLAGS) $(RIRC_CFLAGS) -MM -MP -MT $@ -MF $(@:.o=.o.d) $<
	@$(CC)  $(CFLAGS) $(RIRC_CFLAGS) -c -o $@ $<

$(PATH_BUILD)/%.db.o: $(PATH_SRC)/%.c $(CONFIG) | $(PATH_BUILD)
	@echo "  CC    $<"
	@echo "$(CC) $(CFLAGS_DEBUG) $<"
	@$(CPP) $(CFLAGS_DEBUG) $(RIRC_CFLAGS) -MM -MP -MT $@ -MF $(@:.o=.o.d) $<
	@$(CC)  $(CFLAGS_DEBUG) $(RIRC_CFLAGS) -c -o $@ $<


M scripts/coverage.sh => scripts/coverage.sh +1 -1
@@ 14,7 14,7 @@ rm -rf $CDIR && mkdir -p $CDIR
make clean
make check

GCNO=$(find bld -name '*.t.gcno')
GCNO=$(find build -name '*.t.gcno')

FILTER=$(cat << 'EOF'
{

M scripts/sanitizers_build.sh => scripts/sanitizers_build.sh +2 -2
@@ 7,13 7,13 @@ export CC=clang
export CFLAGS_DEBUG="-fsanitize=address,undefined -fno-omit-frame-pointer"
export LDFLAGS="-fsanitize=address,undefined -fuse-ld=lld"

make -e clean rirc.debug
make clean rirc.debug

mv rirc.debug rirc.debug.address

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

make -e clean rirc.debug
make clean rirc.debug

mv rirc.debug rirc.debug.thread

M scripts/sanitizers_test.sh => scripts/sanitizers_test.sh +1 -1
@@ 9,4 9,4 @@ export LDFLAGS="-fsanitize=address,undefined -fuse-ld=lld"
# for core dumps:
# export ASAN_OPTIONS="abort_on_error=1:disable_coredump=0"

make -e clean check
make clean check

M scripts/stack_usage.sh => scripts/stack_usage.sh +3 -3
@@ 3,8 3,8 @@
set -e

export CC=gcc
export CFLAGS_DEBUG="-fstack-usage"
export CFLAGS="-fstack-usage"

make -e clean rirc.debug
make clean rirc

find bld -name "*.su" -exec cat "{}" ";" | sort -n -k2 | column -t
find build -name "*.su" -exec cat "{}" ";" | sort -n -k2 | column -t