github.com/jdgcs/sqlite3@v1.12.1-0.20210908114423-bc5f96e4dd51/Makefile (about)

     1  # Copyright 2017 The Sqlite 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  
     5  .PHONY:	all clean cover cpu editor internalError later mem nuke todo edit tcl extraquick full
     6  
     7  grep=--include=*.go --include=*.l --include=*.y --include=*.yy
     8  ngrep='TODOOK\|internal\/vfs\|internal\/bin\|internal\/mptest\|.*stringer.*\.go'
     9  host=$(shell go env GOOS)-$(shell go env GOARCH)
    10  testlog=testdata/testlog-$(shell echo $$GOOS)-$(shell echo $$GOARCH)$(shell echo $$SQLITE_TEST_SUFFIX)
    11  
    12  all: editor
    13  	date
    14  	go version 2>&1 | tee log
    15  	./unconvert.sh
    16  	gofmt -l -s -w *.go
    17  	go test -i
    18  	go test -v 2>&1 -timeout 24h | tee -a log
    19  	go run speedtest1/main_$(shell go env GOOS)_$(shell go env GOARCH).go
    20  	GOOS=linux GOARCH=386 go build -v ./...
    21  	GOOS=linux GOARCH=386 go build -v ./...
    22  	GOOS=linux GOARCH=amd64 go build -v ./...
    23  	GOOS=linux GOARCH=amd64 go build -v ./...
    24  	GOOS=linux GOARCH=arm go build -v ./...
    25  	GOOS=linux GOARCH=arm64 go build -v ./...
    26  	GOOS=windows GOARCH=386 go build -v ./...
    27  	GOOS=windows GOARCH=amd64 go build -v ./...
    28  	golint 2>&1 | grep -v $(ngrep) || true
    29  	misspell *.go
    30  	staticcheck || true
    31  	maligned || true
    32  	git diff --unified=0 testdata *.golden
    33  	grep -n --color=always 'FAIL\|PASS' log
    34  	go version
    35  	date 2>&1 | tee -a log
    36  
    37  build_all_targets:
    38  	GOOS=darwin GOARCH=amd64 go build -v ./...
    39  	GOOS=darwin GOARCH=arm64 go build -v ./...
    40  	GOOS=freebsd GOARCH=amd64 go build -v ./...
    41  	GOOS=linux GOARCH=386 go build -v ./...
    42  	GOOS=linux GOARCH=amd64 go build -v ./...
    43  	GOOS=linux GOARCH=arm go build -v ./...
    44  	GOOS=linux GOARCH=arm64 go build -v ./...
    45  	#TODO GOOS=linux GOARCH=s390x go build -v ./...
    46  	GOOS=windows GOARCH=386 go build -v ./...
    47  	GOOS=windows GOARCH=amd64 go build -v ./...
    48  	echo done
    49  
    50  darwin_amd64:
    51  	TARGET_GOOS=darwin TARGET_GOARCH=amd64 go generate 2>&1 | tee /tmp/log-generate-sqlite-darwin-amd64
    52  	GOOS=darwin GOARCH=amd64 go build -v ./...
    53  
    54  darwin_arm64:
    55  	TARGET_GOOS=darwin TARGET_GOARCH=arm64 go generate 2>&1 | tee /tmp/log-generate-sqlite-darwin-arm64
    56  	GOOS=darwin GOARCH=arm64 go build -v ./...
    57  
    58  freebsd_amd64:
    59  	TARGET_GOOS=freebsd TARGET_GOARCH=amd64 go generate 2>&1 | tee /tmp/log-generate-sqlite-freebsd-amd64
    60  	GOOS=freebsd GOARCH=amd64 go build -v ./...
    61  
    62  linux_amd64:
    63  	TARGET_GOOS=linux TARGET_GOARCH=amd64 go generate 2>&1 | tee /tmp/log-generate-sqlite-linux-amd64
    64  	GOOS=linux GOARCH=amd64 go build -v ./...
    65  
    66  linux_386:
    67  	CCGO_CPP=i686-linux-gnu-cpp TARGET_GOARCH=386 TARGET_GOOS=linux go generate 2>&1 | tee /tmp/log-generate-sqlite-linux-386
    68  	GOOS=linux GOARCH=386 go build -v ./...
    69  
    70  linux_arm:
    71  	CCGO_CPP=arm-linux-gnueabi-cpp-8 TARGET_GOARCH=arm TARGET_GOOS=linux go generate 2>&1 | tee /tmp/log-generate-sqlite-linux-arm
    72  	GOOS=linux GOARCH=arm go build -v ./...
    73  
    74  linux_arm64:
    75  	CCGO_CPP=aarch64-linux-gnu-cpp-8 TARGET_GOARCH=arm64 TARGET_GOOS=linux go generate 2>&1 | tee /tmp/log-generate-sqlite-linux-arm64
    76  	GOOS=linux GOARCH=arm64 go build -v ./...
    77  
    78  linux_s390x:
    79  	CCGO_CPP=s390x-linux-gnu-cpp TARGET_GOARCH=s390x TARGET_GOOS=linux go generate 2>&1 | tee /tmp/log-generate-sqlite-linux-s390x
    80  	GOOS=linux GOARCH=s390x go build -v ./...
    81  
    82  windows_amd64:
    83  	CCGO_CPP=x86_64-w64-mingw32-cpp TARGET_GOOS=windows TARGET_GOARCH=amd64 go generate 2>&1 | tee /tmp/log-generate-sqlite-windows-amd64
    84  	GOOS=windows GOARCH=amd64 go build -v ./...
    85  
    86  windows_386:
    87  	CCGO_CPP=i686-w64-mingw32-cpp TARGET_GOOS=windows TARGET_GOARCH=386 go generate 2>&1 | tee /tmp/log-generate-sqlite-windows-386
    88  	GOOS=windows GOARCH=386 go build -v ./...
    89  
    90  all_targets: linux_amd64 linux_386 linux_arm linux_arm64 linux_s390x windows_amd64 windows_386
    91  	gofmt -l -s -w .
    92  	echo done
    93  
    94  test:
    95  	go version | tee $(testlog)
    96  	uname -a | tee -a $(testlog)
    97  	go test -v -timeout 24h | tee -a $(testlog)
    98  	grep -ni fail $(testlog) | tee -a $(testlog) || true
    99  	LC_ALL=C date | tee -a $(testlog)
   100  	grep -ni --color=always fail $(testlog) || true
   101  
   102  test_darwin_amd64:
   103  	GOOS=darwin GOARCH=amd64 make test
   104  
   105  test_darwin_arm64:
   106  	GOOS=darwin GOARCH=arm64 make test
   107  
   108  test_linux_amd64:
   109  	GOOS=linux GOARCH=amd64 make test
   110  
   111  test_linux_386:
   112  	GOOS=linux GOARCH=386 make test
   113  
   114  test_linux_386_hosted:
   115  	GOOS=linux GOARCH=386 SQLITE_TEST_SUFFIX=-hosted-$(host) make test
   116  
   117  test_linux_arm:
   118  	GOOS=linux GOARCH=arm make test
   119  
   120  test_linux_arm64:
   121  	GOOS=linux GOARCH=arm64 make test
   122  
   123  test_linux_s390x:
   124  	GOOS=linux GOARCH=s390x make test
   125  
   126  extraquick:
   127  	go test -timeout 24h -v -run Tcl -suite extraquick -maxerror 1 2>&1 | tee log-extraquick
   128  	date
   129  
   130  full:
   131  	go test -timeout 24h -v -run Tcl -suite full 2>&1 | tee log-full
   132  	date
   133  
   134  clean:
   135  	go clean
   136  	rm -f *~ *.test *.out test.db* tt4-test*.db* test_sv.* testdb-*
   137  
   138  cover:
   139  	t=$(shell tempfile) ; go test -coverprofile $$t && go tool cover -html $$t && unlink $$t
   140  
   141  cpu: clean
   142  	go test -run @ -bench . -cpuprofile cpu.out
   143  	go tool pprof -lines *.test cpu.out
   144  
   145  edit:
   146  	@touch log
   147  	@if [ -f "Session.vim" ]; then gvim -S & else gvim -p Makefile *.go & fi
   148  
   149  editor:
   150  	gofmt -l -s -w *.go
   151  	go install -v ./...
   152  
   153  internalError:
   154  	egrep -ho '"internal error.*"' *.go | sort | cat -n
   155  
   156  later:
   157  	@grep -n $(grep) LATER * || true
   158  	@grep -n $(grep) MAYBE * || true
   159  
   160  mem: clean
   161  	go test -run @ -bench . -memprofile mem.out -memprofilerate 1 -timeout 24h
   162  	go tool pprof -lines -web -alloc_space *.test mem.out
   163  
   164  memgrind:
   165  	go test -v -timeout 24h -tags libc.memgrind,cgobench -bench . -suite extraquick -xtags=libc.memgrind
   166  
   167  regression_base_release:
   168  	GO111MODULE=on go test -v -timeout 24h -tags=cgobench -run @ -bench '(Reading1|InsertComparative)/sqlite[^3]' -recs_per_sec_as_mbps 2>&1 | tee log-regression-base
   169  
   170  regression_base_master:
   171  	GO111MODULE=off go test -v -timeout 24h -tags=cgobench -run @ -bench '(Reading1|InsertComparative)/sqlite[^3]' -recs_per_sec_as_mbps 2>&1 | tee log-regression-base
   172  
   173  regression_check:
   174  	GO111MODULE=off go test -v -timeout 24h -tags=cgobench -run @ -bench '(Reading1|InsertComparative)/sqlite[^3]' -recs_per_sec_as_mbps 2>&1 | tee log-regression
   175  	benchcmp -changed -mag log-regression-base log-regression
   176  
   177  nuke: clean
   178  	go clean -i
   179  
   180  todo:
   181  	@grep -nr $(grep) ^[[:space:]]*_[[:space:]]*=[[:space:]][[:alpha:]][[:alnum:]]* * | grep -v $(ngrep) || true
   182  	@grep -nr $(grep) TODO * | grep -v $(ngrep) || true
   183  	@grep -nr $(grep) BUG * | grep -v $(ngrep) || true
   184  	@grep -nr $(grep) [^[:alpha:]]println * | grep -v $(ngrep) || true
   185  
   186  tcl:
   187  	cp log log-0
   188  	go test -run Tcl$$ 2>&1 -timeout 24h -trc | tee log
   189  	grep -c '\.\.\. \?Ok' log || true
   190  	grep -c '^!' log || true
   191  	# grep -c 'Error:' log || true
   192  
   193  tclshort:
   194  	cp log log-0
   195  	go test -run Tcl$$ -short 2>&1 -timeout 24h -trc | tee log
   196  	grep -c '\.\.\. \?Ok' log || true
   197  	grep -c '^!' log || true
   198  	# grep -c 'Error:' log || true