Untitled
unknown
plain_text
10 months ago
660 B
3
Indexable
# Compiler and flags
COMPILER = gcc
FLAGS = -Wall -Wextra -std=c11
# Platform-specific delete command
REMOVE = rm -f
ifeq ($(OS),Windows_NT)
REMOVE = del
endif
# Output file and source files
OUTPUT = program
SOURCES = main.c speicherverwaltung.c
# Default target
build: $(OUTPUT)
# Compile and link the program
$(OUTPUT): $(SOURCES)
$(COMPILER) $(FLAGS) -o $(OUTPUT) $(SOURCES)
@echo "Compilation successful!"
# Run the program
run: $(OUTPUT)
./$(OUTPUT)
# Clean up generated files
cleanup:
@echo "Cleaning up..."
$(REMOVE) $(OUTPUT)
# Phony targets to avoid conflicts with file names
.PHONY: build run cleanup
Editor is loading...
Leave a Comment