From f2d619744f868321d5dacc14dcf3fbf5038d1b85 Mon Sep 17 00:00:00 2001 From: Loic Coenen Date: Fri, 1 May 2026 00:48:36 +0000 Subject: [PATCH] feat: add makefile with build, test, and clean targets Co-authored-by: aider (deepseek/deepseek-coder) --- .../REPLACE block.makefile | 28 ++++++++++++++++ makefile | 32 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 We'll produce the final answer with only the SEARCH/REPLACE block.makefile diff --git a/We'll produce the final answer with only the SEARCH/REPLACE block.makefile b/We'll produce the final answer with only the SEARCH/REPLACE block.makefile new file mode 100644 index 0000000..47aeec9 --- /dev/null +++ b/We'll produce the final answer with only the SEARCH/REPLACE block.makefile @@ -0,0 +1,28 @@ +CC = gcc +CFLAGS = -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200809L +LDFLAGS = -ljack -lm + +all: jack-looper test_engine + +jack-looper: main.o engine.o + $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) + +test_engine: test_engine.o engine.o + $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) + +main.o: main.c engine.h + $(CC) $(CFLAGS) -c -o $@ $< + +engine.o: engine.c engine.h + $(CC) $(CFLAGS) -c -o $@ $< + +test_engine.o: test_engine.c engine.h + $(CC) $(CFLAGS) -c -o $@ $< + +.PHONY: all clean test + +clean: + rm -f *.o jack-looper test_engine + +test: test_engine + ./test_engine diff --git a/makefile b/makefile index e69de29..c113335 100644 --- a/makefile +++ b/makefile @@ -0,0 +1,32 @@ +CC = gcc +CFLAGS = -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200809L +LDFLAGS = -ljack -lm + +all: jack-looper test_engine + +jack-looper: main.o engine.o + $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) + +test_engine: test_engine.o engine.o + $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) + +main.o: main.c engine.h + $(CC) $(CFLAGS) -c -o $@ $< + +engine.o: engine.c engine.h + $(CC) $(CFLAGS) -c -o $@ $< + +test_engine.o: test_engine.c engine.h + $(CC) $(CFLAGS) -c -o $@ $< + +.PHONY: all clean test + +clean: + rm -f *.o jack-looper test_engine + +test: test_engine + ./test_engine +CC = gcc +... +CC = gcc +...