feat(ex00): it works
This commit is contained in:
parent
8bcbce102b
commit
69e91f7664
5 changed files with 163 additions and 0 deletions
39
ex00/Makefile
Normal file
39
ex00/Makefile
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
NAME = ex00
|
||||
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 \
|
||||
|
||||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue