Skip to content

Instantly share code, notes, and snippets.

@sreimers
Last active September 10, 2023 10:11
Show Gist options
  • Save sreimers/1c61c98fb48569c259c7c59f5b911ad7 to your computer and use it in GitHub Desktop.
Save sreimers/1c61c98fb48569c259c7c59f5b911ad7 to your computer and use it in GitHub Desktop.
baresip makefile
#RELEASE += RelWithDebInfo
RELEASE += Debug
#FLAGS += -DHAVE_THREADS= -DCMAKE_C_FLAGS="-fanalyzer"
#FLAGS += -DCMAKE_C_FLAGS="-m32"
#FLAGS += -DCMAKE_C_FLAGS="-gdwarf-4 --coverage" -DHAVE_THREADS=
#FLAGS += -DCMAKE_C_FLAGS="-gdwarf-4" -DHAVE_THREADS=
#FLAGS += -DCMAKE_C_FLAGS="-gdwarf-4 -fsanitize=address" -DHAVE_THREADS= -DCMAKE_CXX_FLAGS="-fsanitize=address"
#FLAGS += -DCMAKE_C_FLAGS="-gdwarf-4 -fsanitize=thread" -DHAVE_THREADS= -DCMAKE_CXX_FLAGS="-fsanitize=thread"
#FLAGS += -DCMAKE_C_FLAGS="-Weverything -Wno-padded -Wno-extra-semi-stmtq -gdwarf-4 -fsanitize=undefined -fno-sanitize-recover" -DHAVE_THREADS= -DCMAKE_CXX_FLAGS="-fsanitize=undefined"
CC = clang
#CC = gcc
CXX = clang
.PHONY: libre
libre:
[ -d re/build ] || CC=$(CC) cmake -B re/build -S re -GNinja -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=$(RELEASE) $(FLAGS)
cmake --build re/build -j -t retest
# .PHONY: librem
# librem: libre
# [ -d rem/build ] || CC=$(CC) cmake -B rem/build -S rem -GNinja -DCMAKE_BUILD_TYPE=$(RELEASE) $(FLAGS)
# cmake --build rem/build -j -t librem.a
.PHONY: baresip
baresip: libre
[ -d baresip/build ] || CC=$(CC) CXX=$(CXX) cmake -B baresip/build -S baresip -GNinja -DSTATIC=1 -DCMAKE_BUILD_TYPE=$(RELEASE) $(FLAGS)
cmake --build baresip/build -j
# .PHONY: test
# test: libre
# [ -d retest/build ] || CC=$(CC) cmake -B retest/build -S retest -GNinja -DCMAKE_BUILD_TYPE=$(RELEASE) $(FLAGS)
# cmake --build retest/build -j
# export ASAN_OPTIONS=fast_unwind_on_malloc=0 && cd retest && build/retest -riv -m select
.PHONY: test
test: libre
cd re && build/test/retest -r -v
.PHONY: play
play: libre
[ -d play/build ] || CC=$(CC) cmake -B play/build -S play -GNinja -DCMAKE_BUILD_TYPE=$(RELEASE) $(FLAGS)
cmake --build play/build -j
.PHONY: restund
restund: libre
[ -d restund/build ] || CC=$(CC) cmake -B restund/build -S restund -GNinja -DCMAKE_BUILD_TYPE=$(RELEASE) $(FLAGS)
cmake --build restund/build -j
.PHONY: clean
clean:
rm -Rf re/build
rm -Rf retest/build
rm -Rf play/build
rm -Rf baresip/build
rm -Rf restund/build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment