added semaphore and shared memory to print without superposition between parent and child process

This commit is contained in:
hugogogo
2022-08-22 14:52:31 +02:00
parent 5225e3258b
commit f7b31c7db7
14 changed files with 127 additions and 65 deletions

View File

@@ -1,13 +1,13 @@
NAME = webserv
CXX = c++
CXX = clang++
CXXFLAGS = -Wall -Wextra -Werror
CXXFLAGS += $(HEADERS_D:%=-I%)
CXXFLAGS += -std=c++98
CXXFLAGS += -g
#CXXFLAGS += -fno-limit-debug-info
CXXFLAGS += -MMD -MP #header dependencie
CXXFLAGS += -MMD -MP # header dependencie
# for debug
VPATH = $(SRCS_D)
@@ -43,14 +43,16 @@ DEPS = $(OBJS:.o=.d) #header dependencie
all: $(NAME)
$(OBJS_D)/%.o: %.cpp | $(OBJS_D)
$(CXX) $(CXXFLAGS) -c $< -o $@
$(CXX) -c $< -o $@ $(CXXFLAGS)
printf "$(_CYAN)\r\33[2K\rCompling $@$(_END)"
$(OBJS_D):
mkdir $@
$(NAME): $(OBJS)
$(CXX) $^ -o $(NAME)
# $(CXX) $^ -o $(NAME)
# add -lpthread for semaphore library
$(CXX) $^ -o $(NAME) -lpthread
echo "$(_GREEN)\r\33[2K\r$(NAME) created 😎$(_END)"
# CGI