mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 11:50:09 -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)
|
rmf = rm -rf $(1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(wildcard src/*.cc),)
|
ifneq ($(wildcard $(SRC_DIR)/*.cc),)
|
||||||
LDFLAGS += -lstdc++
|
LDFLAGS += -lstdc++
|
||||||
endif
|
endif
|
||||||
|
|
||||||
OBJECTS := parser.o scanner.o
|
OBJECTS := parser.o
|
||||||
|
|
||||||
|
ifneq ($(wildcard $(SRC_DIR)/scanner.*),)
|
||||||
|
OBJECTS += scanner.o
|
||||||
|
endif
|
||||||
|
|
||||||
all: $(TARGET)
|
all: $(TARGET)
|
||||||
|
|
||||||
$(TARGET): $(OBJECTS)
|
$(TARGET): $(OBJECTS)
|
||||||
$(CC) $(OBJECTS) -o $(TARGET) $(LDFLAGS)
|
$(CC) $(OBJECTS) -o $(TARGET) $(LDFLAGS)
|
||||||
|
|
||||||
%.o: src/%.c
|
%.o: $(SRC_DIR)/%.c
|
||||||
$(CC) -c $(CFLAGS) -I$(SRC_DIR) -o $@ $<
|
$(CC) -c $(CFLAGS) -I$(SRC_DIR) -o $@ $<
|
||||||
|
|
||||||
%.o: src/%.cc
|
%.o: $(SRC_DIR)/%.cc
|
||||||
$(CC) -c $(CXXFLAGS) -I$(SRC_DIR) -o $@ $<
|
$(CC) -c $(CXXFLAGS) -I$(SRC_DIR) -o $@ $<
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue