2017-07-27 14:59:09 +00:00
|
|
|
# Copyright 2017 syzkaller project authors. All rights reserved.
|
2015-10-12 15:15:57 +00:00
|
|
|
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
|
|
|
|
|
2017-09-19 09:00:40 +00:00
|
|
|
# There are 4 OS/arch pairs:
|
|
|
|
# - BUILDOS/BUILDARCH: the current machine's pair used for build.
|
|
|
|
# - HOSTOS/HOSTARCH: pair where syz-manager will run.
|
|
|
|
# - TARGETOS/TARGETVMARCH: pair of the target OS under test.
|
|
|
|
# - TARGETOS/TARGETARCH: pair of the target test process.
|
|
|
|
#
|
|
|
|
# The last 2 differ for e.g. amd64 OS and 386 test processes (compat syscall testing).
|
|
|
|
# All pairs default to the current machine. All but BUILD can be overriden.
|
|
|
|
#
|
|
|
|
# For example, to test linux/amd64 on linux/amd64, you just run:
|
|
|
|
# make
|
|
|
|
# To test linux/arm64 from darwin/amd64 host, run:
|
|
|
|
# make HOSTOS=darwin HOSTARCH=amd64 TARGETOS=linux TARGETARCH=arm64
|
|
|
|
# To test x86 compat syscalls, run:
|
|
|
|
# make TARGETVMARCH=amd64 TARGETARCH=386
|
|
|
|
#
|
2017-12-19 14:22:08 +00:00
|
|
|
# There is one special case for extracting constants for Android
|
|
|
|
# (you don't need this unless you update system call descriptions):
|
|
|
|
# make extract TARGETOS=android SOURCEDIR=/path/to/android/checkout
|
2017-09-19 09:00:40 +00:00
|
|
|
|
|
|
|
BUILDOS := $(shell go env GOOS)
|
|
|
|
BUILDARCH := $(shell go env GOARCH)
|
|
|
|
HOSTOS ?= $(BUILDOS)
|
|
|
|
HOSTARCH ?= $(BUILDARCH)
|
|
|
|
TARGETOS ?= $(HOSTOS)
|
|
|
|
TARGETARCH ?= $(HOSTARCH)
|
|
|
|
TARGETVMARCH ?= $(TARGETARCH)
|
2017-09-25 13:40:58 +00:00
|
|
|
GO := go
|
2017-09-27 09:48:07 +00:00
|
|
|
EXE :=
|
2017-09-19 09:00:40 +00:00
|
|
|
|
|
|
|
ifeq ("$(TARGETARCH)", "amd64")
|
|
|
|
CC = "x86_64-linux-gnu-gcc"
|
|
|
|
else ifeq ("$(TARGETARCH)", "386")
|
2018-04-29 18:20:50 +00:00
|
|
|
ifeq ("$(HOSTARCH)", "386")
|
|
|
|
CC = "i686-linux-gnu-gcc"
|
|
|
|
else
|
2017-09-19 09:00:40 +00:00
|
|
|
CC = "x86_64-linux-gnu-gcc"
|
2018-04-29 18:20:50 +00:00
|
|
|
endif
|
2017-09-19 09:00:40 +00:00
|
|
|
ADDCFLAGS = "-m32"
|
|
|
|
else ifeq ("$(TARGETARCH)", "arm64")
|
|
|
|
CC = "aarch64-linux-gnu-gcc"
|
|
|
|
else ifeq ("$(TARGETARCH)", "arm")
|
|
|
|
CC = "arm-linux-gnueabihf-gcc"
|
|
|
|
ADDCFLAGS = "-march=armv6t2"
|
|
|
|
else ifeq ("$(TARGETARCH)", "ppc64le")
|
|
|
|
CC = "powerpc64le-linux-gnu-gcc"
|
|
|
|
endif
|
|
|
|
|
2018-02-15 02:16:27 +00:00
|
|
|
# By default, build all Go binaries as static. We don't need cgo and it is
|
|
|
|
# known to cause problems at least on Android emulator.
|
|
|
|
export CGO_ENABLED=0
|
|
|
|
|
2017-09-25 13:40:58 +00:00
|
|
|
ifeq ("$(TARGETOS)", "fuchsia")
|
|
|
|
# SOURCEDIR should point to fuchsia checkout.
|
|
|
|
GO = $(SOURCEDIR)/buildtools/go
|
|
|
|
CC = $(SOURCEDIR)/buildtools/linux-x64/clang/bin/clang++
|
|
|
|
export CGO_ENABLED=1
|
|
|
|
NOSTATIC = 1
|
|
|
|
ifeq ("$(TARGETARCH)", "amd64")
|
2018-03-21 09:26:33 +00:00
|
|
|
ADDCFLAGS = --target=x86_64-fuchsia -lfdio -lzircon --sysroot $(SOURCEDIR)/out/build-zircon/build-x64/sysroot
|
|
|
|
export GOROOT=$(SOURCEDIR)/out/debug-x64/goroot
|
|
|
|
# Required by the goroot.
|
|
|
|
export ZIRCON_BUILD_DIR=$(SOURCEDIR)/out/build-zircon/build-x64
|
2017-09-25 13:40:58 +00:00
|
|
|
else ifeq ("$(TARGETARCH)", "arm64")
|
2018-03-21 09:26:33 +00:00
|
|
|
ADDCFLAGS = --target=aarch64-fuchsia -lfdio -lzircon --sysroot $(SOURCEDIR)/out/build-zircon/build-arm64/sysroot
|
|
|
|
export GOROOT=$(SOURCEDIR)/out/debug-arm64/goroot
|
|
|
|
# Required by the goroot.
|
|
|
|
export ZIRCON_BUILD_DIR=$(SOURCEDIR)/out/build-zircon/build-arm64
|
2017-09-25 13:40:58 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2017-10-14 18:08:11 +00:00
|
|
|
ifeq ("$(TARGETOS)", "akaros")
|
|
|
|
# SOURCEDIR should point to bootstrapped akaros checkout.
|
|
|
|
# There is no up-to-date Go for akaros, so building Go will fail.
|
|
|
|
CC = $(SOURCEDIR)/install/x86_64-ucb-akaros-gcc/bin/x86_64-ucb-akaros-g++
|
|
|
|
# Most likely this is incorrect (why doesn't it know own sysroot?), but worked for me.
|
|
|
|
ADDCFLAGS = -I $(SOURCEDIR)/tools/compilers/gcc-glibc/x86_64-ucb-akaros-gcc-stage3-builddir/x86_64-ucb-akaros/libstdc++-v3/include/x86_64-ucb-akaros -I $(SOURCEDIR)/tools/compilers/gcc-glibc/x86_64-ucb-akaros-gcc-stage3-builddir/x86_64-ucb-akaros/libstdc++-v3/include -I $(SOURCEDIR)/tools/compilers/gcc-glibc/gcc-4.9.2/libstdc++-v3/libsupc++ -L $(SOURCEDIR)/tools/compilers/gcc-glibc/x86_64-ucb-akaros-gcc-stage3-builddir/x86_64-ucb-akaros/libstdc++-v3/src/.libs
|
|
|
|
endif
|
|
|
|
|
2017-09-27 09:48:07 +00:00
|
|
|
ifeq ("$(TARGETOS)", "windows")
|
|
|
|
EXE = .exe
|
|
|
|
endif
|
|
|
|
|
2017-09-19 09:00:40 +00:00
|
|
|
GITREV=$(shell git rev-parse HEAD)
|
2017-12-20 20:21:19 +00:00
|
|
|
ifeq ("$(shell git diff --shortstat)", "")
|
2017-09-19 09:00:40 +00:00
|
|
|
REV=$(GITREV)
|
|
|
|
else
|
|
|
|
REV=$(GITREV)+
|
|
|
|
endif
|
|
|
|
|
2016-01-25 09:57:56 +00:00
|
|
|
NOSTATIC ?= 0
|
|
|
|
ifeq ($(NOSTATIC), 0)
|
2017-09-19 09:00:40 +00:00
|
|
|
ADDCFLAGS += -static
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Don't generate symbol table and DWARF debug info.
|
|
|
|
# Reduces build time and binary sizes considerably.
|
|
|
|
# That's only needed if you use gdb or nm.
|
|
|
|
# If you need that, build manually without these flags.
|
|
|
|
GOFLAGS := "-ldflags=-s -w -X github.com/google/syzkaller/sys.GitRevision=$(REV)"
|
|
|
|
ifneq ("$(GOTAGS)", "")
|
|
|
|
GOFLAGS += "-tags=$(GOTAGS)"
|
2016-01-25 09:57:56 +00:00
|
|
|
endif
|
|
|
|
|
2017-09-19 09:00:40 +00:00
|
|
|
.PHONY: all host target \
|
2017-07-27 14:59:09 +00:00
|
|
|
manager fuzzer executor \
|
|
|
|
ci hub \
|
2017-11-22 16:34:29 +00:00
|
|
|
execprog mutate prog2c stress repro upgrade db parse \
|
2017-08-18 09:14:20 +00:00
|
|
|
bin/syz-sysgen bin/syz-extract bin/syz-fmt \
|
2017-07-27 14:59:09 +00:00
|
|
|
extract generate \
|
2017-11-20 16:23:36 +00:00
|
|
|
format tidy test check_links check_diff arch presubmit clean
|
2015-10-12 15:15:57 +00:00
|
|
|
|
2017-09-19 09:00:40 +00:00
|
|
|
all: host target
|
2017-09-15 08:15:00 +00:00
|
|
|
|
2017-09-19 09:00:40 +00:00
|
|
|
host:
|
2017-09-25 13:40:58 +00:00
|
|
|
GOOS=$(HOSTOS) GOARCH=$(HOSTARCH) $(GO) install ./syz-manager
|
2017-11-22 16:34:29 +00:00
|
|
|
$(MAKE) manager repro mutate prog2c db parse upgrade
|
2017-07-27 14:59:09 +00:00
|
|
|
|
2017-09-19 09:00:40 +00:00
|
|
|
target:
|
2017-09-25 13:40:58 +00:00
|
|
|
GOOS=$(TARGETOS) GOARCH=$(TARGETVMARCH) $(GO) install ./syz-fuzzer
|
2017-09-20 14:51:20 +00:00
|
|
|
$(MAKE) fuzzer execprog stress executor
|
2015-10-12 15:15:57 +00:00
|
|
|
|
2017-05-31 18:24:45 +00:00
|
|
|
# executor uses stacks of limited size, so no jumbo frames.
|
2016-01-25 09:57:56 +00:00
|
|
|
executor:
|
2017-09-19 09:00:40 +00:00
|
|
|
mkdir -p ./bin/$(TARGETOS)_$(TARGETARCH)
|
2017-09-27 09:48:07 +00:00
|
|
|
$(CC) -o ./bin/$(TARGETOS)_$(TARGETARCH)/syz-executor$(EXE) executor/executor_$(TARGETOS).cc \
|
2018-02-10 11:14:13 +00:00
|
|
|
-pthread -Wall -Wframe-larger-than=8192 -Wparentheses -Werror -O2 \
|
2017-10-16 10:18:50 +00:00
|
|
|
$(ADDCFLAGS) $(CFLAGS) -DGOOS=\"$(TARGETOS)\" -DGIT_REVISION=\"$(REV)\"
|
2017-05-26 13:32:26 +00:00
|
|
|
|
2015-12-17 15:06:33 +00:00
|
|
|
manager:
|
2017-09-25 13:40:58 +00:00
|
|
|
GOOS=$(HOSTOS) GOARCH=$(HOSTARCH) $(GO) build $(GOFLAGS) -o ./bin/syz-manager github.com/google/syzkaller/syz-manager
|
2015-10-12 15:15:57 +00:00
|
|
|
|
2015-12-17 15:06:33 +00:00
|
|
|
fuzzer:
|
2017-09-27 09:48:07 +00:00
|
|
|
GOOS=$(TARGETOS) GOARCH=$(TARGETVMARCH) $(GO) build $(GOFLAGS) -o ./bin/$(TARGETOS)_$(TARGETVMARCH)/syz-fuzzer$(EXE) github.com/google/syzkaller/syz-fuzzer
|
2015-10-12 15:15:57 +00:00
|
|
|
|
2015-12-21 12:38:27 +00:00
|
|
|
execprog:
|
2017-09-27 09:48:07 +00:00
|
|
|
GOOS=$(TARGETOS) GOARCH=$(TARGETVMARCH) $(GO) build $(GOFLAGS) -o ./bin/$(TARGETOS)_$(TARGETVMARCH)/syz-execprog$(EXE) github.com/google/syzkaller/tools/syz-execprog
|
2015-12-21 12:38:27 +00:00
|
|
|
|
2017-06-19 15:23:03 +00:00
|
|
|
ci:
|
2017-09-25 13:40:58 +00:00
|
|
|
GOOS=$(HOSTOS) GOARCH=$(HOSTARCH) $(GO) build $(GOFLAGS) -o ./bin/syz-ci github.com/google/syzkaller/syz-ci
|
2017-06-19 15:23:03 +00:00
|
|
|
|
2017-06-29 14:01:03 +00:00
|
|
|
hub:
|
2017-09-25 13:40:58 +00:00
|
|
|
GOOS=$(HOSTOS) GOARCH=$(HOSTARCH) $(GO) build $(GOFLAGS) -o ./bin/syz-hub github.com/google/syzkaller/syz-hub
|
2017-06-29 14:01:03 +00:00
|
|
|
|
2015-12-23 18:19:45 +00:00
|
|
|
repro:
|
2017-09-25 13:40:58 +00:00
|
|
|
GOOS=$(HOSTOS) GOARCH=$(HOSTARCH) $(GO) build $(GOFLAGS) -o ./bin/syz-repro github.com/google/syzkaller/tools/syz-repro
|
2015-12-23 18:19:45 +00:00
|
|
|
|
2015-12-21 12:38:27 +00:00
|
|
|
mutate:
|
2017-09-25 13:40:58 +00:00
|
|
|
GOOS=$(HOSTOS) GOARCH=$(HOSTARCH) $(GO) build $(GOFLAGS) -o ./bin/syz-mutate github.com/google/syzkaller/tools/syz-mutate
|
2015-12-21 12:38:27 +00:00
|
|
|
|
|
|
|
prog2c:
|
2017-09-25 13:40:58 +00:00
|
|
|
GOOS=$(HOSTOS) GOARCH=$(HOSTARCH) $(GO) build $(GOFLAGS) -o ./bin/syz-prog2c github.com/google/syzkaller/tools/syz-prog2c
|
2015-12-21 12:38:27 +00:00
|
|
|
|
|
|
|
stress:
|
2017-09-27 09:48:07 +00:00
|
|
|
GOOS=$(TARGETOS) GOARCH=$(TARGETVMARCH) $(GO) build $(GOFLAGS) -o ./bin/$(TARGETOS)_$(TARGETVMARCH)/syz-stress$(EXE) github.com/google/syzkaller/tools/syz-stress
|
2015-12-21 12:38:27 +00:00
|
|
|
|
2017-06-13 17:39:39 +00:00
|
|
|
db:
|
2017-09-25 13:40:58 +00:00
|
|
|
GOOS=$(HOSTOS) GOARCH=$(HOSTARCH) $(GO) build $(GOFLAGS) -o ./bin/syz-db github.com/google/syzkaller/tools/syz-db
|
2017-06-13 17:39:39 +00:00
|
|
|
|
2017-11-22 16:34:29 +00:00
|
|
|
parse:
|
|
|
|
GOOS=$(HOSTOS) GOARCH=$(HOSTARCH) $(GO) build $(GOFLAGS) -o ./bin/syz-parse github.com/google/syzkaller/tools/syz-parse
|
|
|
|
|
2015-12-28 11:49:19 +00:00
|
|
|
upgrade:
|
2017-09-25 13:40:58 +00:00
|
|
|
GOOS=$(HOSTOS) GOARCH=$(HOSTARCH) $(GO) build $(GOFLAGS) -o ./bin/syz-upgrade github.com/google/syzkaller/tools/syz-upgrade
|
2015-12-28 11:49:19 +00:00
|
|
|
|
2016-08-26 05:09:25 +00:00
|
|
|
extract: bin/syz-extract
|
2017-12-19 14:22:08 +00:00
|
|
|
bin/syz-extract -build -os=$(TARGETOS) -sourcedir=$(SOURCEDIR)
|
2017-06-17 11:17:11 +00:00
|
|
|
bin/syz-extract:
|
2017-09-25 13:40:58 +00:00
|
|
|
$(GO) build $(GOFLAGS) -o $@ ./sys/syz-extract
|
2016-08-26 05:09:25 +00:00
|
|
|
|
|
|
|
generate: bin/syz-sysgen
|
|
|
|
bin/syz-sysgen
|
2017-09-25 13:40:58 +00:00
|
|
|
$(GO) generate ./pkg/csource ./executor ./pkg/ifuzz ./pkg/kernel
|
2017-06-13 17:39:21 +00:00
|
|
|
$(MAKE) format
|
2017-06-17 11:17:11 +00:00
|
|
|
bin/syz-sysgen:
|
2017-09-25 13:40:58 +00:00
|
|
|
$(GO) build $(GOFLAGS) -o $@ ./sys/syz-sysgen
|
2015-12-24 13:40:46 +00:00
|
|
|
|
2017-08-18 09:14:20 +00:00
|
|
|
format: bin/syz-fmt
|
2017-09-25 13:40:58 +00:00
|
|
|
$(GO) fmt ./...
|
2017-01-20 10:55:19 +00:00
|
|
|
clang-format --style=file -i executor/*.cc executor/*.h tools/kcovtrace/*.c
|
2017-12-13 12:49:08 +00:00
|
|
|
bin/syz-fmt sys/test
|
2017-10-17 09:02:27 +00:00
|
|
|
bin/syz-fmt sys/akaros
|
2017-10-02 12:14:48 +00:00
|
|
|
bin/syz-fmt sys/freebsd
|
2017-10-24 09:54:37 +00:00
|
|
|
bin/syz-fmt sys/netbsd
|
2017-09-19 09:00:40 +00:00
|
|
|
bin/syz-fmt sys/linux
|
2017-09-25 06:47:30 +00:00
|
|
|
bin/syz-fmt sys/fuchsia
|
2017-09-27 18:17:09 +00:00
|
|
|
bin/syz-fmt sys/windows
|
2017-08-18 09:14:20 +00:00
|
|
|
bin/syz-fmt:
|
2017-09-25 13:40:58 +00:00
|
|
|
$(GO) build $(GOFLAGS) -o $@ ./tools/syz-fmt
|
2016-08-28 12:59:48 +00:00
|
|
|
|
2017-06-13 15:21:33 +00:00
|
|
|
tidy:
|
2017-06-14 10:56:42 +00:00
|
|
|
# A single check is enabled for now. But it's always fixable and proved to be useful.
|
2017-06-13 15:21:33 +00:00
|
|
|
clang-tidy -quiet -header-filter=.* -checks=-*,misc-definitions-in-headers -warnings-as-errors=* executor/*.cc
|
2017-06-14 10:56:42 +00:00
|
|
|
# Just check for compiler warnings.
|
|
|
|
$(CC) executor/test_executor.cc -c -o /dev/null -Wparentheses -Wno-unused -Wall
|
2017-06-13 15:21:33 +00:00
|
|
|
|
2018-03-20 12:26:51 +00:00
|
|
|
gometalinter:
|
|
|
|
env CGO_ENABLED=1 gometalinter.v2 ./...
|
|
|
|
|
2017-07-27 14:59:09 +00:00
|
|
|
test:
|
2017-12-19 14:22:08 +00:00
|
|
|
# Executor tests use cgo.
|
|
|
|
env CGO_ENABLED=1 $(GO) test -short ./...
|
|
|
|
env CGO_ENABLED=1 $(GO) test -short -race -bench=.* ./...
|
2017-07-27 14:59:09 +00:00
|
|
|
|
|
|
|
arch:
|
2017-10-02 11:30:12 +00:00
|
|
|
env GOOG=darwin GOARCH=amd64 go install github.com/google/syzkaller/syz-manager
|
2017-09-19 09:00:40 +00:00
|
|
|
env HOSTOS=darwin HOSTARCH=amd64 $(MAKE) host
|
2017-10-02 11:30:12 +00:00
|
|
|
env GOOG=linux GOARCH=amd64 go install github.com/google/syzkaller/syz-manager
|
2017-09-19 09:00:40 +00:00
|
|
|
env HOSTOS=linux HOSTARCH=amd64 $(MAKE) host
|
2018-01-16 05:41:23 +00:00
|
|
|
env GOOG=freebsd GOARCH=amd64 go install github.com/google/syzkaller/syz-manager
|
|
|
|
env HOSTOS=freebsd HOSTARCH=amd64 $(MAKE) host
|
|
|
|
env GOOG=netbsd GOARCH=amd64 go install github.com/google/syzkaller/syz-manager
|
|
|
|
env HOSTOS=netbsd HOSTARCH=amd64 $(MAKE) host
|
2017-10-02 11:30:12 +00:00
|
|
|
env GOOG=linux GOARCH=amd64 go install github.com/google/syzkaller/syz-fuzzer
|
2017-09-19 09:00:40 +00:00
|
|
|
env TARGETOS=linux TARGETARCH=amd64 $(MAKE) target
|
2017-10-02 11:30:12 +00:00
|
|
|
env GOOG=linux GOARCH=arm64 go install github.com/google/syzkaller/syz-fuzzer
|
2017-09-19 09:00:40 +00:00
|
|
|
env TARGETOS=linux TARGETARCH=arm64 $(MAKE) target
|
2017-10-02 11:30:12 +00:00
|
|
|
env GOOG=linux GOARCH=ppc64le go install github.com/google/syzkaller/syz-fuzzer
|
2017-09-19 09:00:40 +00:00
|
|
|
env TARGETOS=linux TARGETARCH=ppc64le $(MAKE) target
|
|
|
|
# executor build on arm fails with:
|
|
|
|
# Error: alignment too large: 15 assumed
|
2017-10-02 11:30:12 +00:00
|
|
|
env GOOG=linux GOARCH=arm64 go install github.com/google/syzkaller/syz-fuzzer
|
2017-09-19 09:00:40 +00:00
|
|
|
env TARGETOS=linux TARGETARCH=arm64 TARGETVMARCH=arm $(MAKE) target
|
2017-09-21 08:25:59 +00:00
|
|
|
# executor build on 386 on travis fails with:
|
|
|
|
# fatal error: asm/errno.h: No such file or directory
|
|
|
|
# We install a bunch of additional packages in .travis.yml,
|
|
|
|
# but I can't guess the right one.
|
2017-10-02 11:30:12 +00:00
|
|
|
env GOOG=linux GOARCH=386 go install github.com/google/syzkaller/syz-fuzzer
|
2017-09-21 08:25:59 +00:00
|
|
|
env TARGETOS=linux TARGETARCH=amd64 TARGETVMARCH=386 $(MAKE) target
|
2018-01-16 05:41:23 +00:00
|
|
|
env GOOG=windows GOARCH=amd64 go install github.com/google/syzkaller/syz-fuzzer
|
2017-09-27 09:48:07 +00:00
|
|
|
env TARGETOS=windows TARGETARCH=amd64 $(MAKE) fuzzer execprog stress
|
2018-01-16 05:41:23 +00:00
|
|
|
env GOOG=freebsd GOARCH=amd64 go install github.com/google/syzkaller/syz-fuzzer
|
2017-10-23 08:19:56 +00:00
|
|
|
env TARGETOS=freebsd TARGETARCH=amd64 $(MAKE) target
|
2018-01-16 05:41:23 +00:00
|
|
|
env GOOG=netbsd GOARCH=amd64 go install github.com/google/syzkaller/syz-fuzzer
|
2017-10-23 08:19:56 +00:00
|
|
|
env TARGETOS=netbsd TARGETARCH=amd64 $(MAKE) target
|
2017-07-27 14:59:09 +00:00
|
|
|
|
|
|
|
presubmit:
|
2017-10-26 16:48:54 +00:00
|
|
|
$(MAKE) check_links
|
2017-07-27 14:59:09 +00:00
|
|
|
$(MAKE) generate
|
2017-11-20 16:23:36 +00:00
|
|
|
$(MAKE) check_diff
|
2018-03-20 12:26:51 +00:00
|
|
|
$(MAKE) all
|
2017-07-27 14:59:09 +00:00
|
|
|
$(MAKE) test
|
2018-03-20 12:26:51 +00:00
|
|
|
$(MAKE) gometalinter
|
|
|
|
$(MAKE) arch
|
2016-08-28 14:33:32 +00:00
|
|
|
echo LGTM
|
2015-10-12 15:15:57 +00:00
|
|
|
|
2017-07-27 14:59:09 +00:00
|
|
|
clean:
|
|
|
|
rm -rf ./bin/
|
2017-09-25 06:47:15 +00:00
|
|
|
|
2018-03-20 12:26:51 +00:00
|
|
|
# For a tupical Ubuntu/Debian distribution.
|
2017-09-25 06:47:15 +00:00
|
|
|
install_prerequisites:
|
2018-04-02 17:38:11 +00:00
|
|
|
sudo apt-get install -y -q libc6-dev-i386 linux-libc-dev \
|
|
|
|
gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf gcc-powerpc64le-linux-gnu
|
|
|
|
sudo apt-get install -y -q g++-aarch64-linux-gnu g++-powerpc64le-linux-gnu g++-arm-linux-gnueabihf
|
2018-03-20 12:26:51 +00:00
|
|
|
go get -u gopkg.in/alecthomas/gometalinter.v2
|
|
|
|
gometalinter.v2 --install
|
2017-10-26 16:48:54 +00:00
|
|
|
|
|
|
|
check_links:
|
|
|
|
python ./tools/check_links.py $$(pwd) $$(ls ./*.md; find ./docs/ -name '*.md')
|
2017-11-20 16:23:36 +00:00
|
|
|
|
|
|
|
# Check that the diff is empty. This is meant to be executed after generating
|
|
|
|
# and formatting the code to make sure that everything is committed.
|
|
|
|
check_diff:
|
|
|
|
DIFF="$(shell git diff --name-only)"; test -z "$$DIFF"
|