4
0

Makefile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. define delete-files
  2. python -c "import shutil;shutil.rmtree('$(1)', ignore_errors=True)"
  3. endef
  4. service:
  5. $(MAKE) -wC service
  6. service-prep:
  7. $(MAKE) -wC service prep
  8. service-unittests:
  9. $(MAKE) -wC service unittests
  10. it:
  11. $(MAKE) -wC integration-tests
  12. go-tools:
  13. $(MAKE) -wC service go-tools
  14. proto: grpc
  15. grpc: go-tools
  16. $(MAKE) -wC proto
  17. dist: protoc
  18. protoc:
  19. protoc --go_out=. --go-grpc_out=. --grpc-gateway_out=. -I .:/usr/include/ OliveTin.proto
  20. podman-image:
  21. buildah bud -t olivetin
  22. podman-container:
  23. podman kill olivetin || true
  24. podman rm olivetin || true
  25. podman create --name olivetin -p 1337:1337 -v /etc/OliveTin/:/config:ro olivetin
  26. podman start olivetin
  27. integration-tests-docker-image:
  28. docker rm -f olivetin && docker rmi -f olivetin
  29. docker build -t olivetin:latest .
  30. docker create --name olivetin -p 1337:1337 -v `pwd`/integration-tests/configs/:/config/ olivetin
  31. devrun: compile
  32. killall OliveTin || true
  33. ./OliveTin &
  34. devcontainer: compile podman-image podman-container
  35. webui-codestyle:
  36. $(MAKE) -wC webui.dev codestyle
  37. webui-dist:
  38. $(call delete-files,webui)
  39. $(call delete-files,webui.dev/dist)
  40. cd webui.dev && npm install
  41. cd webui.dev && npx parcel build --public-url "."
  42. python -c "import shutil;shutil.move('webui.dev/dist', 'webui')"
  43. python -c "import shutil;import glob;[shutil.copy(f, 'webui') for f in glob.glob('webui.dev/*.png')]"
  44. clean:
  45. $(call delete-files,dist)
  46. $(call delete-files,OliveTin)
  47. $(call delete-files,OliveTin.armhf)
  48. $(call delete-files,OliveTin.exe)
  49. $(call delete-files,reports)
  50. $(call delete-files,gen)
  51. .PHONY: grpc proto service