Remove build-lib script, recommend make

This commit is contained in:
Max Brunsfeld 2020-05-12 16:28:26 -07:00
parent 862b56dfe1
commit 61814b468d
3 changed files with 3 additions and 29 deletions

View file

@ -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:**

View file

@ -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)

View file

@ -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