syzkaller/Makefile

81 lines
2.2 KiB
Makefile
Raw Normal View History

2015-10-12 15:15:57 +00:00
# Copyright 2015 syzkaller project authors. All rights reserved.
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
NOSTATIC ?= 0
ifeq ($(NOSTATIC), 0)
STATIC_FLAG=-static
endif
2016-12-12 11:19:09 +00:00
.PHONY: all format clean manager fuzzer executor execprog mutate prog2c stress extract generate repro
2015-10-12 15:15:57 +00:00
all:
$(MAKE) generate
go install ./syz-manager ./syz-fuzzer
$(MAKE) manager
$(MAKE) fuzzer
$(MAKE) execprog
$(MAKE) executor
2015-10-12 15:15:57 +00:00
all-tools: execprog mutate prog2c stress repro upgrade
executor:
$(CC) -o ./bin/syz-executor executor/executor.cc -pthread -Wall -O1 -g $(STATIC_FLAG) $(CFLAGS)
# 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"
manager:
go build $(GOFLAGS) -o ./bin/syz-manager github.com/google/syzkaller/syz-manager
2015-10-12 15:15:57 +00:00
fuzzer:
go build $(GOFLAGS) -o ./bin/syz-fuzzer github.com/google/syzkaller/syz-fuzzer
2015-10-12 15:15:57 +00:00
execprog:
go build $(GOFLAGS) -o ./bin/syz-execprog github.com/google/syzkaller/tools/syz-execprog
2015-12-23 18:19:45 +00:00
repro:
go build $(GOFLAGS) -o ./bin/syz-repro github.com/google/syzkaller/tools/syz-repro
2015-12-23 18:19:45 +00:00
mutate:
go build $(GOFLAGS) -o ./bin/syz-mutate github.com/google/syzkaller/tools/syz-mutate
prog2c:
go build $(GOFLAGS) -o ./bin/syz-prog2c github.com/google/syzkaller/tools/syz-prog2c
stress:
go build $(GOFLAGS) -o ./bin/syz-stress github.com/google/syzkaller/tools/syz-stress
upgrade:
go build $(GOFLAGS) -o ./bin/syz-upgrade github.com/google/syzkaller/tools/syz-upgrade
extract: bin/syz-extract
LINUX=$(LINUX) LINUXBLD=$(LINUXBLD) ./extract.sh
2017-01-23 16:24:05 +00:00
bin/syz-extract: syz-extract/*.go sysparser/*.go
go build $(GOFLAGS) -o $@ ./syz-extract
generate: bin/syz-sysgen
bin/syz-sysgen
bin/syz-sysgen: sysgen/*.go sysparser/*.go
go build $(GOFLAGS) -o $@ ./sysgen
2015-10-12 15:15:57 +00:00
format:
2015-11-10 19:32:03 +00:00
go fmt ./...
clang-format --style=file -i executor/*.cc executor/*.h tools/kcovtrace/*.c
presubmit:
$(MAKE) generate
go generate ./...
$(MAKE) format
$(MAKE) executor
ARCH=amd64 go install ./...
ARCH=arm64 go install ./...
ARCH=ppc64le go install ./...
go test -short ./...
echo LGTM
2015-10-12 15:15:57 +00:00
clean:
rm -rf ./bin/