Add boilerplate code.

This commit is contained in:
2025-03-17 10:53:26 +01:00
parent 8856ecba0b
commit fd03f5561f
5 changed files with 63 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
# Makefile for hello.c
CC = g++
CFLAGS = -O2
SRC_DIR = src
BUILD_DIR = build
BIN_DIR = bin
EXECUTABLE = Bowling
# Create directories
$(shell mkdir -p $(BUILD_DIR) $(BIN_DIR))
SOURCES = $(wildcard $(SRC_DIR)/*.cpp)
OBJECT_FILES = $(SOURCES:$(SRC_DIR)/%.cpp=$(BUILD_DIR)/%.o)
$(BIN_DIR)/$(EXECUTABLE): $(OBJECT_FILES)
$(CC) $(CFLAGS) -o $@ $^
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp
$(CC) $(CFLAGS) -c $< -o $@
run:
$(BIN_DIR)/$(EXECUTABLE)
clean:
rm -f $(BUILD_DIR)/*.o $(BIN_DIR)/*