From 4993799d01c6dfe511fb27ca215f075648fe274b Mon Sep 17 00:00:00 2001 From: Sander Hautvast Date: Fri, 11 Oct 2024 15:44:10 +0200 Subject: [PATCH] at least this works --- makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/makefile b/makefile index bd3137f..0a67166 100644 --- a/makefile +++ b/makefile @@ -5,11 +5,13 @@ CC := clang -c -std=c17 -Wall -Wextra -pedantic -Werror SRCS := $(shell find $(SRC) -name '*.c') OBJS := $(SRCS:%=$(TARGET)/%.o) -#$(TARGET)/lox: $(OBJS) -# clang $(TARGET)/lox.o -L$(TARGET) -ltokens.o -o $(TARGET)/lox +$(TARGET)/lox: $(TARGET)/lox.c.o $(TARGET)/tokens.c.o + clang $(TARGET)/lox.c.o -L$(TARGET) -ltokens.c.o -o $(TARGET)/lox +$(TARGET)/tokens.c.o: $(SRC)/tokens.c + $(CC) $< -o $@ -$(TARGET)/%.c.o: $(SRC)/%.c $(TARGET) +$(TARGET)/lox.c.o: $(SRC)/lox.c $(CC) $< -o $@ $(TARGET):