Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # Copyright 2024 The libxcb-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/libxcb
  6. TAR = libxcb-1.15.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. @if [ -f "Session.vim" ]; then novim -S & else novim -p Makefile go.mod builder.json generator.go & fi
  19. editor:
  20. gofmt -l -s -w .
  21. go test -c -o /dev/null
  22. go install -v ./...
  23. go build -o /dev/null generator*.go
  24. download:
  25. @if [ ! -f $(TAR) ]; then wget $(URL) ; fi
  26. generate: download
  27. mkdir -p $(DIR) || true
  28. rm -rf $(DIR)/*
  29. GO_GENERATE_DIR=$(DIR) go run generator*.go
  30. go build -v ./...
  31. go test -c -o /dev/null
  32. git status
  33. dev: download
  34. mkdir -p $(DIR) || true
  35. rm -rf $(DIR)/*
  36. echo -n > /tmp/ccgo.log
  37. GOMAXPROCS=1 GO_GENERATE_DIR=$(DIR) GO_GENERATE_DEV=1 go run -tags=ccgo.dmesg,ccgo.assert generator*.go
  38. go build -v ./...
  39. go test -c -o /dev/null
  40. git status
  41. test:
  42. go test -v -timeout 24h -count=1
  43. work:
  44. rm -f go.work*
  45. go work init
  46. go work use .
  47. go work use ../cc/v4
  48. go work use ../ccgo/v4
  49. go work use ../libXau
  50. go work use ../libXdmcp
  51. go work use ../libc