From 1479b3a76ebd03af5aefc9b7ac7a5bfcb8d9f6e3 Mon Sep 17 00:00:00 2001 From: Oliver Chang Date: Fri, 2 Sep 2016 09:57:31 -0700 Subject: [PATCH] [helper] generated build.sh fixes - fix permissions to allow execute - add examples to template --- scripts/helper.py | 4 +++- scripts/templates.py | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/scripts/helper.py b/scripts/helper.py index c95609095..cd28ccaee 100644 --- a/scripts/helper.py +++ b/scripts/helper.py @@ -224,9 +224,11 @@ def generate(generate_args): with open(os.path.join(args.library_name, 'Dockerfile'), 'w') as f: f.write(templates.DOCKER_TEMPLATE % args.library_name) - with open(os.path.join(args.library_name, 'build.sh'), 'w') as f: + build_sh_path = os.path.join(args.library_name, 'build.sh') + with open(build_sh_path, 'w') as f: f.write(templates.BUILD_TEMPLATE % args.library_name) + os.chmod(build_sh_path, 0755) return 0 diff --git a/scripts/templates.py b/scripts/templates.py index 13cd24e7b..445fa8c04 100644 --- a/scripts/templates.py +++ b/scripts/templates.py @@ -84,4 +84,16 @@ BUILD_TEMPLATE = """ cd /src/%s +# build the library. +# e.g. +# +# ./autogen.sh +# ./configure +# make clean all + +# build your fuzzer(s) +# e.g. +# $CXX $CXXFLAGS -std=c++11 -Iinclude \\ +# /path/to/name_of_fuzzer.cc -o /out/name_of_fuzzer \\ +# /work/libfuzzer/*.o /path/to/library.a $LDFLAGS """