From a2d8f45087d26642cd68a9d806bc85219fccf8ce Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Mon, 13 Nov 2023 19:24:34 -0300 Subject: src/napi-sqlite.c: Add Node-API PoC --- Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Makefile') 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 $@ -- cgit v1.2.3