diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/Bakefile b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/Bakefile new file mode 100644 index 0000000..fd1ff29 --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/Bakefile @@ -0,0 +1,25 @@ +# Bakefile + +# 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) diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/main.c b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/main.c new file mode 100644 index 0000000..16f45cd --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/main.c @@ -0,0 +1,10 @@ +#include <stdio.h> +#include "utils1.h" +#include "utils2.h" + +int main() { + printf("Main program started!\n"); + print_hello_from_utils1(); + print_hello_from_utils2(); + return 0; +} diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils1.c b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils1.c new file mode 100644 index 0000000..58bc03d --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils1.c @@ -0,0 +1,5 @@ +#include <stdio.h> + +void print_hello_from_utils1() { + printf("Hello from Utils1!\n"); +} diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils1.h b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils1.h new file mode 100644 index 0000000..ecdcfbc --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils1.h @@ -0,0 +1,6 @@ +#ifndef UTILS1_H +#define UTILS1_H + +void print_hello_from_utils1(); + +#endif diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils2.c b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils2.c new file mode 100644 index 0000000..42e9f62 --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils2.c @@ -0,0 +1,5 @@ +#include <stdio.h> + +void print_hello_from_utils2() { + printf("Hello from Utils2!\n"); +} diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils2.h b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils2.h new file mode 100644 index 0000000..7da73aa --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/bake/utils2.h @@ -0,0 +1,6 @@ +#ifndef UTILS2_H +#define UTILS2_H + +void print_hello_from_utils2(); + +#endif diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/Makefile b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/Makefile new file mode 100644 index 0000000..907589c --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/Makefile @@ -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) diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/main.c b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/main.c new file mode 100644 index 0000000..16f45cd --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/main.c @@ -0,0 +1,10 @@ +#include <stdio.h> +#include "utils1.h" +#include "utils2.h" + +int main() { + printf("Main program started!\n"); + print_hello_from_utils1(); + print_hello_from_utils2(); + return 0; +} diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils1.c b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils1.c new file mode 100644 index 0000000..58bc03d --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils1.c @@ -0,0 +1,5 @@ +#include <stdio.h> + +void print_hello_from_utils1() { + printf("Hello from Utils1!\n"); +} diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils1.h b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils1.h new file mode 100644 index 0000000..ecdcfbc --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils1.h @@ -0,0 +1,6 @@ +#ifndef UTILS1_H +#define UTILS1_H + +void print_hello_from_utils1(); + +#endif diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils2.c b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils2.c new file mode 100644 index 0000000..42e9f62 --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils2.c @@ -0,0 +1,5 @@ +#include <stdio.h> + +void print_hello_from_utils2() { + printf("Hello from Utils2!\n"); +} diff --git a/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils2.h b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils2.h new file mode 100644 index 0000000..7da73aa --- /dev/null +++ b/tests/test-groupe-lenny-thomas-khalid/test-12-GestionDesBouclesFor/make/utils2.h @@ -0,0 +1,6 @@ +#ifndef UTILS2_H +#define UTILS2_H + +void print_hello_from_utils2(); + +#endif