Cleaned up the Makefile, added the framework for checking for runtime errrors in the Interpreter and fixed a bug where I didn't close out the 'va_list' in the Match function in the Parser.

This commit is contained in:
2022-03-17 18:58:23 +00:00
parent 34557c92c3
commit 1e6bbb87d4
3 changed files with 28 additions and 10 deletions
+7 -7
View File
@@ -1,10 +1,10 @@
CC = gcc
CFLAGS=-Wall -DDEBUG
SRC=src
OBJ=obj
SRCS=$(wildcard $(SRC)/*.c)
SRCDIR=src
OBJDIR=obj
SRCS=$(wildcard $(SRCDIR)/*.c)
# Substitute all .c with .o from SRCS
OBJS=$(patsubst $(SRC)/%.c, $(OBJ)/%.o, $(SRCS))
OBJS=$(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(SRCS))
BINDIR=bin
BIN=$(BINDIR)/clox
@@ -18,20 +18,20 @@ release: $(BIN)
$(BIN): $(OBJS) $(BINDIR)
$(CC) $(CFLAGS) $(OBJS) -o $@
$(OBJ)/%.o: $(SRC)/%.c $(OBJ)
$(OBJDIR)/%.o: $(SRCDIR)/%.c $(OBJDIR)
$(CC) $(CFLAGS) -c $< -o $@
$(BINDIR):
mkdir $@
$(OBJ):
$(OBJDIR):
mkdir $@
.PHONY: clean
.PHONY: test
clean:
rm -r $(BINDIR)/* $(OBJ)/*
rm -r $(BINDIR)/* $(OBJDIR)/*
test:
$(BIN) test.lox