aboutsummaryrefslogtreecommitdiff
path: root/packages/anastasis-cli/Makefile
blob: 724a5e40d3be61e9660e502fceb943faef1cd651 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# This Makefile has been placed in the public domain.

ifeq ($(TOPLEVEL), yes)
  $(info top-level build)
  -include ../../.config.mk
  override DESTDIR := $(TOP_DESTDIR)
else
  $(info package-level build)
  -include ../../.config.mk
  -include .config.mk
endif

$(info prefix is $(prefix))

all:
	@echo use 'make install' to build and install anastasis-cli

ifndef prefix
.PHONY: warn-noprefix install
warn-noprefix:
	@echo "no prefix configured, did you run ./configure?"
install: warn-noprefix
else
bindir = $(prefix)/bin
libdir = $(prefix)/lib/anastasis-cli
nodedir = $(libdir)/node_modules/anastasis-cli
.PHONY: install install-nodeps deps
install-nodeps:
	./build-node.mjs
	install -d $(DESTDIR)$(bindir)
	install -d $(DESTDIR)$(nodedir)/bin
	install -d $(DESTDIR)$(nodedir)/dist
	install ./dist/anastasis-cli-bundled.cjs $(DESTDIR)$(nodedir)/dist/
	install ./dist/anastasis-cli-bundled.cjs.map $(DESTDIR)$(nodedir)/dist/
	install ./bin/anastasis-cli.mjs $(DESTDIR)$(nodedir)/bin/
	ln -sf ../lib/anastasis-cli/node_modules/anastasis-cli/bin/anastasis-cli.mjs $(DESTDIR)$(bindir)/anastasis-cli
deps:
	pnpm install --frozen-lockfile --filter @gnu-taler/anastasis-cli...
install:
	$(MAKE) deps
	$(MAKE) install-nodeps
endif