Makefile 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 := $(shell which composer)
  5. gitcommit := $(shell git rev-parse HEAD)
  6. .PHONY: all
  7. all: build-phar
  8. .PHONY: sign-phar
  9. sign-phar:
  10. gpg -u DD2E507F7BDB1669 --armor --output defuse-crypto.phar.sig --detach-sig defuse-crypto.phar
  11. # ensure we run in clean tree. export git tree and run there.
  12. .PHONY: build-phar
  13. build-phar:
  14. @echo "Creating .phar from revision $(shell git rev-parse HEAD)."
  15. rm -rf worktree
  16. install -d worktree
  17. (cd $(CURDIR)/..; git archive HEAD) | tar -x -C worktree
  18. $(MAKE) -f $(CURDIR)/Makefile -C worktree defuse-crypto.phar
  19. mv worktree/*.phar .
  20. rm -rf worktree
  21. .PHONY: clean
  22. clean:
  23. rm -vf defuse-crypto.phar defuse-crypto.phar.sig
  24. # Inside workdir/:
  25. defuse-crypto.phar: dist/box.json composer.lock
  26. cp dist/box.json .
  27. php $(box) compile -c box.json -v
  28. composer.lock:
  29. $(composer) config autoloader-suffix $(gitcommit)
  30. $(composer) install --no-dev