Makefile 919 B

12345678910111213141516171819202122232425262728
  1. .PHONY: erase build build-continue install checkargs help
  2. erase: checkargs ## Overwrite the whole DEVICE with zeros.
  3. sudo dd if=/dev/zero of=$(DEVICE) iflag=nocache oflag=direct bs=4M status=progress
  4. build: ## Build the image
  5. sudo systemctl start docker
  6. ./fix-loopback.sh
  7. ./build-docker.sh
  8. build-continue: ## Continue building the image (if previous build failed)
  9. ./fix-loopback.sh
  10. CONTINUE=1 $(MAKE) build
  11. install: checkargs ## Install built image
  12. unzip -p deploy/image_2018-01-02-VideoPi-standard.zip | sudo dd of=$(DEVICE) bs=4 status=progress conv=fsync
  13. sudo sync
  14. checkargs:
  15. ifeq (,$(DEVICE))
  16. @echo "You must set the DEVICE variable."
  17. @echo "Example: make backup DEVICE=/dev/sdX"
  18. @exit 1
  19. endif
  20. help: # https://gist.github.com/jhermsmeier/2d831eb8ad2fb0803091
  21. @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-14s\033[0m %s\n", $$1, $$2}'