build system: makefile for taler-wallet-cli

This commit is contained in:
Florian Dold 2022-10-28 14:58:08 +02:00
parent c32b80c176
commit 89a1b7119e
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
4 changed files with 43 additions and 29 deletions

5
.gitignore vendored
View File

@ -8,9 +8,8 @@ tsconfig.tsbuildinfo
build/ build/
# GNU-style build system # GNU-style build system
/configure configure
/build-system/config.mk .config.mk
/.config.mk
# Editor files # Editor files
\#*\# \#*\#

View File

@ -10,7 +10,7 @@ ava = node_modules/.bin/ava
nyc = node_modules/nyc/bin/nyc.js nyc = node_modules/nyc/bin/nyc.js
git-archive-all = ./build-system/taler-build-scripts/archive-with-submodules/git_archive_all.py git-archive-all = ./build-system/taler-build-scripts/archive-with-submodules/git_archive_all.py
include ./build-system/config.mk include .config.mk
.PHONY: dist .PHONY: dist
dist: dist:
@ -105,26 +105,6 @@ i18n: compile
# Some commands are only available when ./configure has been run # Some commands are only available when ./configure has been run
ifndef prefix
.PHONY: warn-noprefix install
warn-noprefix:
@echo "no prefix configured, did you run ./configure?"
install: warn-noprefix
else
install_target = $(prefix)/lib/taler-wallet-cli
.PHONY: install
install:
pnpm install --frozen-lockfile --filter @gnu-taler/taler-wallet-cli...
install -d $(prefix)/bin
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 ./packages/taler-wallet-cli/dist/taler-wallet-cli.js $(install_target)/node_modules/taler-wallet-cli/dist/
install ./packages/taler-wallet-cli/dist/taler-wallet-cli.js.map $(install_target)/node_modules/taler-wallet-cli/dist/
install ./packages/taler-wallet-cli/bin/taler-wallet-cli $(install_target)/node_modules/taler-wallet-cli/bin/
ln -sf $(install_target)/node_modules/taler-wallet-cli/bin/taler-wallet-cli $(prefix)/bin/taler-wallet-cli
endif
.PHONY: lint .PHONY: lint
lint: lint:

View File

@ -11,8 +11,16 @@ if ! git --version >/dev/null; then
fi fi
git submodule update --init git submodule update --init
rm -rf configure
cp build-system/taler-build-scripts/configure ./configure copy_configure() {
# Try making the configure script read-only to prevent src=$1
# accidental changes in the wrong place. dst=$2
chmod ogu-w ./configure || true rm -f $dst
cp $src $dst
# Try making the configure script read-only to prevent
# accidental changes in the wrong place.
chmod ogu-w $dst || true
}
our_configure=build-system/taler-build-scripts/configure
copy_configure "$our_configure" ./configure
copy_configure "$our_configure" ./packages/taler-wallet-cli/configure

View File

@ -0,0 +1,27 @@
# This Makefile has been placed in the public domain.
include .config.mk
all:
@echo use 'make install' to build and install taler-wallet-cli
ifndef prefix
.PHONY: warn-noprefix install
warn-noprefix:
@echo "no prefix configured, did you run ./configure?"
install: warn-noprefix
else
install_target = $(prefix)/lib/taler-wallet-cli
.PHONY: install
install:
pnpm install --frozen-lockfile --filter @gnu-taler/taler-wallet-cli...
install -d $(prefix)/bin
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.js $(install_target)/node_modules/taler-wallet-cli/dist/
install ./dist/taler-wallet-cli.js.map $(install_target)/node_modules/taler-wallet-cli/dist/
install ./bin/taler-wallet-cli $(install_target)/node_modules/taler-wallet-cli/bin/
ln -sf $(install_target)/node_modules/taler-wallet-cli/bin/taler-wallet-cli $(prefix)/bin/taler-wallet-cli
endif