-
Notifications
You must be signed in to change notification settings - Fork 36
/
mf-sqlite3extfunc.mingw64-cross
72 lines (63 loc) · 1.99 KB
/
mf-sqlite3extfunc.mingw64-cross
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
72
#!/usr/make
#
# Makefile for SQLITE3 extension functions, use in conjunction with
# mingw64-cross-build.sh
#### C Compile and options for use in building executables that
# will run on the target platform.
#
TCC = /opt/mingw64/bin/x86_64-w64-mingw32-gcc -O2 -DNO_TCL
# This is how we compile
#
TCCX = $(TCC) $(OPTS) $(THREADSAFE) $(USLEEP) -I. -Isqlite3 -Isqlite3/src
ifeq ($(MSVCRT),70)
TCCX += -D__MSVCRT_VERSION=0x0700
LMSVCRT = -nodefaultlibs -lmingw32 -lgcc_eh -lmoldname -lmingwex \
-lmingw32 -lgcc -lmsvcr70 \
-lgdi32 -lcomdlg32 \
-ladvapi32 -lshell32 -luser32 -lkernel32
endif
ifeq ($(MSVCRT),80)
TCCX += -D__MSVCRT_VERSION=0x0800
LMSVCRT = -nodefaultlibs -lmingw32 -lgcc_eh -lmoldname -lmingwex \
-lmingw32 -lgcc -lmsvcr80 \
-lgdi32 -lcomdlg32 \
-ladvapi32 -lshell32 -luser32 -lkernel32
endif
ifeq ($(MSVCRT),90)
TCCX += -D__MSVCRT_VERSION=0x0900
LMSVCRT = -nodefaultlibs -lmingw32 -lgcc_eh -lmoldname -lmingwex \
-lmingw32 -lgcc -lmsvcr90 \
-lgdi32 -lcomdlg32 \
-ladvapi32 -lshell32 -luser32 -lkernel32
endif
ifeq ($(MSVCRT),100)
TCCX += -D__MSVCRT_VERSION=0x0A00
LMSVCRT = -nodefaultlibs -lmingw32 -lgcc_eh -lmoldname -lmingwex \
-lmingw32 -lgcc -lmsvcr100 \
-lgdi32 -lcomdlg32 \
-ladvapi32 -lshell32 -luser32 -lkernel32
endif
ifeq ($(LMSVCRT),)
LMSVCRT = -lmsvcrt
endif
# MKSHLIB = gcc -shared
# SO = so
# SHPREFIX = lib
MKSHLIB = /opt/mingw64/bin/x86_64-w64-mingw32-ar -shared
SO = dll
# This is the default Makefile target. The objects listed here
# are what get build when you type just "make" with no arguments.
#
all: sqlite3_mod_extfunc.$(SO)
# Rules to build individual files
#
extfunc.o: extfunc.c
$(TCCX) -c extfunc.c
sqlite3_mod_extfunc.$(SO): extfunc.o
$(TCCX) -shared -Wl,--kill-at \
-Wl,-out-implib,libsqlite3extfunc.a -Wl,--strip-all \
-o sqlite3_mod_extfunc.$(SO) extfunc.o $(LMSVCRT)
clean:
rm -f extfunc.o libsqlite3extfunc.a sqlite3_mod_extfunc.$(SO)
semiclean:
rm -f extfunc.o libsqlite3extfunc.a