Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. # Copyright 2024 The Libc 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 build_all_targets check clean download edit editor generate dev membrk-test test work xtest short-test xlibc libc-test surface
  5. SHELL=/bin/bash -o pipefail
  6. DIR = /tmp/libc
  7. TAR = musl-7ada6dde6f9dc6a2836c3d92c2f762d35fd229e0.tar.gz
  8. URL = https://git.musl-libc.org/cgit/musl/snapshot/$(TAR)
  9. all: editor
  10. golint 2>&1
  11. staticcheck 2>&1
  12. build_all_targets:
  13. ./build_all_targets.sh
  14. echo done
  15. clean:
  16. rm -f log-* cpu.test mem.test *.out
  17. git clean -fd
  18. find testdata/nsz.repo.hu/ -name \*.go -delete
  19. make -C testdata/nsz.repo.hu/libc-test/ cleanall
  20. go clean
  21. check:
  22. staticcheck 2>&1 | grep -v U1000
  23. download:
  24. @if [ ! -f $(TAR) ]; then wget $(URL) ; fi
  25. edit:
  26. @if [ -f "Session.vim" ]; then gvim -S & else gvim -p Makefile go.mod builder.json & fi
  27. editor:
  28. # gofmt -l -s -w *.go
  29. go test -c -o /dev/null
  30. go build -o /dev/null -v generator*.go
  31. go build -o /dev/null -v genasm.go
  32. generate: download
  33. mkdir -p $(DIR) || true
  34. rm -rf $(DIR)/*
  35. GO_GENERATE_DIR=$(DIR) go run generator*.go
  36. go build -v
  37. go test -v -short -count=1 ./...
  38. git status
  39. dev: download
  40. mkdir -p $(DIR) || true
  41. rm -rf $(DIR)/*
  42. echo -n > /tmp/ccgo.log
  43. GO_GENERATE_DIR=$(DIR) GO_GENERATE_DEV=1 go run -tags=ccgo.dmesg,ccgo.assert generator*.go
  44. go build -v
  45. go test -v -short -count=1 ./...
  46. git status
  47. membrk-test:
  48. echo -n > /tmp/ccgo.log
  49. touch log-test
  50. cp log-test log-test0
  51. go test -v -timeout 24h -count=1 -tags=libc.membrk 2>&1 | tee log-test
  52. grep -a 'TRC\|TODO\|ERRORF\|FAIL' log-test || true 2>&1 | tee -a log-test
  53. test:
  54. go test -v -timeout 24h -count=1
  55. short-test:
  56. echo -n > /tmp/ccgo.log
  57. touch log-test
  58. cp log-test log-test0
  59. go test -v -timeout 24h -count=1 -short 2>&1 | tee log-test
  60. grep -a 'TRC\|TODO\|ERRORF\|FAIL' log-test || true 2>&1 | tee -a log-test
  61. xlibc:
  62. echo -n > /tmp/ccgo.log
  63. touch log-test
  64. cp log-test log-test0
  65. go test -v -timeout 24h -count=1 -tags=ccgo.dmesg,ccgo.assert 2>&1 -run TestLibc | tee log-test
  66. grep -a 'TRC\|TODO\|ERRORF\|FAIL' log-test || true 2>&1 | tee -a log-test
  67. xpthread:
  68. echo -n > /tmp/ccgo.log
  69. touch log-test
  70. cp log-test log-test0
  71. go test -v -timeout 24h -count=1 2>&1 -run TestLibc -re pthread | tee log-test
  72. grep -a 'TRC\|TODO\|ERRORF\|FAIL' log-test || true 2>&1 | tee -a log-test
  73. libc-test:
  74. echo -n > /tmp/ccgo.log
  75. touch log-test
  76. cp log-test log-test0
  77. go test -v -timeout 24h -count=1 2>&1 -run TestLibc | tee log-test
  78. # grep -a 'TRC\|TODO\|ERRORF\|FAIL' log-test || true 2>&1 | tee -a log-test
  79. grep -o 'undefined: \<.*\>' log-test | sort -u
  80. xtest:
  81. echo -n > /tmp/ccgo.log
  82. touch log-test
  83. cp log-test log-test0
  84. go test -v -timeout 24h -count=1 -tags=ccgo.dmesg,ccgo.assert 2>&1 | tee log-test
  85. grep -a 'TRC\|TODO\|ERRORF\|FAIL' log-test || true 2>&1 | tee -a log-test
  86. work:
  87. rm -f go.work*
  88. go work init
  89. go work use .
  90. go work use ../ccgo/v4
  91. go work use ../ccgo/v3
  92. go work use ../cc/v4
  93. surface:
  94. surface > surface.new
  95. surface surface.old surface.new > log-todo-surface || true