mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
fix(makefile): scanner.c isn't always available
certain parsers like `tree-sitter-go` only contain parser.{c|cc}
This commit is contained in:
parent
4e6cb69114
commit
8980197d61
1 changed files with 8 additions and 4 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue