Makefile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #
  2. # GNU GENERAL PUBLIC LICENSE
  3. # Version 3, 29 June 2007
  4. #
  5. #
  6. # kyoketsu, a Client-To-Client Network Enumeration System
  7. # Copyright (C) 2024 Russell Hrubesky, ChiralWorks Software LLC
  8. #
  9. # Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
  10. # Everyone is permitted to copy and distribute verbatim copies
  11. # of this license document, but changing it is not allowed.
  12. #
  13. # This program is free software: you can redistribute it and/or modify
  14. # it under the terms of the GNU General Public License as published by
  15. # the Free Software Foundation, either version 3 of the License,
  16. # or (at your option) any later version.
  17. #
  18. # This program is distributed in the hope that it will be useful,
  19. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  21. # See the GNU General Public License for more details.
  22. #
  23. # You should have received a copy of the GNU General Public License
  24. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  25. #
  26. .PHONY: build format test install coverage coverage-html
  27. KYOKETSU = kyoketsu
  28. KYOKETSU_WEB = kyoketsu-web
  29. build:
  30. go build -x -v -o ./build/linux/$(KYOKETSU)/$(KYOKETSU) ./cmd/$(KYOKETSU)/$(KYOKETSU).go && \
  31. go build -x -v -o ./build/linux/$(KYOKETSU_WEB)/$(KYOKETSU_WEB) ./cmd/$(KYOKETSU_WEB)/$(KYOKETSU_WEB).go
  32. format:
  33. go fmt ./...
  34. install:
  35. sudo rm -f /usr/local/bin/$(KYOKETSU) && \
  36. sudo mv ./build/linux/$(KYOKETSU)/$(KYOKETSU) /usr/local/bin && sudo chmod u+x /usr/local/bin/$(KYOKETSU) && \
  37. sudo mv ./build/linux/$(KYOKETSU_WEB)/$(KYOKETSU_WEB) \
  38. /usr/local/bin && sudo chmod u+x /usr/local/bin/$(KYOKETSU_WEB)
  39. test:
  40. go test -v ./...
  41. coverage:
  42. go test -v ./... -cover
  43. coverage-html:
  44. go test -v ./... -coverprofile=coverage.out
  45. go tool cover -html=coverage.out -o coverage.html