# Copyright (C) 2022-2023 Luke Shumaker # # SPDX-License-Identifier: GPL-2.0-or-later SHELL = bash # main check: go test -race ./... .PHONY: check lint: tools/bin/golangci-lint tools/bin/golangci-lint run ./... .PHONY: lint # generate generate/files = LICENSE.gpl-2.0.txt generate: generate-clean $(MAKE) $(generate/files) .PHONY: generate generate-clean: rm -f $(generate/files) .PHONY: generate-clean LICENSE.gpl-2.0.txt: curl https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt > $@ # tools tools/bin/%: tools/src/%/pin.go tools/src/%/go.mod cd $( $@ || true stock: FORCE rm -rf $@ $@.tmp mkdir $@.tmp echo module ignore > $@.tmp/go.mod set -e; for file in "$$(go env GOROOT)"/src/encoding/json/{*_test.go,tags.go}; do \ cp "$$file" $@.tmp/borrowed_$${file##*/}; \ done rm -f $@.tmp/borrowed_fold_test.go mv $@.tmp $@ patched: FORCE rm -rf $@ $@.tmp mkdir $@.tmp echo module ignore > $@.tmp/go.mod cp $$(git ls-files :*/borrowed_*.go :borrowed_*.go :!borrowed_misc.go :!*/borrowed_misc.go) $@.tmp mv $@.tmp $@ .PHONY: FORCE