petites transformations sur les makefiles
This commit is contained in:
14
d05/ex00/Bureaucrate.hpp
Normal file
14
d05/ex00/Bureaucrate.hpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef BUREAUCRATE_HPP
|
||||
# define BUREAUCRATE_HPP
|
||||
|
||||
class Bureaucrate {
|
||||
public:
|
||||
Bureaucrate();
|
||||
Bureaucrate(std::string name, int grade);
|
||||
|
||||
private:
|
||||
std::string const _name;
|
||||
int _grade;
|
||||
}
|
||||
|
||||
#endif
|
||||
71
d05/ex00/Makefile
Normal file
71
d05/ex00/Makefile
Normal file
@@ -0,0 +1,71 @@
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
||||
# . name = value \ . += append to a variable #
|
||||
# VARIABLES . value . != set result of command #
|
||||
# . name is case sensitive . ?= set if not already set #
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
||||
|
||||
NAME = bureaucrate
|
||||
|
||||
#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 = main.cpp \
|
||||
Bureaucrate.cpp
|
||||
|
||||
D_HEADERS = .
|
||||
HEADERS = Bureaucrate.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)
|
||||
|
||||
clean:
|
||||
$(RM_OBJS)
|
||||
|
||||
fclean: clean
|
||||
rm -f $(NAME)
|
||||
|
||||
re: fclean all
|
||||
|
||||
.PHONY : all clean fclean re
|
||||
|
||||
10
d05/ex00/main.cpp
Normal file
10
d05/ex00/main.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
int main() {
|
||||
try
|
||||
{
|
||||
|
||||
}
|
||||
catch (std::exception & e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user