diff options
| author | Stephan Seitz <stephan.seitz@fau.de> | 2022-02-06 00:53:27 +0100 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2022-02-08 23:37:59 +0100 |
| commit | 65998878998807ec4c9ecc5af1ae573d69596667 (patch) | |
| tree | 86cfb1fc5fb8392085b56376a2fd270bb2db1678 /scripts | |
| parent | fix: -Os should be used during compilation phase in makefile (diff) | |
| download | nvim-treesitter-65998878998807ec4c9ecc5af1ae573d69596667.tar nvim-treesitter-65998878998807ec4c9ecc5af1ae573d69596667.tar.gz nvim-treesitter-65998878998807ec4c9ecc5af1ae573d69596667.tar.bz2 nvim-treesitter-65998878998807ec4c9ecc5af1ae573d69596667.tar.lz nvim-treesitter-65998878998807ec4c9ecc5af1ae573d69596667.tar.xz nvim-treesitter-65998878998807ec4c9ecc5af1ae573d69596667.tar.zst nvim-treesitter-65998878998807ec4c9ecc5af1ae573d69596667.zip | |
fix: revert to basic makefile where all variables are set by Lua
Fixes #2463
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/compile_parsers.makefile | 61 |
1 files changed, 9 insertions, 52 deletions
diff --git a/scripts/compile_parsers.makefile b/scripts/compile_parsers.makefile index 5c3848a45..4e689841e 100644 --- a/scripts/compile_parsers.makefile +++ b/scripts/compile_parsers.makefile @@ -1,56 +1,13 @@ -# -# compile_parsers.makefile -# +CC?=cc +CXX_STANDARD?=c++14 -CXX_STANDARD ?= c++14 -CFLAGS ?= -Os -std=c99 -fPIC -CXXFLAGS ?= -Os -std=$(CXX_STANDARD) -fPIC -LDFLAGS ?= -shared -SRC_DIR ?= ./src -DEST_DIR ?= ./dest +all: parser.so -ifeq ($(OS),Windows_NT) - SHELL := powershell.exe - .SHELLFLAGS := -NoProfile -command - CP := Copy-Item -Recurse -ErrorAction SilentlyContinue - MKDIR := New-Item -ItemType directory -ErrorAction SilentlyContinue - TARGET := parser.dll - rmf = Write-Output $(1) | foreach { if (Test-Path $$_) { Remove-Item -Force } } -else - CP := cp - MKDIR := mkdir -p - TARGET := parser.so - rmf = rm -rf $(1) -endif +parser.o: src/parser.c + $(CC) -c src/parser.c -std=c99 -Os -fPIC -I./src -ifneq ($(wildcard $(SRC_DIR)/*.cc),) - LDFLAGS += -lstdc++ -endif +scanner.o: src/scanner.cc + $(CC) -c src/scanner.cc -std=$(CXX_STANDARD) -Os -fPIC -I./src -OBJECTS := parser.o - -ifneq ($(wildcard $(SRC_DIR)/scanner.*),) - OBJECTS += scanner.o -endif - -all: $(TARGET) - -$(TARGET): $(OBJECTS) - $(CC) $(OBJECTS) -o $(TARGET) $(LDFLAGS) - -%.o: $(SRC_DIR)/%.c - $(CC) -c $(CFLAGS) -I$(SRC_DIR) -o $@ $< - -%.o: $(SRC_DIR)/%.cc - $(CC) -c $(CXXFLAGS) -I$(SRC_DIR) -o $@ $< - -clean: - $(call rmf,$(TARGET) $(OBJECTS)) - -$(DEST_DIR): - @$(MKDIR) $(DEST_DIR) - -install: $(TARGET) $(DEST_DIR) - $(CP) $(TARGET) $(DEST_DIR)/ - -.PHONY: clean +parser.so: parser.o scanner.o + $(CC) parser.o scanner.o -o parser.so -shared -lstdc++ |
