-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile-Amalgamed
47 lines (35 loc) · 970 Bytes
/
Makefile-Amalgamed
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
#
# This is a Makefile for building with the amalgamed sqlite3 version.
#
# Currently there is an issue linking to the shared sqlite3.so on Debian
# with gcc-9/-10. You may use this Makefile to overcome this problem.
#
# For this to work you must place sqlite3.c and sqlite3.h from an
# archive downloaded from https://www.sqlite.org/download.html in this
# directory.
#
# Usage: `make -f Makefile-Amalgamed`
CC=gcc
LD=$(CC)
LF=-shared -fPIC
RM=rm -rf
STRIP=strip
# --- lua5.1 ---
# CF=-Wall -Wno-unused -fPIC -I/usr/include/lua5.1 -I.
# --- lua5.2 ---
# CF=-Wall -Wno-unused -fPIC -I/usr/include/lua5.2 -I.
# --- lua5.3 ---
CF=-Wall -Wno-unused -fPIC -I/usr/include/lua5.3 -I.
all: lsqlite.so
lsqlite.so: lsqlite.o sqlite3.o
$(LD) $(LF) -o $@ $^ -lpthread
$(STRIP) $@
lsqlite.o: lsqlite.c
$(CC) $(CF) -c -o $@ $<
sqlite3.o: sqlite3.c
$(CC) $(CF) -c -o $@ $<
test: all
lua test.lua
re: clean all
clean:
$(RM) lsqlite.so lsqlite.o sqlite3.o test.db