From 5b1cae44a496952789c2fe0a363893a67e350b7f Mon Sep 17 00:00:00 2001 From: s492459 Date: Tue, 7 Jan 2025 16:08:45 +0100 Subject: [PATCH] added makefile --- .gitignore | 1 + Makefile | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index cba7efc..0c009ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ a.out +main_logging.c \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6cb6678 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +# Compiler and flags +CC = gcc +CFLAGS = -g -Wall +TARGET = a.out +SRC = main.c + +# Default target: build the executable +all: $(TARGET) + +# Rule to compile and link the main.c file +$(TARGET): $(SRC) + $(CC) $(CFLAGS) $(SRC) -o $(TARGET) + +# Clean up build files (optional) +clean: + rm -f $(TARGET)