From f1dc8fe9f439fcda471dcdd119b200de118fd856 Mon Sep 17 00:00:00 2001 From: Guamss Date: Wed, 25 Mar 2026 09:42:49 +0100 Subject: [PATCH] initial commit --- .gitignore | 2 ++ Makefile | 27 +++++++++++++++++++++++++++ src/main.c | 8 ++++++++ 3 files changed, 37 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 src/main.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8eec1cb --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +obj/* +seyshell \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ef90273 --- /dev/null +++ b/Makefile @@ -0,0 +1,27 @@ +NAME := seyshell +CC := gcc +CFLAGS := -Wall -Wextra -Werror -g +OBJ_DIR := obj +SRC_DIR := src + +SOURCES := $(shell find $(SRC_DIR) -name "*.c") +OBJECTS := $(SOURCES:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o) + +all: $(NAME) + +$(NAME): $(OBJECTS) + @$(CC) $(CFLAGS) $(OBJECTS) -o $(NAME) + +$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c + @mkdir -p $(dir $@) + @$(CC) $(CFLAGS) -c $< -o $@ + +clean: + @rm -rf $(OBJ_DIR) + +fclean: clean + @rm -f $(NAME) + +re: fclean all + +.PHONY: all clean fclean re diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..8042ebd --- /dev/null +++ b/src/main.c @@ -0,0 +1,8 @@ +#include + +int main(int argc, char *argv[], char *envp[]) { + int index = 0; + while (envp[index]) { + printf("%s\n", envp[index++]); + } +} \ No newline at end of file