From bc84bde2774840d667449b254513a4ba3befb0c2 Mon Sep 17 00:00:00 2001 From: bronku Date: Sun, 12 Oct 2025 21:32:39 +0200 Subject: [PATCH] hello world --- .clang-format | 1 + .gitignore | 1 + main.c | 7 +++++++ makefile | 25 +++++++++++++++++++++++++ 4 files changed, 34 insertions(+) create mode 100644 .clang-format create mode 100644 .gitignore create mode 100644 main.c create mode 100644 makefile diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..11d0dcd --- /dev/null +++ b/.clang-format @@ -0,0 +1 @@ +BasedOnStyle: WebKit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..378eac2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build diff --git a/main.c b/main.c new file mode 100644 index 0000000..c3ce445 --- /dev/null +++ b/main.c @@ -0,0 +1,7 @@ +#include + +int main() +{ + printf("Hello World\n"); + return 0; +} diff --git a/makefile b/makefile new file mode 100644 index 0000000..1587d94 --- /dev/null +++ b/makefile @@ -0,0 +1,25 @@ +# Compiler +CC = clang +CFLAGS = -Wall -Wextra -g +TARGET = file_sorting +BUILD_DIR = build + +SRCS = main.c +OBJS = $(SRCS:%.c=$(BUILD_DIR)/%.o) + +$(BUILD_DIR)/$(TARGET): $(OBJS) + $(CC) $(CFLAGS) $(OBJS) -o $(BUILD_DIR)/$(TARGET) + +$(BUILD_DIR)/%.o: %.c | $(BUILD_DIR) + $(CC) $(CFLAGS) -c $< -o $@ + +$(BUILD_DIR): + mkdir -p $(BUILD_DIR) + +clean: + rm -rf build + +run: $(BUILD_DIR)/$(TARGET) + $(BUILD_DIR)/$(TARGET) + +.PHONY: clean run