# Copyright 2021 The CC Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. .PHONY: build_all_targets clean cpu edit editor mem win64 win32 tmp build_all_targets: GOOS=darwin GOARCH=amd64 go build -v ./... GOOS=darwin GOARCH=arm64 go build -v ./... GOOS=freebsd GOARCH=386 go build -v ./... GOOS=freebsd GOARCH=amd64 go build -v ./... GOOS=linux GOARCH=386 go build -v ./... GOOS=linux GOARCH=amd64 go build -v ./... GOOS=linux GOARCH=arm go build -v ./... GOOS=linux GOARCH=arm64 go build -v ./... GOOS=linux GOARCH=ppc64le go build -v ./... GOOS=linux GOARCH=riscv64 go build -v ./... GOOS=linux GOARCH=s390x go build -v ./... GOOS=netbsd GOARCH=amd64 go build -v ./... GOOS=openbsd GOARCH=amd64 go build -v ./... GOOS=openbsd GOARCH=arm64 go build -v ./... GOOS=windows GOARCH=386 go build -v ./... GOOS=windows GOARCH=amd64 go build -v ./... GOOS=windows GOARCH=arm64 go build -v ./... clean: rm -f log-* cpu.test mem.test *.out go clean cpu: go test -c -o cpu.test ./mem.test -test.run TestParserBug -re 9.c -test.memprofile mem.out go tool pprof --lines cpu.test cpu.out edit: @touch log @if [ -f "Session.vim" ]; then gvim -S & else gvim -p Makefile *.go & fi editor: gofmt -l -s -w *.go go test -o /dev/null -c go build -o /dev/null fakecc.go go install 2>&1 | tee log-editor mem: go test -c -o mem.test ./mem.test -test.run TestTranslationPhase4 -re 20001226-1.c -test.memprofile mem.out go tool pprof --lines --web --alloc_space mem.test mem.out win32: # on linux/amd64 CC_TEST_CPP=i686-w64-mingw32-cpp-win32 GOARCH=386 go test 2>&1 | tee log win64: # on linux/amd64 CC_TEST_CPP=x86_64-w64-mingw32-cpp go test 2>&1 | tee log tmp: go test -v -run Translate 2>&1 | tee log grep -a '^ \+TODO' log | sort | uniq -c | sort -n grep -a 'TOTAL\|PASS' log || true