2016-10-12 17:35:32 +00:00
|
|
|
#!/bin/bash -eu
|
|
|
|
# Copyright 2016 Google Inc.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
# Build the library. Actually there is no 'library' target, so we use .o files.
|
|
|
|
# '-no-canonical-prefixes' flag makes clang crazy. Need to avoid it.
|
|
|
|
cat brotli/shared.mk | sed -e "s/-no-canonical-prefixes//" \
|
|
|
|
> brotli/shared.mk.temp
|
|
|
|
mv brotli/shared.mk.temp brotli/shared.mk
|
|
|
|
|
2016-10-18 22:37:23 +00:00
|
|
|
# woff2 uses LFLAGS instead of LDFLAGS.
|
2016-12-07 14:47:37 +00:00
|
|
|
make clean
|
2017-03-06 18:46:52 +00:00
|
|
|
make -j$(nproc) CC="$CC $CFLAGS" CXX="$CXX $CXXFLAGS" CANONICAL_PREFIXES= all \
|
|
|
|
NOISY_LOGGING=
|
2016-10-12 17:35:32 +00:00
|
|
|
|
2017-01-04 01:01:47 +00:00
|
|
|
# Build fuzzers
|
|
|
|
for fuzzer_archive in $(ls src/*fuzzer*.a); do
|
2017-03-06 20:37:58 +00:00
|
|
|
fuzzer_name=$(basename ${fuzzer_archive%.a})
|
2017-02-25 17:08:56 +00:00
|
|
|
$CXX $CXXFLAGS -lFuzzingEngine $fuzzer_archive \
|
2017-03-06 20:37:58 +00:00
|
|
|
-o $OUT/$fuzzer_name
|
|
|
|
zip -q $OUT/${fuzzer_name}_seed_corpus.zip $SRC/corpus/*
|
2017-01-04 01:01:47 +00:00
|
|
|
done
|
2016-10-12 23:25:06 +00:00
|
|
|
|
2016-11-18 19:16:38 +00:00
|
|
|
cp $SRC/*.options $OUT/
|