From 4b927c0e6b1b5e7ad5e30ee35bde6ce5e34619e3 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Thu, 31 Jul 2025 17:43:12 -0300 Subject: Makefile: Install like a Node.js package --- Makefile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index da880fc..9e1c67c 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 @@ -85,11 +85,12 @@ clean: ## ensures that all installable artifacts are crafted beforehand. install: all mkdir -p \ - '$(DESTDIR)$(BINDIR)' \ - '$(DESTDIR)$(JSLIBDIR)' \ - '$(DESTDIR)$(SRCDIR)' \ + '$(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)' \ -- cgit v1.2.3