- Add function declarations, calls, and return statements - Implement lexical scoping with Environment class and closures - Convert print from statement to standard library function - Add assert() function to standard library for testing - Add time() function for microsecond precision benchmarking - Create StdLib class and BuiltinFunction wrapper for standard library - Implement first-class functions and higher-order functions - Add function parameter support (tested up to 100 parameters) - Support alphanumeric identifiers in variable and function names - Add underscore support in variable names and identifiers - Implement string + number and number + string concatenation - Add boolean + string and string + boolean concatenation - Support string multiplication (string * number) - Fix decimal truncation issue by using std::stod for all number parsing - Add comprehensive number formatting with proper precision handling - Support huge numbers (epoch timestamps) without integer overflow - Clean number display (no trailing zeros on integers) - Add basic error handling with program termination on errors - Add comprehensive test suite covering all features - Add escape sequence support (\n, \t, \", \\) - Add comprehensive documentation and language reference - Update development roadmap with completed features
49 lines
1.0 KiB
Makefile
49 lines
1.0 KiB
Makefile
# Makefile
|
|
|
|
# Compiler
|
|
CC = g++
|
|
|
|
# Compiler flags
|
|
CFLAGS = -Wall -Wextra -std=c++17 -Wno-unused-variable -Wno-unused-parameter -Wno-switch
|
|
|
|
# Source directory
|
|
SRC_DIR = ./source
|
|
|
|
# Output directory
|
|
BUILD_DIR = ./build
|
|
|
|
# Find all C++ files recursively in the source directory
|
|
CPP_FILES := $(shell find $(SRC_DIR) -type f -name '*.cpp')
|
|
|
|
# Generate object file names by replacing the source directory with the build directory
|
|
OBJ_FILES := $(patsubst $(SRC_DIR)/%.cpp,$(BUILD_DIR)/%.o,$(CPP_FILES))
|
|
|
|
# Create directories for object files
|
|
$(shell mkdir -p $(dir $(OBJ_FILES)))
|
|
|
|
# Default target
|
|
all: build
|
|
|
|
# Rule to create necessary directories
|
|
$(DIRS):
|
|
mkdir -p $(patsubst $(SRC_DIR)/%, $(OUTPUT_DIR)/%, $@)
|
|
|
|
# Rule to compile object files
|
|
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
# Rule to link object files into the final executable
|
|
$(BUILD_DIR)/bob: $(OBJ_FILES)
|
|
$(CC) $(CFLAGS) $^ -o $@
|
|
|
|
|
|
run:
|
|
./$(BUILD_DIR)/bob
|
|
|
|
build: clean $(BUILD_DIR)/bob
|
|
|
|
|
|
# Clean build directory
|
|
clean:
|
|
rm -rf $(BUILD_DIR)/*
|