Made makefile and a basic ass main

This commit is contained in:
Theo Champion 2025-05-05 17:09:11 +02:00
parent 62da60082d
commit 2ce0fe98ff
3 changed files with 46 additions and 0 deletions

27
Makefile Normal file
View file

@ -0,0 +1,27 @@
CC=cc
CFLAGS=-Wall -Wextra -Werror -g -fsanitize=address -fno-omit-frame-pointer -I mlx
SOURCEFILES=src/main.c
OBJECTS=$(patsubst src/%.c,objects/%.o,$(SOURCEFILES))
OBJDIR=objects
NAME=cub3d
all: $(OBJECTS) $(NAME)
$(NAME): $(OBJECTS)
$(MAKE) -C mlx/
$(MAKE) -C libft/
cp libft/libft.a .
$(CC) $(CFLAGS) $(OBJECTS) -o $(NAME) -L. -lft -Lmlx -lmlx -lz -lXext -lX11
$(OBJDIR)/%.o: src/%.c
$(CC) $(CFLAGS) -Imlx -c $< -o $@
clean:
rm -f $(OBJECTS)
fclean: clean
rm -f $(NAME)
re: fclean all
.PHONY: all clean fclean re

0
objects/.gitkeep Normal file
View file

19
src/main.c Normal file
View file

@ -0,0 +1,19 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: freddy </var/spool/mail/freddy> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/05/05 16:59:32 by freddy #+# #+# */
/* Updated: 2025/05/05 17:07:02 by freddy ### ########.fr */
/* */
/* ************************************************************************** */
#include "../libft/includes/libft.h"
int main(int argc, char **argv)
{
if (argc < 2)
return (ft_printf("Error: Missing cub3d filename\n"), 1);
ft_printf("Salut de la part de %s\n", argv[0]);
}