commit f1dc8fe9f439fcda471dcdd119b200de118fd856 Author: Guamss Date: Wed Mar 25 09:42:49 2026 +0100 initial commit 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