Makefile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. PLATFORMS := darwin/amd64 darwin/arm64 freebsd/amd64 linux/386 linux/amd64 linux/arm linux/arm64 linux/mipsle windows/386 windows/amd64 windows/arm windows/arm64
  2. temp = $(subst /, ,$@)
  3. os = $(word 1, $(temp))
  4. arch = $(word 2, $(temp))
  5. all: web.tar.gz $(PLATFORMS) arozos_file_checksum.sha1
  6. binary: $(PLATFORMS)
  7. hash: arozos_file_checksum.sha1
  8. web: web.tar.gz
  9. clean:
  10. rm -f arozos_*_*
  11. rm -f web.tar.gz
  12. $(PLATFORMS):
  13. @echo "Building $(os)/$(arch)"
  14. GOROOT_FINAL=Git/ GOOS=$(os) GOARCH=$(arch) go build -o './automake/arozos_$(os)_$(arch)' -ldflags "-s -w" -trimpath
  15. web.tar.gz:
  16. -mkdir ./automake/
  17. @echo "Removing old build resources, if exists"
  18. -rm -rf ./automake/web/
  19. -rm -rf ./automake/system/
  20. -rm -rf ./automake/subservice/
  21. @echo "Moving subfolders to build folder"
  22. -cp -r ./web ./automake/web/
  23. # cp -r ./subservice ./automake/subservice/
  24. -cp -r ./system ./automake/system/
  25. @ echo "Remove sensitive information"
  26. -rm ./automake/system/dev.uuid
  27. -rm ./automake/system/ao.db
  28. -rm ./automake/system/smtp_conf.json
  29. -rm ./automake/system/storage.json
  30. # -mv ./automake/system/storage.json ./automake/system/storage.json.example
  31. -rm -rf ./automake/system/aecron/
  32. -rm ./automake/system/cron.json
  33. -rm ./automake/system/bridge.json
  34. -rm ./automake/system/auth/authlog.db
  35. @ echo "Remove modules that should not go into the build folder"
  36. -rm -rf "./automake/web/Cyinput"
  37. -rm -rf "./automake/web/Label Maker"
  38. -rm -rf "./automake/web/Dummy"
  39. @echo "Creating tarball for all required files"
  40. -rm web.tar.gz
  41. -cd ./automake/ && tar -czf ../web.tar.gz system/ web/
  42. @echo "Clean up the autobuild directory"
  43. rm -rf ./automake/
  44. arozos_file_checksum.sha1:
  45. @echo "Generating the checksum, if sha1sum installed"
  46. -sha1sum arozos_*_* web.tar.gz > arozos_file_checksum.sha1