Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

basically a full rewrite #29

Merged
merged 27 commits into from
Sep 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
fennel.so: grammar.js gen
cc -o fennel.so -I./src src/parser.c src/scanner.c --shared -Os -lstdc++ -fPIC
SRC = src/parser.c
OBJ = $(SRC:.c=.o)

.PHONY: gen
gen:
INCS = -Isrc/
TSCFLAGS = $(CPPFLAGS) $(CFLAGS) -fPIC
TSLDFLAGS = $(LDFLAGS) --shared

fennel.so: $(OBJ)
$(CC) $(TSLDFLAGS) -o $@ $(OBJ)

.c.o:
$(CC) -c $(TSCFLAGS) -o $@ $<

src/parser.c: grammar.js
npx tree-sitter generate

.PHONY: test
test: gen
generate: src/parser.c

test: generate
npx tree-sitter test

clean:
rm -f fennel.so $(OBJ)

.PHONY: generate test clean
4 changes: 2 additions & 2 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"src"
],
"sources": [
"src/parser.c",
"bindings/node/binding.cc",
"src/scanner.c"
"src/parser.c",
# If your language uses an external scanner, add it here.
],
"cflags_c": [
"-std=c99",
Expand Down
Loading