taler-merchant-demos

Python-based Frontends for the Demonstration Web site
Log | Files | Refs | README | LICENSE

Makefile (1573B)


      1 -include .config.mk
      2 
      3 prefix ?= /usr/local
      4 bindir ?= $(prefix)/bin
      5 builddir ?= build
      6 binary := $(builddir)/taler-merchant-demos
      7 version := $(shell sed -n '1s/^[^(]*(\([^)]*\)).*/\1/p' debian/changelog)
      8 
      9 .PHONY: all
     10 all: $(binary)
     11 
     12 $(binary): $(shell find cmd internal -type f) go.mod
     13 	mkdir -p $(builddir)
     14 	CGO_ENABLED=0 go build -trimpath \
     15 		-ldflags '-s -w -X main.version=$(version)' \
     16 		-o $(binary) ./cmd/taler-merchant-demos
     17 
     18 .PHONY: install
     19 install: $(binary)
     20 	install -Dm755 $(binary) $(DESTDIR)$(bindir)/taler-merchant-demos
     21 
     22 .PHONY: check
     23 check: check-i18n
     24 	go test ./...
     25 
     26 .PHONY: update-i18n
     27 update-i18n:
     28 	go run ./internal/tools/i18n -root .
     29 	@set -e; for po in internal/web/assets/translations/*/LC_MESSAGES/messages.po; do \
     30 		sed '/^#~/d' "$$po" > "$$po.clean"; \
     31 		mv "$$po.clean" "$$po"; \
     32 		msgmerge --quiet --update --backup=none "$$po" internal/web/assets/translations/messages.pot; \
     33 		msgattrib --no-obsolete --output-file="$$po.clean" "$$po"; \
     34 		mv "$$po.clean" "$$po"; \
     35 	done
     36 
     37 .PHONY: check-i18n
     38 check-i18n:
     39 	@set -e; temporary=$$(mktemp); \
     40 		trap 'rm -f "$$temporary"' EXIT; \
     41 		go run ./internal/tools/i18n -root . -output "$$temporary"; \
     42 		cmp "$$temporary" internal/web/assets/translations/messages.pot
     43 	@set -e; for po in internal/web/assets/translations/*/LC_MESSAGES/messages.po; do \
     44 		msgfmt --check --check-format -o /dev/null "$$po"; \
     45 	done
     46 
     47 .PHONY: pretty
     48 pretty:
     49 	gofmt -w cmd internal
     50 
     51 .PHONY: clean
     52 clean:
     53 	rm -rf -- $(builddir)
     54 
     55 .PHONY: dist
     56 dist:
     57 	git archive --format=tar.gz HEAD \
     58 		-o taler-merchant-demos-$(version).tar.gz