initial commit

This commit is contained in:
Guamss 2026-03-25 09:42:49 +01:00
commit f1dc8fe9f4
3 changed files with 37 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
obj/*
seyshell

27
Makefile Normal file
View File

@ -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

8
src/main.c Normal file
View File

@ -0,0 +1,8 @@
#include <stdio.h>
int main(int argc, char *argv[], char *envp[]) {
int index = 0;
while (envp[index]) {
printf("%s\n", envp[index++]);
}
}