From 89031562c6ebd65268b1b4d0ba6d5fcaeedfa6f1 Mon Sep 17 00:00:00 2001 From: jason Date: Tue, 2 Sep 2025 23:57:03 +0000 Subject: [PATCH] check token file --- makefile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/makefile b/makefile index 4a28373..1ab1bea 100644 --- a/makefile +++ b/makefile @@ -15,9 +15,8 @@ ifeq ($(strip $(DPP_VERSION)),) # Check if DPP_VERSION is empty (no version foun # Define include directories for headers # -I tells the compiler where to look for #include or #include # We assume: - # - Your own headers (like ImageProcessor.h) are in 'include/' - # - STB headers are in 'include/stb/' - # - D++ headers are in 'include/dpp/' (so dpp.h is found via include/dpp/dpp.h) + # - STB headers are in the root project folder + # - D++ headers are in 'dpp/' (so dpp.h is found via include/dpp/dpp.h) INC_DIRS = -Iinclude -Idpp/ LIB_PATHS = $(DPP_PATH) else @@ -63,7 +62,7 @@ OBJECTS = $(OBJ_DIR)/discord-bot.o # 'all' is the default target that builds your executable all: $(OUTPUT_FILE) @echo "DPP_PATH: "$(DPP_PATH) - @echo "Build complete." + @echo "Build complete." # Rule to link the executable: # It depends on the object files and uses CXX to link them with specified libraries. @@ -72,7 +71,14 @@ $(OUTPUT_FILE): $(OBJECTS) @echo "LDFLAGS: $(LDFLAGS)" @mkdir -p $(@D) # Ensure the output binary directory exists (e.g., bin/Linux/release/) $(CXX) -o $@ $(OBJECTS) $(LDFLAGS) - cp token.txt $(@D) + @if test -f token.txt; then \ + echo "Copying token.txt to $(@D)"; \ + cp token.txt $(@D); \ + else \ + echo "Error: token.txt not found! Please create it in the project root. Copy the token when you create your discord bot and paste it in token.txt"; \ + exit 1; \ + fi + # Rule to compile the object file: # This takes your .cpp source file and compiles it into an object file (.o).