More makefile changes
This commit is contained in:
parent
00cbc056c8
commit
f8853d022b
7
Makefile
7
Makefile
@ -4,7 +4,7 @@
|
|||||||
CC = g++
|
CC = g++
|
||||||
|
|
||||||
# Compiler flags
|
# Compiler flags
|
||||||
CFLAGS = -Wall -Wextra -std=c++11
|
CFLAGS = -Wall -Wextra -std=c++17 -Wno-unused-variable -Wno-unused-parameter
|
||||||
|
|
||||||
# Source directory
|
# Source directory
|
||||||
SRC_DIR = ./source
|
SRC_DIR = ./source
|
||||||
@ -22,7 +22,7 @@ OBJ_FILES := $(patsubst $(SRC_DIR)/%.cpp,$(BUILD_DIR)/%.o,$(CPP_FILES))
|
|||||||
$(shell mkdir -p $(dir $(OBJ_FILES)))
|
$(shell mkdir -p $(dir $(OBJ_FILES)))
|
||||||
|
|
||||||
# Default target
|
# Default target
|
||||||
all: $(BUILD_DIR)/bob
|
all: clean $(BUILD_DIR)/bob
|
||||||
|
|
||||||
# Rule to create necessary directories
|
# Rule to create necessary directories
|
||||||
$(DIRS):
|
$(DIRS):
|
||||||
@ -36,6 +36,9 @@ $(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp
|
|||||||
$(BUILD_DIR)/bob: $(OBJ_FILES)
|
$(BUILD_DIR)/bob: $(OBJ_FILES)
|
||||||
$(CC) $(CFLAGS) $^ -o $@
|
$(CC) $(CFLAGS) $^ -o $@
|
||||||
|
|
||||||
|
|
||||||
|
./$(BUILD_DIR)/bob
|
||||||
|
|
||||||
# Clean build directory
|
# Clean build directory
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(BUILD_DIR)/*
|
rm -rf $(BUILD_DIR)/*
|
||||||
|
|||||||
@ -21,7 +21,7 @@ int main(){
|
|||||||
Token{MINUS, "-", 1},
|
Token{MINUS, "-", 1},
|
||||||
std::make_shared<LiteralExpr<std::string>>("123", true)
|
std::make_shared<LiteralExpr<std::string>>("123", true)
|
||||||
),
|
),
|
||||||
Token{STAR, "*", 1},
|
Token{MINUS, "-", 1},
|
||||||
std::make_shared<GroupingExpr<std::string>>(
|
std::make_shared<GroupingExpr<std::string>>(
|
||||||
std::make_shared<LiteralExpr<std::string>>("45.67", true)
|
std::make_shared<LiteralExpr<std::string>>("45.67", true)
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user