summaryrefslogtreecommitdiff
path: root/packages/taler-util/Makefile
blob: def16c8237303784f03c2e4136baae6f83169440 (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 taler-util

ifndef prefix
.PHONY: warn-noprefix install
warn-noprefix:
	@echo "no prefix configured, did you run ./configure?"
install: warn-noprefix
else
LIBDIR = $(prefix)/share/taler-js/taler-util
NODE_DEPS = $(shell jq "(.dependencies|keys|map(\"node_modules/\" + .)|join(\" \"))" package.json -r)
.PHONY: install install-nodeps deps
install-nodeps:
	pnpm compile 
	@echo installing taler-util to $(DESTDIR)$(prefix)
	install -d $(DESTDIR)$(LIBDIR)/lib/globbing 
	install lib/*.* $(DESTDIR)$(LIBDIR)/lib
	install lib/globbing/*.* $(DESTDIR)$(LIBDIR)/lib/globbing
	install package.json $(DESTDIR)$(LIBDIR)
	tar hcf - $(NODE_DEPS) | (cd $(DESTDIR)$(LIBDIR); tar xf -)

deps:
	pnpm install --frozen-lockfile --filter @gnu-taler/taler-util...
	pnpm run --filter @gnu-taler/taler-util... compile
install:
	$(MAKE) deps
	$(MAKE) install-nodeps
endif