diff options
| author | hachem <im@hachem.wtf> | 2026-09-19 11:17:14 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-09-19 11:17:14 +0200 |
| commit | 768bbdd137f5b205e4282bd79572681aef4514e3 (patch) | |
| tree | c249765cd8607a34443e05709ea54441bf0dfd3e /Makefile | |
| parent | 08b8cbbccd8c8d7dab75746ee9d134f67455de91 (diff) | |
feat: add bison grammar for emit, decltype and difference
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -1,8 +1,9 @@ CC = cc LEX = flex -CFLAGS = -std=c17 -Wall -Wextra -Werror -Wpedantic -O2 +YACC = bison +CFLAGS = -std=c17 -Wall -Wextra -Werror -Wpedantic -O2 -Ibin SOURCES = ast.c ast.h lexer.h main.c -OBJECTS = bin/lexer.o bin/ast.o bin/main.o +OBJECTS = bin/lexer.o bin/parser.o bin/ast.o bin/main.o SANITIZE = -g -O0 -fsanitize=address,undefined .PHONY: all debug check format lint clean @@ -18,13 +19,19 @@ sfinae: $(OBJECTS) bin/lexer.c: sfinae.l | bin $(LEX) -o bin/lexer.c sfinae.l -bin/lexer.o: bin/lexer.c lexer.h +bin/lexer.o: bin/lexer.c bin/parser.h ast.h lexer.h $(CC) -std=c17 -w -I. -c -o $@ bin/lexer.c +bin/parser.c bin/parser.h: sfinae.y | bin + $(YACC) -d -o bin/parser.c sfinae.y + +bin/parser.o: bin/parser.c + $(CC) -std=c17 -w -I. -c -o $@ bin/parser.c + bin/%.o: %.c | bin $(CC) $(CFLAGS) -c -o $@ $< -bin/main.o: lexer.h +bin/main.o: ast.h lexer.h bin/ast.o: ast.h lexer.h debug: CFLAGS += $(SANITIZE) @@ -40,7 +47,7 @@ format: clang-format -i $(SOURCES) lint: - clang-tidy ast.c main.c -- -std=c17 + clang-tidy ast.c main.c -- -std=c17 -Ibin clean: rm -rf bin sfinae |
