Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # Copyright 2024 The libxrender-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/libxrender
  6. TAR = libXrender-0.9.10.tar.gz
  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 -vet=off -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 -vet=off -c -o /dev/null
  40. git status
  41. test:
  42. go test -vet=off -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 ../libX11
  50. go work use ../libc