From a38868de0918da3979d2f7115f9164c979a48346 Mon Sep 17 00:00:00 2001 From: Matheus Date: Sun, 19 Oct 2025 03:10:42 -0300 Subject: Initial commit --- Makefile | 19 +++++++++++++++++++ main.c | 6 ++++++ snake.c | 1 + snake.h | 0 4 files changed, 26 insertions(+) create mode 100644 Makefile create mode 100644 main.c create mode 100644 snake.c create mode 100644 snake.h diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..027c0c6 --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +TARGET := snake + +SRC = $(wildcard *.c) +OBJ = $(patsubst %.c, %.o, $(SRC)) + +CC := gcc + +CFLAGS := -Wall -Wextra -Werror -pedantic -std=c99 -g +LDFLAGS := + +$(TARGET): $(OBJ) + $(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@ + +%.o:%.c + $(CC) -c $(CFLAGS) $< + +.PHONY: clean +clean: + rm -rv $(TARGET) $(OBJ) diff --git a/main.c b/main.c new file mode 100644 index 0000000..6cc468f --- /dev/null +++ b/main.c @@ -0,0 +1,6 @@ +#include + +int main() { + printf("Hello, world!\n"); + return 0; +} diff --git a/snake.c b/snake.c new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/snake.c @@ -0,0 +1 @@ + diff --git a/snake.h b/snake.h new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3