From bdb576d92a12e7e4450650fa18b858c1c1b62267 Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Wed, 1 Jul 2015 15:26:15 -0400 Subject: [PATCH] Add the ability to rename symbols --- Makefile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index a7fb33b..40eabe5 100644 --- a/Makefile +++ b/Makefile @@ -4,12 +4,13 @@ LIBOSXUNWIND_HOME = $(abspath .) CC = clang AR = ar +OBJCONV = objconv # Flags CPPFLAGS_add = -I$(LIBOSXUNWIND_HOME)/src -I$(LIBOSXUNWIND_HOME)/include -DNDEBUG -CFLAGS_add = -std=c99 -Wall -O3 -CXXFLAGS_add = -std=c++11 -Wall -O3 +CFLAGS_add = -std=c99 -Wall -O3 +CXXFLAGS_add = -std=c++11 -Wall -O3 LDFLAGS_add = -nodefaultlibs -Wl,-upward-lSystem -Wl,-umbrella,System -lstdc++ # Files (in src/) @@ -30,7 +31,7 @@ SRCS = Unwind-sjlj.c \ UnwindLevel1.c \ libuwind.cxx \ unw_getcontext.s \ - Registers.s + Registers.s # Building @@ -55,9 +56,15 @@ OBJS = $(patsubst %.c,%.c.o, \ libosxunwind.a: $(OBJS) +ifeq (,$(SYMFILE)) $(AR) -rcs libosxunwind.a $(OBJS) +else + $(AR) -rcs libosxunwind.a.orig $(OBJS) + $(OBJCONV) @$(SYMFILE) libosxunwind.a.orig libosxunwind.a +endif + libosxunwind.dylib: $(OBJS) - $(CC) -shared $(LDFLAGS_add) $(OBJS) $(LDFLAGS) -o libosxunwind.dylib + $(CC) -shared $(LDFLAGS_add) libosxunwind.a $(LDFLAGS) -o libosxunwind.dylib clean: rm -f $(OBJS) *.a *.dylib