build system: support DESTDIR

This commit is contained in:
Florian Dold 2023-09-28 17:50:53 +02:00
parent 61424e2cb5
commit 467f968695
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
7 changed files with 57 additions and 45 deletions

View File

@ -9,6 +9,11 @@ git-archive-all = ./build-system/taler-build-scripts/archive-with-submodules/git
include .config.mk
# Let recursive Makefiles know that they're being invoked
# from the top-level makefile.
export TOPLEVEL := yes
export TOP_DESTDIR := $(abspath $(DESTDIR))
.PHONY: compile
compile:
pnpm install -r --frozen-lockfile
@ -121,18 +126,18 @@ lint:
install:
pnpm install --frozen-lockfile
pnpm run compile
make -C packages/taler-wallet-cli TOPLEVEL=yes install-nodeps
make -C packages/anastasis-cli TOPLEVEL=yes install-nodeps
make -C packages/taler-harness TOPLEVEL=yes install-nodeps
make -C packages/demobank-ui TOPLEVEL=yes install-nodeps
make -C packages/merchant-backoffice-ui TOPLEVEL=yes install-nodeps
make -C packages/aml-backoffice-ui TOPLEVEL=yes install-nodeps
$(MAKE) -C packages/taler-wallet-cli install-nodeps
$(MAKE) -C packages/anastasis-cli install-nodeps
$(MAKE) -C packages/taler-harness install-nodeps
$(MAKE) -C packages/demobank-ui install-nodeps
$(MAKE) -C packages/merchant-backoffice-ui install-nodeps
$(MAKE) -C packages/aml-backoffice-ui install-nodeps
.PHONY: install-tools
# Install taler-wallet-cli, anastasis-cli and taler-harness
install-tools:
pnpm install --frozen-lockfile --filter @gnu-taler/taler-wallet-cli... --filter @gnu-taler/anastasis-cli... --filter @gnu-taler/taler-harness...
pnpm run --filter @gnu-taler/taler-wallet-cli... --filter @gnu-taler/anastasis-cli... --filter @gnu-taler/taler-harness... compile
make -C packages/taler-wallet-cli TOPLEVEL=yes install-nodeps
make -C packages/anastasis-cli TOPLEVEL=yes install-nodeps
make -C packages/taler-harness TOPLEVEL=yes install-nodeps
$(MAKE) -C packages/taler-wallet-cli install-nodeps
$(MAKE) -C packages/anastasis-cli install-nodeps
$(MAKE) -C packages/taler-harness install-nodeps

View File

@ -3,6 +3,7 @@
ifeq ($(TOPLEVEL), yes)
$(info top-level build)
-include ../../.config.mk
override DESTDIR := $(TOP_DESTDIR)
else
$(info package-level build)
-include ../../.config.mk
@ -15,7 +16,7 @@ $(info prefix is $(prefix))
all:
@echo run \'make install\' to install
spa_dir=$(prefix)/share/taler/aml-backoffice-ui
spa_dir=$(DESTDIR)$(prefix)/share/taler/aml-backoffice-ui
.PHONY: install-nodeps
install-nodeps:

View File

@ -3,6 +3,7 @@
ifeq ($(TOPLEVEL), yes)
$(info top-level build)
-include ../../.config.mk
override DESTDIR := $(TOP_DESTDIR)
else
$(info package-level build)
-include ../../.config.mk
@ -20,19 +21,19 @@ warn-noprefix:
@echo "no prefix configured, did you run ./configure?"
install: warn-noprefix
else
install_target = $(prefix)/lib/anastasis-cli
bindir = $(DESTDIR)$(prefix)/bin
libdir = $(DESTDIR)$(prefix)/lib/anastasis-cli
nodedir = $(libdir)/node_modules/anastasis-cli
.PHONY: install install-nodeps deps
install-nodeps:
./build-node.mjs
install -d $(prefix)/bin
install -d $(install_target)/bin
install -d $(install_target)/node_modules/anastasis-cli
install -d $(install_target)/node_modules/anastasis-cli/bin
install -d $(install_target)/node_modules/anastasis-cli/dist
install ./dist/anastasis-cli-bundled.cjs $(install_target)/node_modules/anastasis-cli/dist/
install ./dist/anastasis-cli-bundled.cjs.map $(install_target)/node_modules/anastasis-cli/dist/
install ./bin/anastasis-cli.mjs $(install_target)/node_modules/anastasis-cli/bin/
ln -sf $(install_target)/node_modules/anastasis-cli/bin/anastasis-cli.mjs $(prefix)/bin/anastasis-cli
install -d $(bindir)
install -d $(nodedir)/bin
install -d $(nodedir)/dist
install ./dist/anastasis-cli-bundled.cjs $(nodedir)/dist/
install ./dist/anastasis-cli-bundled.cjs.map $(nodedir)/dist/
install ./bin/anastasis-cli.mjs $(nodedir)/bin/
ln -sf $(nodedir)/bin/anastasis-cli.mjs $(bindir)/anastasis-cli
deps:
pnpm install --frozen-lockfile --filter @gnu-taler/anastasis-cli...
install:

View File

@ -3,6 +3,7 @@
ifeq ($(TOPLEVEL), yes)
$(info top-level build)
-include ../../.config.mk
override DESTDIR := $(TOP_DESTDIR)
else
$(info package-level build)
-include ../../.config.mk
@ -15,7 +16,7 @@ $(info prefix is $(prefix))
all:
@echo run \'make install\' to install
spa_dir=$(prefix)/share/taler/demobank-ui
spa_dir=$(DESTDIR)$(prefix)/share/taler/demobank-ui
.PHONY: deps
deps:

