summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ex03/HumanA.cpp12
-rw-r--r--ex03/HumanA.hpp16
-rw-r--r--ex03/HumanB.cpp12
-rw-r--r--ex03/HumanB.hpp16
-rw-r--r--ex03/Makefile50
-rw-r--r--ex03/Weapon.cpp12
-rw-r--r--ex03/Weapon.hpp16
-rw-r--r--ex03/main.cpp14
8 files changed, 148 insertions, 0 deletions
diff --git a/ex03/HumanA.cpp b/ex03/HumanA.cpp
new file mode 100644
index 0000000..38d2076
--- /dev/null
+++ b/ex03/HumanA.cpp
@@ -0,0 +1,12 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* HumanA.cpp :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2025/02/10 12:00:00 by dkaiser #+# #+# */
+/* Updated: 2025/02/10 12:00:02 by dkaiser ### ########.fr */
+/* */
+/* ************************************************************************** */
+
diff --git a/ex03/HumanA.hpp b/ex03/HumanA.hpp
new file mode 100644
index 0000000..0c8cde6
--- /dev/null
+++ b/ex03/HumanA.hpp
@@ -0,0 +1,16 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* HumanA.hpp :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2025/02/10 11:59:28 by dkaiser #+# #+# */
+/* Updated: 2025/02/10 11:59:50 by dkaiser ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#ifndef HUMANA_H_
+#define HUMANA_H_
+
+#endif
diff --git a/ex03/HumanB.cpp b/ex03/HumanB.cpp
new file mode 100644
index 0000000..4550c59
--- /dev/null
+++ b/ex03/HumanB.cpp
@@ -0,0 +1,12 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* HumanB.cpp :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2025/02/10 12:00:11 by dkaiser #+# #+# */
+/* Updated: 2025/02/10 12:01:05 by dkaiser ### ########.fr */
+/* */
+/* ************************************************************************** */
+
diff --git a/ex03/HumanB.hpp b/ex03/HumanB.hpp
new file mode 100644
index 0000000..d8ccdc8
--- /dev/null
+++ b/ex03/HumanB.hpp
@@ -0,0 +1,16 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* HumanB.hpp :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2025/02/10 12:00:55 by dkaiser #+# #+# */
+/* Updated: 2025/02/10 12:00:58 by dkaiser ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#ifndef HUMANB_H_
+#define HUMANB_H_
+
+#endif
diff --git a/ex03/Makefile b/ex03/Makefile
new file mode 100644
index 0000000..5359067
--- /dev/null
+++ b/ex03/Makefile
@@ -0,0 +1,50 @@
+################################################################################
+################################## VARIABLES ###################################
+################################################################################
+
+NAME := unnecessary_violence
+
+CC = c++
+CFLAGS = -Wall -Wextra -Werror -std=c++17
+HEADERS = -I.
+
+SRC := main.cpp Weapon.cpp HumanA.cpp HumanB.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/ex03/Weapon.cpp b/ex03/Weapon.cpp
new file mode 100644
index 0000000..42bb132
--- /dev/null
+++ b/ex03/Weapon.cpp
@@ -0,0 +1,12 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* Weapon.cpp :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2025/02/10 11:59:21 by dkaiser #+# #+# */
+/* Updated: 2025/02/10 11:59:21 by dkaiser ### ########.fr */
+/* */
+/* ************************************************************************** */
+
diff --git a/ex03/Weapon.hpp b/ex03/Weapon.hpp
new file mode 100644
index 0000000..ee8c299
--- /dev/null
+++ b/ex03/Weapon.hpp
@@ -0,0 +1,16 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* Weapon.hpp :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2025/02/10 11:58:44 by dkaiser #+# #+# */
+/* Updated: 2025/02/10 11:59:10 by dkaiser ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#ifndef WEAPON_H_
+#define WEAPON_H_
+
+#endif
diff --git a/ex03/main.cpp b/ex03/main.cpp
new file mode 100644
index 0000000..b2ae001
--- /dev/null
+++ b/ex03/main.cpp
@@ -0,0 +1,14 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* main.cpp :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2025/02/10 11:58:15 by dkaiser #+# #+# */
+/* Updated: 2025/02/10 11:58:24 by dkaiser ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+int main(void)
+{}