From: Lukas Jiriste Date: Fri, 26 Apr 2024 11:15:23 +0000 (+0200) Subject: Create the foundations for minishell X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=1798ab643b35520a31a87502b925d462faf5f53c;p=42%2Fminishell.git Create the foundations for minishell First commit contains .gitignore, Makefile and an empty main.c. I also added Libft as a submodule, because I'll certainly use it. --- 1798ab643b35520a31a87502b925d462faf5f53c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f4332b4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +minishell +*.[ao] +tags diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..626d139 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Libft"] + path = Libft + url = git://ljiriste.work/Libft diff --git a/Libft b/Libft new file mode 160000 index 0000000..580d3d9 --- /dev/null +++ b/Libft @@ -0,0 +1 @@ +Subproject commit 580d3d9325f4105b5448a5f0e5503e6d105c6117 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7204d11 --- /dev/null +++ b/Makefile @@ -0,0 +1,50 @@ +CC := gcc +CFLAGS = -std=c99 -Wall -Wextra -Werror -Wpedantic + +RM := rm -f + +SUBPROJECTS := Libft + +INCDIR := inc +INCDIR += $(addsuffix /inc, $(SUBPROJECTS)); +INCLUDE := $(addprefix -I, $(INCDIR)) + +SRCDIR := src + +SOURCES := main.c \ + +SOURCES := $(addprefix $(SRCDIR)/, $(SOURCES)) + +OBJECTS := $(SOURCES:.c=.o) + +NAME := minishell + +all : $(NAME) + +debug : CFLAGS += -g +debug : $(NAME) + +$(NAME) : $(OBJECTS) Libft/libft.a + $(CC) $(CFLAGS) -o $@ $^ + +Libft/libft.a : | Libft/Makefile +ifneq (,$(findstring debug, $(MAKECMDGOALS))) + $(MAKE) -C Libft debug +else + $(MAKE) -C Libft +endif + +%.o : %.c | Libft/Makefile + $(CC) $(CFLAGS) -o $@ -c $< $(INCLUDE) + +%/Makefile : + git submodule update --init $($@%/Makefile=%) + +clean : + $(RM) $(OBJECTS) + +fclean : clean + $(RM) $(NAME) + +re : fclean + $(MAKE) all diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..c4af877 --- /dev/null +++ b/src/main.c @@ -0,0 +1,16 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* main.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: ljiriste +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2024/04/26 13:11:47 by ljiriste #+# #+# */ +/* Updated: 2024/04/26 13:12:09 by ljiriste ### ########.fr */ +/* */ +/* ************************************************************************** */ + +int main(void) +{ + return (0); +}