]> git.dkaiser.de - 42/cpp01.git/commitdiff
Setup ex05
authorDominik Kaiser <dkaiser@student.42heilbronn.de>
Wed, 12 Feb 2025 09:37:54 +0000 (10:37 +0100)
committerDominik Kaiser <dkaiser@student.42heilbronn.de>
Wed, 12 Feb 2025 09:37:54 +0000 (10:37 +0100)
ex05/Harl.cpp [new file with mode: 0644]
ex05/Harl.hpp [new file with mode: 0644]
ex05/Makefile [new file with mode: 0644]
ex05/main.cpp [new file with mode: 0644]

diff --git a/ex05/Harl.cpp b/ex05/Harl.cpp
new file mode 100644 (file)
index 0000000..91430f7
--- /dev/null
@@ -0,0 +1,13 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   Harl.cpp                                           :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: dkaiser <dkaiser@student.42heilbronn.de    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/02/12 10:37:12 by dkaiser           #+#    #+#             */
+/*   Updated: 2025/02/12 10:37:22 by dkaiser          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "Harl.hpp"
diff --git a/ex05/Harl.hpp b/ex05/Harl.hpp
new file mode 100644 (file)
index 0000000..a0b1f30
--- /dev/null
@@ -0,0 +1,16 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   Harl.hpp                                           :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: dkaiser <dkaiser@student.42heilbronn.de    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/02/12 10:36:43 by dkaiser           #+#    #+#             */
+/*   Updated: 2025/02/12 10:37:00 by dkaiser          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#ifndef HARL_H_
+#define HARL_H_
+
+#endif
diff --git a/ex05/Makefile b/ex05/Makefile
new file mode 100644 (file)
index 0000000..2696d22
--- /dev/null
@@ -0,0 +1,50 @@
+################################################################################
+################################## VARIABLES ###################################
+################################################################################
+
+NAME    := harl
+
+CC      =  c++
+CFLAGS  =  -Wall -Wextra -Werror -std=c++17
+HEADERS =  -I.
+
+SRC     := main.cpp Harl.cpp
+
+OBJ_DIR := _obj
+OBJ     := $(addprefix $(OBJ_DIR)/, $(SRC:%.cpp=%.o))
+
+################################################################################
+#################################### RULES #####################################
+################################################################################
+
+all: $(NAME)
+
+$(NAME): $(OBJ)
+       @$(CC) $(CFLAGS) $^ -o $@ $(HEADERS)
+       @echo "[$(NAME)] Created binary."
+
+$(OBJ_DIR)/%.o: %.cpp
+       @if [ ! -d "$(dir $@)" ]; then \
+               mkdir -p $(dir $@); \
+       fi
+       @$(CC) $(CFLAGS) -c $< -o $@ $(HEADERS)
+       @echo "[$(NAME)] Compiled $<."
+
+clean:
+       @if [ -d "$(OBJ_DIR)" ]; then \
+               rm -rf $(OBJ_DIR); \
+               echo "[$(NAME)] Removed object files."; \
+       fi
+
+fclean: clean
+       @if [ -f "$(NAME)" ]; then \
+               rm -f $(NAME); \
+               echo "[$(NAME)] Removed binary."; \
+       fi
+
+re:    fclean all
+
+.PHONY: all clean fclean re
+
+################################################################################
+################################################################################
diff --git a/ex05/main.cpp b/ex05/main.cpp
new file mode 100644 (file)
index 0000000..72a3752
--- /dev/null
@@ -0,0 +1,14 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   main.cpp                                           :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: dkaiser <dkaiser@student.42heilbronn.de    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/02/12 10:35:53 by dkaiser           #+#    #+#             */
+/*   Updated: 2025/02/12 10:36:35 by dkaiser          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+int main(void)
+{}