tinywebdis - a lean webdis replacement using turbo.lua
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. LUAROCKS= luarocks-5.1
  2. arch: ## Install system dependencies on arch linux
  3. @echo "Installing system requirements using pacman"
  4. @sudo pacman -Sy redis luajit luarocks5.1 base-devel
  5. @make install
  6. ubuntu: ## Install system dependencies on ubuntu
  7. @echo "Installing system requirements using apt-get"
  8. @sudo apt-get install redis-server redis-tools luajit luarocks gcc libssl-dev
  9. @make install LUAROCKS=luarocks
  10. install: ## Install turbowebdis dependencies locally
  11. @echo "Installing lsocket"
  12. @$(LUAROCKS) install lsocket --local
  13. @echo "Installing turbo"
  14. @PREFIX=$$HOME/.luarocks/ $(LUAROCKS) install turbo --local
  15. @echo "setup environment path"
  16. @$(LUAROCKS) path >> $$HOME/.bashrc
  17. @echo "copy resp"
  18. @cp resp/resp.lua ./
  19. start: ## Start turbowebdis
  20. @echo "Starting turbowebdis"
  21. @source $$HOME/.bashrc
  22. @echo $$(date) > turbo.log
  23. @./turbowebdis.lua >> turbo.log 2>&1 & echo "$$!" > /tmp/turbowebdis.pid
  24. stop: /tmp/turbowebdis.pid ## Stop turbowebdis
  25. @echo "Stopping turbowebdis"
  26. @kill `cat $<` && rm $<
  27. uninstall: ## Uninstall turbo dependencies
  28. @echo "removing lsocket"
  29. @$(LUAROCKS) remove lsocket --local
  30. @echo "removing turbo"
  31. @$(LUAROCKS) remove turbo --local
  32. tabularasa: ## Tabula rasa
  33. @echo "reset git repository"
  34. @git reset --hard
  35. @echo "remove local luarocks path"
  36. @rm -rf $$HOME/.luarocks/
  37. @echo "flush redis db"
  38. @echo "flushdb"| redis-cli
  39. .PHONY: help
  40. help:
  41. @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
  42. .DEFAULT_GOAL := help