View File

@ -3,6 +3,7 @@
ifeq ($(TOPLEVEL), yes)
$(info top-level build)
-include ../../.config.mk
override DESTDIR := $(TOP_DESTDIR)
else
$(info package-level build)
-include ../../.config.mk
@ -15,7 +16,7 @@ $(info prefix is $(prefix))
all:
@echo run \'make install\' to install
spa_dir=$(prefix)/share/taler/merchant-backoffice
spa_dir=$(DESTDIR)$(prefix)/share/taler/merchant-backoffice
.PHONY: deps
deps:

View File

@ -3,6 +3,7 @@
ifeq ($(TOPLEVEL), yes)
$(info top-level build)
-include ../../.config.mk
override DESTDIR := $(TOP_DESTDIR)
else
$(info package-level build)
-include ../../.config.mk
@ -20,19 +21,20 @@ warn-noprefix:
@echo "no prefix configured, did you run ./configure?"
install: warn-noprefix
else
install_target = $(prefix)/lib/taler-harness
BINDIR = $(DESTDIR)$(prefix)/bin
LIBDIR = $(DESTDIR)$(prefix)/lib/taler-harness
NODEDIR = $(LIBDIR)/node_modules/taler-harness
.PHONY: install deps install-nodeps
install-nodeps:
./build.mjs
install -d $(prefix)/bin
install -d $(install_target)/bin
install -d $(install_target)/node_modules/taler-harness
install -d $(install_target)/node_modules/taler-harness/bin
install -d $(install_target)/node_modules/taler-harness/dist
install ./dist/taler-harness-bundled.cjs $(install_target)/node_modules/taler-harness/dist/
install ./dist/taler-harness-bundled.cjs.map $(install_target)/node_modules/taler-harness/dist/
install ./bin/taler-harness.mjs $(install_target)/node_modules/taler-harness/bin/
ln -sf $(install_target)/node_modules/taler-harness/bin/taler-harness.mjs $(prefix)/bin/taler-harness
install -d $(BINDIR)
install -d $(NODEDIR)
install -d $(NODEDIR)/bin
install -d $(NODEDIR)/dist
install ./dist/taler-harness-bundled.cjs $(NODEDIR)/dist/
install ./dist/taler-harness-bundled.cjs.map $(NODEDIR)/dist/
install ./bin/taler-harness.mjs $(NODEDIR)/bin/
ln -sf $(NODEDIR)/bin/taler-harness.mjs $(BINDIR)/taler-harness
deps:
pnpm install --frozen-lockfile --filter @gnu-taler/taler-harness...
install:

View File

@ -3,6 +3,7 @@
ifeq ($(TOPLEVEL), yes)
$(info top-level build)
-include ../../.config.mk
override DESTDIR := $(TOP_DESTDIR)
else
$(info package-level build)
-include ../../.config.mk
@ -20,23 +21,23 @@ warn-noprefix:
@echo "no prefix configured, did you run ./configure?"
install: warn-noprefix
else
install_target = $(prefix)/lib/taler-wallet-cli
LIBDIR = $(DESTDIR)$(prefix)/lib/taler-wallet-cli
BINDIR=$(DESTDIR)$(prefix)/bin
NODEDIR=$(LIBDIR)/node_modules/taler-wallet-cli
.PHONY: install install-nodeps deps
install-nodeps:
./build-node.mjs
@echo installing wallet CLI to $(install_target)
install -d $(prefix)/bin
install -d $(install_target)/build
install -d $(install_target)/bin
install -d $(install_target)/node_modules/taler-wallet-cli
install -d $(install_target)/node_modules/taler-wallet-cli/bin
install -d $(install_target)/node_modules/taler-wallet-cli/dist
install ./dist/taler-wallet-cli-bundled.cjs $(install_target)/node_modules/taler-wallet-cli/dist/
install ./dist/taler-wallet-cli-bundled.cjs.map $(install_target)/node_modules/taler-wallet-cli/dist/
install ./bin/taler-wallet-cli.mjs $(install_target)/node_modules/taler-wallet-cli/bin/
install ../idb-bridge/node_modules/better-sqlite3/build/Release/better_sqlite3.node $(install_target)/build/ \
@echo installing wallet CLI to $(DESTDIR)$(prefix)
install -d $(BINDIR)
install -d $(LIBDIR)/build
install -d $(NODEDIR)/bin
install -d $(NODEDIR)/dist
install ./dist/taler-wallet-cli-bundled.cjs $(NODEDIR)/dist/
install ./dist/taler-wallet-cli-bundled.cjs.map $(NODEDIR)/dist/
install ./bin/taler-wallet-cli.mjs $(NODEDIR)/bin/
install ../idb-bridge/node_modules/better-sqlite3/build/Release/better_sqlite3.node $(LIBDIR)/build/ \
|| echo "sqlite3 unavailable, better-sqlite3 native module not found"
ln -sf $(install_target)/node_modules/taler-wallet-cli/bin/taler-wallet-cli.mjs $(prefix)/bin/taler-wallet-cli
ln -sf $(NODESIR)/bin/taler-wallet-cli.mjs $(BINDIR)/taler-wallet-cli
deps:
pnpm install --frozen-lockfile --filter @gnu-taler/taler-wallet-cli...
pnpm run --filter @gnu-taler/taler-wallet-cli... compile