Create this repo, Makefile and test program
authorLukas Jiriste <ljiriste@student.42prague.com>
Fri, 27 Oct 2023 13:02:59 +0000 (15:02 +0200)
committerLukas Jiriste <ljiriste@student.42prague.com>
Fri, 27 Oct 2023 13:02:59 +0000 (15:02 +0200)
This program creates Hello world window.

.gitmodules [new file with mode: 0644]
Libft [new submodule]
Makefile [new file with mode: 0644]
main.c [new file with mode: 0644]
minilibx-linux [new submodule]

diff --git a/.gitmodules b/.gitmodules
new file mode 100644 (file)
index 0000000..8d4f73c
--- /dev/null
@@ -0,0 +1,6 @@
+[submodule "Libft"]
+       path = Libft
+       url = git://ljiriste.work/Libft
+[submodule "minilibx-linux"]
+       path = minilibx-linux
+       url = https://github.com/42Paris/minilibx-linux.git
diff --git a/Libft b/Libft
new file mode 160000 (submodule)
index 0000000..2c714dd
--- /dev/null
+++ b/Libft
@@ -0,0 +1 @@
+Subproject commit 2c714ddf0cc3786e9dbb28d955341dcf31537b49
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..e3038fc
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,28 @@
+
+
+CFLAGS := -Wall -Wextra -Werror #-g
+INCGRAPH := -Iminilibx-linux 
+LINKGRAPH := -Lminilibx-linux -lmlx_Linux -L/usr/lib -lXext -lX11 -lm -lz
+
+NAME := fractol
+MLXDIR := minilibx-linux/
+MLX := $(MLXDIR)libmlx_Linux.a
+LFTDIR := Libft/
+LFT := $(LFTDIR)libft.a
+
+SRCS := main.c
+OBJS := $(SRCS:%.c=%.o)
+
+all : $(NAME)
+
+$(NAME) : $(OBJS) $(LFT) $(MLX)
+       $(CC) $(CFLAGS) $(LINKGRAPH) $^ -o $@
+
+%.o : %.c
+       $(CC) $(CFLAGS) $(INCGRAPH) -c $< -o $@
+
+$(MLX) :
+       $(MAKE) -C $(MLXDIR)
+
+$(LFT) :
+       $(MAKE) -C $(LFTDIR)
diff --git a/main.c b/main.c
new file mode 100644 (file)
index 0000000..b38e40f
--- /dev/null
+++ b/main.c
@@ -0,0 +1,24 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   main.c                                             :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: ljiriste <marvin@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2023/10/27 14:29:26 by ljiriste          #+#    #+#             */
+/*   Updated: 2023/10/27 14:31:02 by ljiriste         ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include <mlx.h>
+
+int    main(void)
+{
+       void    *mlx;
+       void    *mlx_win;
+
+       mlx = mlx_init();
+       mlx_win = mlx_new_window(mlx, 1920, 1080, "Hello world!");
+       mlx_loop(mlx);
+       return (0);
+}
diff --git a/minilibx-linux b/minilibx-linux
new file mode 160000 (submodule)
index 0000000..7dc53a4
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 7dc53a411a7d4ae286c60c6229bd1e395b0efb82