add namespace, make stl, and template allocator
This commit is contained in:
80
Makefile
80
Makefile
@@ -1,40 +1,72 @@
|
||||
# - - - - - - - #
|
||||
# #
|
||||
# COLORS #
|
||||
# #
|
||||
# - - - - - - - #
|
||||
|
||||
GRAY = "\e[0;30m"
|
||||
RED = "\e[0;31m"
|
||||
GREEN = "\e[0;32m"
|
||||
YELLOW = "\e[0;33m"
|
||||
BLUE = "\e[0;34m"
|
||||
PURPLE = "\e[0;35m"
|
||||
CYAN = "\e[0;36m"
|
||||
WHITE = "\e[0;37m"
|
||||
|
||||
B_GRAY = "\e[1;30m"
|
||||
B_RED = "\e[1;31m"
|
||||
B_GREEN = "\e[1;32m"
|
||||
B_YELLOW = "\e[1;33m"
|
||||
B_BLUE = "\e[1;34m"
|
||||
B_PURPLE = "\e[1;35m"
|
||||
B_CYAN = "\e[1;36m"
|
||||
B_WHITE = "\e[1;37m"
|
||||
|
||||
RESET = "\e[0m"
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
||||
# . name = value \ . += append to a variable #
|
||||
# VARIABLES . value . != set result of command #
|
||||
# . name is case sensitive . ?= set if not already set #
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
||||
|
||||
NAME = containers
|
||||
NAME = containers
|
||||
|
||||
CC = c++
|
||||
EXT = cpp
|
||||
CC = c++
|
||||
EXT = cpp
|
||||
|
||||
CFLAGS = -Wall -Wextra -Werror $(INCLUDES)
|
||||
CFLAGS += -std=c++98
|
||||
CFLAGS += -g3
|
||||
CFLAGS = -Wall -Wextra -Werror $(INCLUDES)
|
||||
CFLAGS += -std=c++98
|
||||
CFLAGS += -g3
|
||||
|
||||
VPATH = $(D_SRCS)
|
||||
VPATH = $(D_SRCS)
|
||||
|
||||
LIBS =
|
||||
LIBS =
|
||||
|
||||
INCLUDES = -I$(D_HEADERS)
|
||||
F_INCLUDES = $(HEADERS:%=$(D_HEADERS)/%) \
|
||||
$(TEMPLATES:%=$(D_TEMPLATES)/%)
|
||||
INCLUDES = -I$(D_HEADERS) \
|
||||
-I$(D_TEMPLATES)
|
||||
|
||||
D_SRCS = srcs
|
||||
SRCS = main.cpp \
|
||||
ftvector.cpp
|
||||
D_SRCS = ./tests
|
||||
SRCS = main.cpp
|
||||
#SRCS = main42.cpp
|
||||
|
||||
D_HEADERS = headers
|
||||
HEADERS = colors.h \
|
||||
tests.h \
|
||||
ftvector.hpp
|
||||
D_HEADERS = ./headers
|
||||
HEADERS = colors.h \
|
||||
tests.hpp \
|
||||
vector.hpp
|
||||
|
||||
D_OBJS = builds
|
||||
OBJS = $(SRCS:%.$(EXT)=$(D_OBJS)/%.o)
|
||||
D_TEMPLATES = ./templates
|
||||
TEMPLATES = vector.tpp
|
||||
|
||||
D_OBJS = builds
|
||||
OBJS = $(SRCS:%.$(EXT)=$(D_OBJS)/%.o)
|
||||
|
||||
ifeq "$(D_OBJS)" "."
|
||||
RM_OBJS = rm -f $(OBJS)
|
||||
RM_OBJS = rm -f $(OBJS)
|
||||
else
|
||||
RM_OBJS = rm -rf $(D_OBJS)
|
||||
RM_OBJS = rm -rf $(D_OBJS)
|
||||
endif
|
||||
|
||||
|
||||
@@ -46,15 +78,21 @@ endif
|
||||
|
||||
all: $(NAME)
|
||||
|
||||
stl: CFLAGS += -D STL
|
||||
stl: all
|
||||
ft: all
|
||||
|
||||
$(D_OBJS)/%.o: %.$(EXT) | $(D_OBJS)
|
||||
@echo $(CYAN)"compilation (objects.o) :"$(RESET)
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
$(D_OBJS):
|
||||
mkdir $@
|
||||
|
||||
$(OBJS): $(HEADERS:%=$(D_HEADERS)/%)
|
||||
$(OBJS): $(F_INCLUDES)
|
||||
|
||||
$(NAME): $(OBJS)
|
||||
@echo $(CYAN)"linkage (link objects.o) :"$(RESET)
|
||||
$(CC) $(OBJS) -o $@ $(LIBS)
|
||||
|
||||
leaks: $(NAME)
|
||||
|
||||
Reference in New Issue
Block a user