Makefile 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # This builds sodium-compat.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. gitcommit := $(shell git rev-parse HEAD)
  6. .PHONY: all
  7. all: build-phar
  8. .PHONY: sign-phar
  9. sign-phar:
  10. gpg -u 7F52D5C61D1255C731362E826B97A1C2826404DA --armor --output sodium-compat.phar.sig --detach-sig sodium-compat.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 sodium-compat.phar
  19. mv worktree/*.phar .
  20. rm -rf worktree
  21. .PHONY: clean
  22. clean:
  23. rm -vf sodium-compat.phar sodium-compat.phar.sig
  24. # Inside workdir/:
  25. sodium-compat.phar: dist/box.json composer.lock
  26. cp dist/box.json .
  27. php -d phar.readonly=0 $(box) build -c box.json -v
  28. composer.lock:
  29. $(composer) config autoloader-suffix $(gitcommit)
  30. $(composer) install --no-dev