From 61814b468db91e24605ccd2b106f458d6a5ab90c Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 12 May 2020 16:28:26 -0700 Subject: [PATCH] Remove build-lib script, recommend make --- docs/section-2-using-parsers.md | 8 ++------ script/build-fuzzers | 2 +- script/build-lib | 22 ---------------------- 3 files changed, 3 insertions(+), 29 deletions(-) delete mode 100755 script/build-lib diff --git a/docs/section-2-using-parsers.md b/docs/section-2-using-parsers.md index 839cacf3..5b807b90 100644 --- a/docs/section-2-using-parsers.md +++ b/docs/section-2-using-parsers.md @@ -15,13 +15,9 @@ All of the API functions shown here are declared and documented in the [`tree_si ### Building the Library -To build the library on a POSIX system, run this script, which will create a static library called `libtree-sitter.a` in the Tree-sitter folder: +To build the library on a POSIX system, just run `make` in the Tree-sitter directory. This will create a static library called `libtree-sitter.a` as well as dynamic libraries. -```sh -script/build-lib -``` - -Alternatively, you can use the library in a larger project by adding one source file to the project. This source file needs two directories to be in the include path when compiled: +Alternatively, you can incorporate the library in a larger project's build system by adding one source file to the build. This source file needs two directories to be in the include path when compiled: **source file:** diff --git a/script/build-fuzzers b/script/build-fuzzers index c0675cd6..bff43c8b 100755 --- a/script/build-fuzzers +++ b/script/build-fuzzers @@ -21,7 +21,7 @@ CFLAGS=${CFLAGS:-"$default_fuzz_flags"} CXXFLAGS=${CXXFLAGS:-"$default_fuzz_flags"} export CFLAGS -script/build-lib +make if [ -z "$@" ]; then languages=$(ls test/fixtures/grammars) diff --git a/script/build-lib b/script/build-lib deleted file mode 100755 index 83fa69d8..00000000 --- a/script/build-lib +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -# If `CC` isn't set, pick a default compiler -if hash clang 2>/dev/null; then - : ${CC:=clang} -else - : ${CC:=gcc} -fi - -${CC} \ - -c \ - -O3 \ - -std=gnu99 \ - $CFLAGS \ - -I lib/src \ - -I lib/include \ - lib/src/lib.c \ - -o tree-sitter.o - -rm -f libtree-sitter.a -ar rcs libtree-sitter.a tree-sitter.o -rm tree-sitter.o