summaryrefslogtreecommitdiff
path: root/preload/Makefile
diff options
context:
space:
mode:
authorLauri Leukkunen <lle@rahina.org>2007-11-19 15:50:46 +0200
committerLauri Leukkunen <lle@rahina.org>2007-11-19 23:54:37 +0200
commit055cb965bf570257b6549ed9715bf7cd188a5d3c (patch)
tree6b06e5a38f44a9ac19642904aa70403d17d2d8f2 /preload/Makefile
parent4185a4978aa206c477efeeb84500dafb0809db6c (diff)
Incomplete OS X support
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
Diffstat (limited to 'preload/Makefile')
-rw-r--r--preload/Makefile25
1 files changed, 18 insertions, 7 deletions
diff --git a/preload/Makefile b/preload/Makefile
index 66a42c7..8a34a6a 100644
--- a/preload/Makefile
+++ b/preload/Makefile
@@ -2,15 +2,26 @@ objs := wrappers.o libsb2.o sb_exec.o
PROTOTYPEWARNINGS=-Wmissing-prototypes -Wstrict-prototypes
-$(D)/libsb2.so: $(call O,$(objs))
-$(D)/libsb2.so: luaif/libluaif.a luaif/liblua.a
-$(D)/libsb2.so: CFLAGS := $(CFLAGS) -fPIC -Wall -W \
- $(PROTOTYPEWARNINGS)
-$(D)/libsb2.so: LDFLAGS := $(LDFLAGS) -Wl,-soname=$(LIBSB2_SONAME) \
+
+ifeq ($(shell uname -s),Linux)
+LIBSB2_LDFLAGS = -Wl,-soname=$(LIBSB2_SONAME) \
-Wl,--retain-symbols-file=preload/ldexportlist
-$(D)/libsb2.so: LIBS := -ldl -lm -lpthread -lrt
+LIBSB2_LIBS = -lrt
+SHLIBEXT = dylib
+else
+#LIBSB2_LDFLAGS = -dynamiclib
+SHLIBEXT = so
+endif
+
+
+$(D)/libsb2.$(SHLIBEXT): $(call O,$(objs))
+$(D)/libsb2.$(SHLIBEXT): luaif/libluaif.a luaif/liblua.a
+$(D)/libsb2.$(SHLIBEXT): CFLAGS := $(CFLAGS) -fPIC -Wall -W \
+ $(PROTOTYPEWARNINGS)
+$(D)/libsb2.$(SHLIBEXT): LDFLAGS := $(LDFLAGS) $(LIBSB2_LDFLAGS)
+$(D)/libsb2.$(SHLIBEXT): LIBS := -ldl -lm -lpthread $(LIBSB2_LIBS)
-targets := $(targets) $(D)/libsb2.so
+targets := $(targets) $(D)/libsb2.$(SHLIBEXT)
$(D)/libsb2.o $(D)/sb_exec.o: preload/exported.h
$(D)/exported.h $(D)/ldexportlist: preload/wrappers.c