Makefile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. build-arm:
  33. export GOOS=linux && export GOARCH=arm && go build -x -v -o ./build/linux/amd/$(KYOKETSU)/$(KYOKETSU) ./cmd/$(KYOKETSU)/$(KYOKETSU).go
  34. format:
  35. go fmt ./...
  36. install:
  37. sudo rm -f /usr/local/bin/$(KYOKETSU) && \
  38. sudo mv ./build/linux/$(KYOKETSU)/$(KYOKETSU) /usr/local/bin && sudo chmod u+x /usr/local/bin/$(KYOKETSU) && \
  39. sudo mv ./build/linux/$(KYOKETSU_WEB)/$(KYOKETSU_WEB) \
  40. /usr/local/bin && sudo chmod u+x /usr/local/bin/$(KYOKETSU_WEB)
  41. test:
  42. go test -v ./...
  43. coverage:
  44. go test -v ./... -cover
  45. coverage-html:
  46. go test -v ./... -coverprofile=coverage.out
  47. go tool cover -html=coverage.out -o coverage.html