Files
SAE32_2024/tests/tests-autres-groupes/lenny-khalid-thomas/test-10-NomDeFichier/make/Makefile

23 lines
560 B
Makefile
Raw Normal View History

2025-03-16 14:09:18 +01:00
# Bakefile
# Define variables
SRC_DIR = .
BUILD_DIR = .
OUTPUT_DIR = .
# Target to create directories
setup:
mkdir -p "$(OUTPUT_DIR)"
# Target to compile the source files
compile: setup
gcc -c "$(SRC_DIR)/main program.c" -o "$(BUILD_DIR)/main program.o"
gcc -c "$(SRC_DIR)/utils!.c" -o "$(BUILD_DIR)/utils!.o"
# Target to link the object files into an executable
link: compile
gcc -o "$(OUTPUT_DIR)/test_program" "$(BUILD_DIR)/main program.o" "$(BUILD_DIR)/utils!.o"
# Clean target to remove created directories and files
clean:
rm -rf "$(BUILD_DIR)"