summaryrefslogtreecommitdiffstats
path: root/vendor/paragonie/sodium_compat/dist/Makefile
blob: f30a25dd10a22d836783e454ff655ea5f60c47d2 (plain) (blame)
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
# This builds sodium-compat.phar. To run this Makefile, `box` and `composer`
# must be installed and in your $PATH. Run it from inside the dist/ directory.

box := $(shell which box)
composer := "composer"
gitcommit := $(shell git rev-parse HEAD)

.PHONY: all
all: build-phar

.PHONY: sign-phar
sign-phar:
	gpg -u 7F52D5C61D1255C731362E826B97A1C2826404DA --armor --output sodium-compat.phar.sig --detach-sig sodium-compat.phar

# ensure we run in clean tree. export git tree and run there.
.PHONY: build-phar
build-phar:
	@echo "Creating .phar from revision $(shell git rev-parse HEAD)."
	rm -rf worktree
	install -d worktree
	(cd $(CURDIR)/..; git archive HEAD) | tar -x -C worktree
	$(MAKE) -f $(CURDIR)/Makefile -C worktree sodium-compat.phar
	mv worktree/*.phar .
	rm -rf worktree

.PHONY: clean
clean:
	rm -vf sodium-compat.phar sodium-compat.phar.sig

# Inside workdir/:

sodium-compat.phar: dist/box.json composer.lock
	cp dist/box.json .
	php -d phar.readonly=0 $(box) build -c box.json -v

composer.lock:
	$(composer) config autoloader-suffix $(gitcommit)
	$(composer) install --no-dev