Makefile 972 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # This builds defuse-crypto.phar. To run this Makefile, `box` and `composer`
  2. # must be installed and in your $PATH. Run it from inside the dist/ directory.
  3. box := $(shell which box)
  4. composer := "composer"
  5. .PHONY: all
  6. all: build-phar
  7. .PHONY: sign-phar
  8. sign-phar:
  9. gpg -u 7B4B2D98 --armor --output defuse-crypto.phar.sig --detach-sig defuse-crypto.phar
  10. # ensure we run in clean tree. export git tree and run there.
  11. .PHONY: build-phar
  12. build-phar:
  13. @echo "Creating .phar from revision $(shell git rev-parse HEAD)."
  14. rm -rf worktree
  15. install -d worktree
  16. (cd $(CURDIR)/..; git archive HEAD) | tar -x -C worktree
  17. $(MAKE) -f $(CURDIR)/Makefile -C worktree defuse-crypto.phar
  18. mv worktree/*.phar .
  19. rm -rf worktree
  20. .PHONY: clean
  21. clean:
  22. rm -vf defuse-crypto.phar defuse-crypto.phar.sig
  23. # Inside workdir/:
  24. defuse-crypto.phar: dist/box.json composer.lock
  25. cp dist/box.json .
  26. php -d phar.readonly=0 $(box) build -c box.json -v
  27. composer.lock:
  28. $(composer) install --no-dev