aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorkylo252 <59826753+kylo252@users.noreply.github.com>2022-01-29 14:24:15 +0100
committerStephan Seitz <stephan.seitz@fau.de>2022-02-04 20:35:26 +0100
commit8980197d6198fd8471301a90bf9760f2967b651d (patch)
tree9c399ffdd78a910af9cd008da38a643c82ef417c /scripts
parentUpdate lockfile.json (#2449) (diff)
downloadnvim-treesitter-8980197d6198fd8471301a90bf9760f2967b651d.tar
nvim-treesitter-8980197d6198fd8471301a90bf9760f2967b651d.tar.gz
nvim-treesitter-8980197d6198fd8471301a90bf9760f2967b651d.tar.bz2
nvim-treesitter-8980197d6198fd8471301a90bf9760f2967b651d.tar.lz
nvim-treesitter-8980197d6198fd8471301a90bf9760f2967b651d.tar.xz
nvim-treesitter-8980197d6198fd8471301a90bf9760f2967b651d.tar.zst
nvim-treesitter-8980197d6198fd8471301a90bf9760f2967b651d.zip
fix(makefile): scanner.c isn't always available
certain parsers like `tree-sitter-go` only contain parser.{c|cc}
Diffstat (limited to 'scripts')
-rw-r--r--scripts/compile_parsers.makefile12
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/compile_parsers.makefile b/scripts/compile_parsers.makefile
index a3d495885..8b5b31a29 100644
--- a/scripts/compile_parsers.makefile
+++ b/scripts/compile_parsers.makefile
@@ -22,21 +22,25 @@ else
rmf = rm -rf $(1)
endif
-ifneq ($(wildcard src/*.cc),)
+ifneq ($(wildcard $(SRC_DIR)/*.cc),)
LDFLAGS += -lstdc++
endif
-OBJECTS := parser.o scanner.o
+OBJECTS := parser.o
+
+ifneq ($(wildcard $(SRC_DIR)/scanner.*),)
+ OBJECTS += scanner.o
+endif
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) -o $(TARGET) $(LDFLAGS)
-%.o: src/%.c
+%.o: $(SRC_DIR)/%.c
$(CC) -c $(CFLAGS) -I$(SRC_DIR) -o $@ $<
-%.o: src/%.cc
+%.o: $(SRC_DIR)/%.cc
$(CC) -c $(CXXFLAGS) -I$(SRC_DIR) -o $@ $<
clean: