Ajout d'un test intéressant d'un autre groupe

This commit is contained in:
2025-03-10 11:10:47 +01:00
parent 8ea9466dc4
commit 80bdd3c964
12 changed files with 114 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
# Makefile
# Define variables
SRC_DIR = .
BUILD_DIR = .
# Target to create directories
setup:
mkdir -p $(BUILD_DIR)
# Target to compile the C source files using a loop
compile: setup
for file in $(SRC_DIR)/*.c; do gcc -c $$file -o $(BUILD_DIR)/$(notdir $(basename $$file .c)).o; done
# Target to link the object files into an executable
link: compile
gcc -o $(BUILD_DIR)/test_program $(BUILD_DIR)/*.o
# Target to run the compiled program
run: link
$(BUILD_DIR)/test_program
# Clean target to remove created directories and files
clean:
rm -rf $(BUILD_DIR)