terrible libexecinfo port from freebsd
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
libexecinfo/Makefile

44 lines
1.2 KiB

SOVERSION := 1
SONAME := libexecinfo.so.$(SOVERSION)
DESTDIR ?=
PREFIX ?= /usr
LIBDIR ?= lib
INCDIR ?= include
CFLAGS ?= -Os
CFLAGS += -std=c99 -D_BSD_SOURCE -fpic -fPIC -fno-omit-frame-pointer
CFLAGS += `pkg-config --cflags libelf`
LIBS := `pkg-config --libs libelf`
all: libexecinfo.so.$(SOVERSION)
libexecinfo.so.$(SOVERSION): backtrace.o symtab.o unwind.o
$(CC) -shared -o $@ -Wl,-soname,$(SONAME) $(CFLAGS) $(LDFLAGS) $^ $(LIBS)
install:
install -Dm755 -t $(DESTDIR)$(PREFIX)/$(LIBDIR)/ $(SONAME)
ln -sf $(SONAME) $(DESTDIR)$(PREFIX)/$(LIBDIR)/libexecinfo.so
install -Dm644 -t $(DESTDIR)$(PREFIX)/$(INCDIR)/ execinfo.h
test:
# just see if nothing segfaults..
$(CC) -o testbin -Os test.c ./$(SONAME) -I.
LD_LIBRARY_PATH="$$PWD" ./testbin 50
$(CC) -o testbin -O2 test.c ./$(SONAME) -I.
LD_LIBRARY_PATH="$$PWD" ./testbin 50
$(CC) -o testbin -O3 test.c ./$(SONAME) -I.
LD_LIBRARY_PATH="$$PWD" ./testbin 50
$(CC) -o testbin -O0 -g test.c ./$(SONAME) -I.
LD_LIBRARY_PATH="$$PWD" ./testbin 50
clean:
rm -f libexecinfo.so* *.o
dist:
git archive --format=tar -o libexecinfo-$(VERSION).tar --prefix=libexecinfo-$(VERSION)/ $(VERSION)
xz -e -9 -vv libexecinfo-$(VERSION).tar
.PHONY: all clean install test dist