Makefile 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. # Copyright 2023 The libXau-go Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style
  3. # license that can be found in the LICENSE file.
  4. .PHONY: all clean dev download edit editor generate work test
  5. DIR = /tmp/libXau
  6. TAR = libXau-1.0.9.tar.gz # linux/amd64
  7. URL = https://www.x.org/releases/individual/lib/$(TAR)
  8. all: editor
  9. golint 2>&1
  10. staticcheck 2>&1
  11. build_all_targets:
  12. ./build_all_targets.sh
  13. echo done
  14. clean:
  15. rm -f log-* cpu.test mem.test *.out go.work*
  16. go clean
  17. edit:
  18. @touch log
  19. @if [ -f "Session.vim" ]; then novim -S & else novim -p Makefile go.mod builder.json generator.go & fi
  20. editor:
  21. gofmt -l -s -w . 2>&1 | tee log-editor
  22. go test -c -o /dev/null 2>&1 | tee -a log-editor
  23. go install -v ./... 2>&1 | tee -a log-editor
  24. go build -o /dev/null generator*.go
  25. download:
  26. @if [ ! -f $(TAR) ]; then wget $(URL) ; fi
  27. generate: download
  28. mkdir -p $(DIR) || true
  29. rm -rf $(DIR)/*
  30. echo -n > log-generate
  31. echo -n > log-generate-errors
  32. GO_GENERATE_DIR=$(DIR) go run generator*.go 2> log-generate-errors | tee log-generate
  33. cat log-generate-errors
  34. go build -v ./...
  35. go build -v ./... | tee -a log-generate
  36. go test -c -o /dev/null | tee -a log-generate
  37. git status
  38. grep 'PASS\|TRC\|TODO\|ERRORF\|FAIL' log-generate || true
  39. grep 'PASS\|TRC\|TODO\|ERRORF\|FAIL' log-generate-errors || true
  40. dev: download
  41. mkdir -p $(DIR) || true
  42. rm -rf $(DIR)/*
  43. echo -n > /tmp/ccgo.log
  44. echo -n > log-generate
  45. echo -n > log-generate-errors
  46. GO_GENERATE_DIR=$(DIR) GO_GENERATE_DEV=1 go run -tags=ccgo.dmesg,ccgo.assert generator*.go 2>&1 | tee log-generate
  47. go build -v ./... | tee -a log-generate
  48. go test -c -o /dev/null | tee -a log-generate
  49. git status
  50. grep 'PASS\|TRC\|TODO\|ERRORF\|FAIL' log-generate || true
  51. grep 'PASS\|TRC\|TODO\|ERRORF\|FAIL' log-generate-errors || true
  52. grep 'PASS\|TRC\|TODO\|ERRORF\|FAIL' /tmp/ccgo.log || true
  53. test:
  54. go test -v -timeout 24h -count=1 2>&1 | tee log-test
  55. grep -a 'TRC\|TODO\|ERRORF\|FAIL' log-test || true 2>&1 | tee -a log-test
  56. work:
  57. rm -f go.work*
  58. go work init
  59. go work use .
  60. go work use ../ccgo/v4
  61. go work use ../ccgo/v3
  62. go work use ../cc/v4
  63. go work use ../libc