summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-07-20 09:43:33 -0300
committerEuAndreh <eu@euandre.org>2025-07-20 09:43:33 -0300
commit6739d6ac8e968efddaa491e9d24d9b6804f3577a (patch)
tree0bf333eb615923822f0264430e905bb1aceead5e
parentsrc/sjs.mjs: Add reductions() (diff)
downloadsjs-6739d6ac8e968efddaa491e9d24d9b6804f3577a.tar.gz
sjs-6739d6ac8e968efddaa491e9d24d9b6804f3577a.tar.xz
Makefile: Update installation directory to be compatible with node
-rw-r--r--.gitignore2
-rw-r--r--Makefile13
-rw-r--r--package.json3
3 files changed, 11 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
index bf8600d..6520faf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,2 @@
-/node_modules/
+/node_modules
/src/*.exported.mjs
diff --git a/Makefile b/Makefile
index e91c876..c7da16d 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@ NAME_UC = $(NAME)
PREFIX = /usr
BINDIR = $(PREFIX)/bin
LIBDIR = $(PREFIX)/lib
-JSLIBDIR = $(LIBDIR)/javascript
+JSLIBDIR = $(LIBDIR)/node/$(NAME)
INCLUDEDIR = $(PREFIX)/include
SRCDIR = $(PREFIX)/src/$(NAME)
SHAREDIR = $(PREFIX)/share
@@ -30,7 +30,7 @@ all:
include deps.mk
sources = \
- src/$(NAME).mjs \
+ src/$(NAME).mjs \
derived-assets = \
@@ -85,11 +85,12 @@ clean:
## ensures that all installable artifacts are crafted beforehand.
install: all
mkdir -p \
- '$(DESTDIR)$(BINDIR)' \
- '$(DESTDIR)$(JSLIBDIR)' \
+ '$(DESTDIR)$(BINDIR)' \
+ '$(DESTDIR)$(JSLIBDIR)'/src \
'$(DESTDIR)$(SRCDIR)' \
- cp src/$(NAME).mjs '$(DESTDIR)$(JSLIBDIR)'
+ cp src/$(NAME).mjs '$(DESTDIR)$(JSLIBDIR)'/src
+ cp package.json '$(DESTDIR)$(JSLIBDIR)'
cp $(sources) '$(DESTDIR)$(SRCDIR)'
## Uninstalls from $(DESTDIR)$(PREFIX). This is a perfect mirror
@@ -97,7 +98,7 @@ install: all
## A dedicated test asserts that this is always true.
uninstall:
rm -rf \
- '$(DESTDIR)$(JSLIBDIR)'/$(NAME).mjs \
+ '$(DESTDIR)$(JSLIBDIR)' \
'$(DESTDIR)$(SRCDIR)' \
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..7f0f12b
--- /dev/null
+++ b/package.json
@@ -0,0 +1,3 @@
+{
+ "main": "src/sjs.mjs"
+}