-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
109 changed files
with
17,265 additions
and
1,197 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,28 @@ | ||
NAME = webserv | ||
CC = g++ | ||
FLAGS = -Wall -Wextra -Werror --std=c++98 -g | ||
|
||
SRCS = Exceptions.cpp main.cpp parser.cpp utils.cpp server.cpp server_utils.cpp response.cpp | ||
|
||
|
||
RM = rm -rf | ||
|
||
.cpp.o: | ||
@c++ ${FLAGS} -c $< -o ${<:.cpp=.o} | ||
|
||
OBJS = ${SRCS:.cpp=.o} | ||
|
||
all: ${NAME} | ||
|
||
${NAME}:${OBJS} | ||
@${CC} ${OBJS} ${FLAGS} -o ${NAME} | ||
|
||
run: all | ||
./${NAME} | ||
|
||
NAME= webserv | ||
SRC_DIR := ./src | ||
FLAGS = -Wall -Werror -Wextra --std=c++98 -g | ||
OBJ_DIR := ./obj | ||
SRC_FILES := ./src/Exceptions.cpp ./src/main.cpp ./src/parser.cpp ./src/Server.cpp ./src/server_utils.cpp ./src/response.cpp ./src/CGI.cpp ./src/upload.cpp | ||
Header := ./src/Server.hpp ./src/Exceptions.hpp ./src/parser.hpp ./src/response.hpp ./src/CGI.hpp ./src/upload.hpp ./src/config_structs.hpp | ||
OBJ_FILES := $(patsubst $(SRC_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(SRC_FILES)) | ||
all : $(OBJ_DIR) $(NAME) | ||
$(OBJ_DIR): | ||
@mkdir -p $(OBJ_DIR) | ||
$(NAME): $(OBJ_FILES) | ||
g++ $(FLAGS) -Isrc -o $@ $^ | ||
run : $(NAME) | ||
./$(NAME) | ||
re: fclean all | ||
|
||
val: all | ||
valgrind --leak-check=yes --track-origins=yes -s --trace-children=yes ./${NAME} | ||
|
||
clean: | ||
${RM} ${OBJS} | ||
|
||
test: all | ||
./${NAME} & sleep 1 && http :9991 | ||
|
||
fclean: clean | ||
@${RM} ${NAME} | ||
@${RM} ${NAME_TEST} | ||
|
||
rm -rf $(OBJ_DIR) | ||
git: | ||
@git add ${SRCS} Makefile Exceptions.hpp config_structs.hpp parser.hpp utils.hpp server.hpp response.hpp | ||
|
||
re: fclean all | ||
|
||
.PHONY: clean fclean re all run git | ||
git add $(SRC_FILES) $(Header) Makefile | ||
fclean: clean | ||
rm -f webserv | ||
|
||
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp | ||
g++ $(FLAGS) -c -o $@ $< | ||
.PHONY: clean fclean re all run git |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.