From f8853d022b29fbba3e52c96a8ea4919452ce0672 Mon Sep 17 00:00:00 2001 From: Bobby Lucero Date: Fri, 26 May 2023 21:14:13 -0400 Subject: [PATCH] More makefile changes --- Makefile | 7 +++++-- headers/Expression.h | 2 +- source/main.cpp | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index fe63122..6b956dd 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ CC = g++ # Compiler flags -CFLAGS = -Wall -Wextra -std=c++11 +CFLAGS = -Wall -Wextra -std=c++17 -Wno-unused-variable -Wno-unused-parameter # Source directory SRC_DIR = ./source @@ -22,7 +22,7 @@ OBJ_FILES := $(patsubst $(SRC_DIR)/%.cpp,$(BUILD_DIR)/%.o,$(CPP_FILES)) $(shell mkdir -p $(dir $(OBJ_FILES))) # Default target -all: $(BUILD_DIR)/bob +all: clean $(BUILD_DIR)/bob # Rule to create necessary directories $(DIRS): @@ -36,6 +36,9 @@ $(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp $(BUILD_DIR)/bob: $(OBJ_FILES) $(CC) $(CFLAGS) $^ -o $@ + + ./$(BUILD_DIR)/bob + # Clean build directory clean: rm -rf $(BUILD_DIR)/* diff --git a/headers/Expression.h b/headers/Expression.h index 9e00c8c..177f5e5 100644 --- a/headers/Expression.h +++ b/headers/Expression.h @@ -22,7 +22,7 @@ struct BinaryExpr : Expr const Token oper; const std::shared_ptr> right; - BinaryExpr(std::shared_ptr> left, Token oper, std::shared_ptr > right) : left(left), oper(oper), right(right) + BinaryExpr(std::shared_ptr> left, Token oper, std::shared_ptr> right) : left(left), oper(oper), right(right) { } T accept(Visitor* visitor) override{ diff --git a/source/main.cpp b/source/main.cpp index 6af5ec5..b162ac8 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -21,7 +21,7 @@ int main(){ Token{MINUS, "-", 1}, std::make_shared>("123", true) ), - Token{STAR, "*", 1}, + Token{MINUS, "-", 1}, std::make_shared>( std::make_shared>("45.67", true) )