blob: 3b758a3f37ef4aaa766edecb75f9bf21989a91b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
--- a/Makefile 2018-10-04 09:19:28.000000000 +0000
+++ b/Makefile 2018-10-04 09:19:28.000000000 +0000
@@ -20,7 +20,7 @@
# Do not specify CFLAGS or LIBS on the make invocation line - specify
# XCFLAGS or XLIBS instead. Make ignores any lines in the makefile that
# set a variable that was set on the command line.
-CFLAGS += $(XCFLAGS) -Iinclude
+CFLAGS += $(XCFLAGS) -Iinclude -fPIC
LIBS += $(XLIBS) -lm
ifneq ($(threading),no)
@@ -58,6 +58,7 @@
RANLIB_CMD = $(QUIET_RANLIB) $(RANLIB) $@
endif
LINK_CMD = $(QUIET_LINK) $(MKTGTDIR) ; $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+LINK_SHARED_CMD = $(QUIET_LINK) $(CC) $(LDFLAGS) -shared -Wl,-soname,$(notdir $@) -o $@ $^ $(LIBS)
TAGS_CMD = $(QUIET_TAGS) ctags -R
WINDRES_CMD = $(QUIET_WINDRES) $(MKTGTDIR) ; $(WINDRES) $< $@
OBJCOPY_CMD = $(QUIET_OBJCOPY) $(MKTGTDIR) ; $(LD) -r -b binary -o $@ $<
@@ -68,6 +69,9 @@
$(AR_CMD)
$(RANLIB_CMD)
+$(OUT)/%.so.0: $(OUT)/%.a
+ $(LINK_SHARED_CMD)
+
$(OUT)/%.exe: %.c
$(LINK_CMD)
@@ -190,8 +194,8 @@
# --- Library ---
-MUPDF_LIB = $(OUT)/libmupdf.a
-THIRD_LIB = $(OUT)/libmupdf-third.a
+MUPDF_LIB = $(OUT)/libmupdf.so.0
+THIRD_LIB = $(OUT)/libmupdfthird.so.0
THREAD_LIB = $(OUT)/libmupdf-threads.a
PKCS7_LIB = $(OUT)/libmupdf-pkcs7.a
|