summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
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 $@