ajout ex03 et correction dump core
This commit is contained in:
86
d05/ex03/Makefile
Normal file
86
d05/ex03/Makefile
Normal file
@@ -0,0 +1,86 @@
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
||||
# . name = value \ . += append to a variable #
|
||||
# VARIABLES . value . != set result of command #
|
||||
# . name is case sensitive . ?= set if not already set #
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
||||
|
||||
NAME = interns
|
||||
|
||||
#CC = gcc
|
||||
CXX = c++
|
||||
|
||||
#CFLAGS = -Wall -Wextra -Werror $(INCLUDES)
|
||||
CXXFLAGS = -Wall -Wextra -Werror $(INCLUDES) -std=c++98
|
||||
|
||||
#EXT = c
|
||||
EXT = cpp
|
||||
|
||||
VPATH = $(D_SRCS)
|
||||
|
||||
LIBS =
|
||||
|
||||
INCLUDES = -I$(D_HEADERS)
|
||||
|
||||
D_SRCS = srcs
|
||||
SRCS = main.cpp \
|
||||
Bureaucrat.cpp \
|
||||
AForm.cpp \
|
||||
ShrubberyCreationForm.cpp \
|
||||
RobotomyRequestForm.cpp \
|
||||
PresidentialPardonForm.cpp \
|
||||
Intern.cpp
|
||||
|
||||
D_HEADERS = headers
|
||||
HEADERS = colors.h \
|
||||
Bureaucrat.hpp \
|
||||
AForm.hpp \
|
||||
ShrubberyCreationForm.hpp \
|
||||
RobotomyRequestForm.hpp \
|
||||
PresidentialPardonForm.hpp \
|
||||
Intern.hpp
|
||||
|
||||
D_OBJS = builds
|
||||
OBJS = $(SRCS:%.$(EXT)=$(D_OBJS)/%.o)
|
||||
|
||||
ifeq "$(D_OBJS)" "."
|
||||
RM_OBJS = rm -f $(OBJS)
|
||||
else
|
||||
RM_OBJS = rm -rf $(D_OBJS)
|
||||
endif
|
||||
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
||||
# . target: prerequisites . $@ : target #
|
||||
# RULES . recipe . $< : 1st prerequisite #
|
||||
# . recipe . $^ : all prerequisites #
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
||||
|
||||
all: $(NAME)
|
||||
|
||||
$(D_OBJS)/%.o: %.$(EXT) | $(D_OBJS)
|
||||
# $(CC) $(CFLAGS) -c $< -o $@
|
||||
$(CXX) $(CXXFLAGS) -c $< -o $@
|
||||
|
||||
$(D_OBJS):
|
||||
mkdir $@
|
||||
|
||||
$(OBJS): $(HEADERS:%=$(D_HEADERS)/%)
|
||||
|
||||
$(NAME): $(OBJS)
|
||||
# $(CC) $(OBJS) -o $@ $(LIBS)
|
||||
$(CXX) $(OBJS) -o $@ $(LIBS)
|
||||
|
||||
leaks: $(NAME)
|
||||
valgrind --leak-check=full --show-leak-kinds=all ./$(NAME)
|
||||
|
||||
clean:
|
||||
$(RM_OBJS)
|
||||
rm -f *_shrubbery
|
||||
|
||||
fclean: clean
|
||||
rm -f $(NAME)
|
||||
|
||||
re: fclean all
|
||||
|
||||
.PHONY : all clean fclean re
|
||||
|
||||
Reference in New Issue
Block a user