feat(ex02): it works

This commit is contained in:
Khaïs COLIN 2025-05-19 15:44:16 +02:00
parent 6254cbc7bd
commit 5cd051a7f7
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
9 changed files with 254 additions and 0 deletions

41
ex02/Makefile Normal file
View file

@ -0,0 +1,41 @@
NAME = ex02
ifeq ($(CPPFLAGS),)
CPPFLAGS = -Wall -Wextra -Werror -std=c++98 -g
endif
ifeq ($(CXX),)
CXX = c++
endif
# g++ is the default on 42 computers
ifeq ($(CXX),g++)
CXX = c++
endif
srcs = \
ClapTrap.cpp \
ScavTrap.cpp \
FragTrap.cpp \
main_objs = main.o $(srcs:.cpp=.o)
all_objs = $(main_objs)
deps = $(all_objs:.o=.d)
all: $(NAME)
-include $(deps)
$(NAME): $(main_objs)
$(CXX) $(CPPFLAGS) -o $@ $^
%.o: %.cpp
$(CXX) -c $(CPPFLAGS) -o $*.o $*.cpp
$(CXX) -MM $(CPPFLAGS) -MT $*.o $*.cpp > $*.d
clean:
find . -name '*.o' -print -delete
find . -name '*.d' -print -delete
fclean: clean
rm -f $(NAME)
re:
+make fclean
+make all