summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-11-13 19:24:34 -0300
committerEuAndreh <eu@euandre.org>2023-11-13 19:24:34 -0300
commita2d8f45087d26642cd68a9d806bc85219fccf8ce (patch)
tree7b49f6c857adba01a19f973cd3e5baad2dc5dd2c /Makefile
parenttests/assert-*.sh: Reuse rebuilt assets for tests (diff)
downloadpapod-a2d8f45087d26642cd68a9d806bc85219fccf8ce.tar.gz
papod-a2d8f45087d26642cd68a9d806bc85219fccf8ce.tar.xz
src/napi-sqlite.c: Add Node-API PoC
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 12 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 77ed6b4..e266dcd 100644
--- a/Makefile
+++ b/Makefile
@@ -15,13 +15,15 @@ SRCDIR = $(PREFIX)/src/$(NAME)
SHAREDIR = $(PREFIX)/share
LOCALEDIR = $(SHAREDIR)/locale
MANDIR = $(SHAREDIR)/man
+CFLAGS.so = $(CFLAGS) -fPIC
+LDFLAGS.so = $(LDFLAGS) -shared
## Where to store the installation. Empty by default.
DESTDIR =
.SUFFIXES:
-.SUFFIXES: .in
+.SUFFIXES: .in .c .lo .msg .cat
.in:
sed \
@@ -33,6 +35,9 @@ DESTDIR =
< $< > $@
if [ -x $< ]; then chmod +x $@; fi
+.c.lo:
+ $(CC) $(CFLAGS.so) -o $@ -c $<
+
manpages.en.in = \
@@ -70,6 +75,8 @@ derived-assets = \
node_modules/dir.sentinel \
node_modules/ \
node_modules/$(NAME) \
+ src/napi-sqlite.lo \
+ src/napi-sqlite.node \
side-assets = \
ircd.sock \
@@ -82,7 +89,10 @@ side-assets = \
all: $(derived-assets)
-$(manpages): Makefile
+$(manpages) src/napi-sqlite.lo: Makefile
+
+src/napi-sqlite.node: src/napi-sqlite.lo
+ $(CC) $(LDFLAGS.so) -o $@ src/napi-sqlite.lo
src/index.js:
ln -fs api.js $@