blob: 91844ca55aaa6f94c1ffac3a9c0dea771e4b8ee2 (
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
diff --git i/jni/mdxmini/Makefile w/jni/mdxmini/Makefile
index 9b63041..53bc547 100644
--- i/jni/mdxmini/Makefile
+++ w/jni/mdxmini/Makefile
@@ -73,10 +73,9 @@ $(TARGET) : $(OBJS) $(LIB)
$(LIB): $(MKLIB)
$(MKLIB):
- make -f Makefile.lib
+ $(MAKE) -f Makefile.lib
-$(OBJDIR)/nlg.o: src/nlg.c
- $(CC) -o $@ $< -c $(CFLAGS)
+$(OBJDIR)/nlg.o: src/nlg.c $(MKLIB)
$(OBJDIR)/sdlplay.o: sdlplay.c
$(CC) -o $@ $< -c $(CFLAGS)
diff --git i/jni/mdxmini/mak/general.mak w/jni/mdxmini/mak/general.mak
index e56323b..51872ec 100644
--- i/jni/mdxmini/mak/general.mak
+++ w/jni/mdxmini/mak/general.mak
@@ -10,17 +10,16 @@ SLIBS =
LFLAGS =
ifdef DEBUG
-CFLAGS = -g -O0
+CFLAGS ?= -g -O0
OBJDIR = obj_dbg
else
-CFLAGS = -g -O3
+CFLAGS ?= -g -O3
OBJDIR = obj
endif
# iconv
ifneq ($(OS),Windows_NT)
-CFLAGS += -DUSE_ICONV
-LIBS += -liconv
+LIBS += -lm
endif
#
diff --git i/jni/mdxmini/mak/lib.mak w/jni/mdxmini/mak/lib.mak
index 38af592..c24a1af 100644
--- i/jni/mdxmini/mak/lib.mak
+++ w/jni/mdxmini/mak/lib.mak
@@ -3,13 +3,13 @@ LIB = $(OBJDIR)/libmdxmini.a
OBJFILES = mdxmini.o mdx2151.o mdxmml_ym2151.o
OBJFILES += pdxfile.o mdxfile.o pcm8.o ym2151.o nlg.o
-CFLAGS += -DUSE_NLG -I.
+CFLAGS += -DUSE_NLG -I. -fPIC
SRCDIR = src
OBJS = $(addprefix $(OBJDIR)/,$(OBJFILES))
-all : $(OBJDIR) $(LIB)
+all : $(OBJDIR) $(LIB) $(OBJDIR)/libmdxmini.so
$(OBJDIR) :
mkdir $(OBJDIR)
@@ -17,5 +17,8 @@ $(OBJDIR) :
$(LIB) : $(OBJS)
$(AR) rcs $@ $(OBJS)
+$(OBJDIR)/libmdxmini.so : $(OBJS)
+ $(CC) $(CFLAGS) -Wl,-Bsymbolic -shared -o $@ $^ $(LIBS)
+
$(OBJDIR)/%.o : $(SRCDIR)/%.c
$(CC) $(CFLAGS) -o $@ $< -c
|