Makefile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # Copyright 2024 The libtk9_0-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 dwonload edit editor generate test work
  5. TAR = tk9.0.1-src.tar.gz
  6. URL = http://prdownloads.sourceforge.net/tcl/$(TAR)
  7. all: editor
  8. golint 2>&1
  9. staticcheck 2>&1
  10. build_all_targets:
  11. ./build_all_targets.sh
  12. echo done
  13. clean:
  14. rm -f log-* cpu.test mem.test *.out go.work*
  15. go clean
  16. clean-dev:
  17. rm -rf include/linux/amd64/
  18. rm -f ccgo_linux_amd64.go internal/tcltest/ccgo_linux_amd64.go
  19. download:
  20. @if [ ! -f $(TAR) ]; then wget $(URL) ; fi
  21. edit:
  22. @if [ -f "Session.vim" ]; then novim -S & else novim -p Makefile all_test.go go.mod builder.json generator.go libtk.go & fi
  23. editor:
  24. gofmt -l -s -w .
  25. GOOS=linux GOARCH=386 go test -c -o /dev/null
  26. GOOS=linux GOARCH=386 go build -v -o /dev/null ./...
  27. GOOS=linux GOARCH=386 go build -o /dev/null generator*.go
  28. generate: download
  29. go run generator*.go
  30. go build -v ./...
  31. git status
  32. dev: download
  33. GO_GENERATE_DEV=1 go run -tags=ccgo.dmesg,ccgo.assert generator*.go
  34. go build -v ./...
  35. git status
  36. windows: download
  37. GO_GENERATE_WIN=1 go run generator*.go
  38. GOOS=windows GOARCH=amd64 go build -v ./...
  39. GOOS=windows GOARCH=amd64 go test -v -c -o /dev/null
  40. #TODO GOOS=windows GOARCH=arm64 go build -v ./...
  41. #TODO GOOS=windows GOARCH=arm64 go test -v -c -o /dev/null
  42. git status
  43. windows-dev: download
  44. echo -n > /tmp/ccgo.log
  45. GO_GENERATE_WIN=1 GO_GENERATE_DEV=1 go run -tags=ccgo.dmesg,ccgo.assert generator*.go
  46. GOOS=windows GOARCH=amd64 go build -v ./...
  47. GOOS=windows GOARCH=amd64 go test -v -c -o /dev/null
  48. #TODO GOOS=windows GOARCH=arm64 go build -v ./...
  49. #TODO GOOS=windows GOARCH=arm64 go test -v -c -o /dev/null
  50. git status
  51. test:
  52. go test -vet=off -v -timeout 24h -count=1
  53. work:
  54. rm -f go.work*
  55. go work init
  56. go work use .
  57. go work use ../libc
  58. go work use ../libtcl9.0
  59. go work use ../libz