From 96cd98560b9ed91d637473dc676aa82be6f3c9bc Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 30 Jun 2026 08:34:33 +0100 Subject: [PATCH] Include Makefile. --- parser-test/Makefile | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 parser-test/Makefile diff --git a/parser-test/Makefile b/parser-test/Makefile new file mode 100644 index 000000000..72953fa3e --- /dev/null +++ b/parser-test/Makefile @@ -0,0 +1,31 @@ +# Standalone build for the cmd-parse.y AST parser. +# +# Compiles only ../cmd-parse.y + ../tmux-parser.h against the local stub tmux.h +# and tiny helper stubs. The rest of tmux is not needed. + +YACC ?= bison -y +CC ?= cc + +CFLAGS += -D_GNU_SOURCE -I. -I.. -g -Wall + +OBJS = y.tab.o main.o xstubs.o + +parsetest: $(OBJS) + $(CC) $(CFLAGS) -o $@ $(OBJS) + +y.tab.c: ../cmd-parse.y + $(YACC) -d ../cmd-parse.y + +y.tab.o: y.tab.c + $(CC) $(CFLAGS) -c -o $@ y.tab.c + +main.o: main.c tmux.h + $(CC) $(CFLAGS) -c -o $@ main.c + +xstubs.o: xstubs.c tmux.h + $(CC) $(CFLAGS) -c -o $@ xstubs.c + +clean: + rm -f parsetest y.tab.c y.tab.h $(OBJS) + +.PHONY: clean