1# $OpenBSD: Makefile,v 1.1 2021/06/09 19:37:43 mortimer Exp $ 2 3.include <bsd.own.mk> 4 5USE_UNWIND=no 6.if ${COMPILER_VERSION} == "clang" 7USE_UNWIND=yes 8.endif 9 10LIB=execinfo 11SRCS=backtrace.c 12MAN= backtrace.3 13 14.if empty(CFLAGS:M-std=*) 15CFLAGS+= -std=gnu99 16.endif 17 18.if ${USE_UNWIND} == "yes" 19.PATH: ${SRCDIR} ${BSDSRCDIR}/gnu/llvm/libunwind/src 20.PATH: ${SRCDIR} ${BSDSRCDIR}/gnu/llvm/libcxx/src 21CXXFLAGS+= -I${BSDSRCDIR}/gnu/llvm/libunwind/include \ 22 -I${BSDSRCDIR}/gnu/llvm/libcxx/include 23CFLAGS+= -I${BSDSRCDIR}/gnu/llvm/libunwind/include 24 25CPPFLAGS+= -D_LIBUNWIND_IS_NATIVE_ONLY 26CPPFLAGS+= -DLIBUNWIND_USE_WEAK_PTHREAD 27CPPFLAGS+= -DNDEBUG 28CXXFLAGS+= -nostdlib -nostdinc++ -funwind-tables \ 29 -fno-exceptions -fno-rtti 30.if empty(CXXFLAGS:M-std=*) 31CXXFLAGS+= -std=c++11 32.endif 33 34SRCS+=unwind.c \ 35 Unwind-EHABI.cpp \ 36 Unwind-sjlj.c \ 37 UnwindLevel1-gcc-ext.c \ 38 UnwindLevel1.c \ 39 UnwindRegistersRestore.S \ 40 UnwindRegistersSave.S \ 41 libunwind.cpp \ 42 new.cpp 43 44.else # !${USE_UNWIND} 45SRCS+=builtin.c 46.endif 47 48VERSION_SCRIPT= ${.CURDIR}/Symbols.map 49 50includes: 51 cmp -s ${DESTDIR}/usr/include/execinfo.h ${.CURDIR}/execinfo.h || \ 52 ${INSTALL} ${INSTALL_COPY} -m 444 -o $(BINOWN) -g $(BINGRP) \ 53 ${.CURDIR}/execinfo.h ${DESTDIR}/usr/include/execinfo.h 54 55.include <bsd.lib.mk> 56