Skip to content

Commit

Permalink
working main
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-philippe martel authored and jean-philippe martel committed Apr 30, 2023
2 parents 71d2739 + b3381f0 commit ad338b5
Show file tree
Hide file tree
Showing 109 changed files with 17,265 additions and 1,197 deletions.
3 changes: 0 additions & 3 deletions .gitignore

This file was deleted.

22 changes: 0 additions & 22 deletions Exceptions.cpp

This file was deleted.

48 changes: 0 additions & 48 deletions Exceptions.hpp

This file was deleted.

59 changes: 22 additions & 37 deletions Makefile
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
148 changes: 0 additions & 148 deletions Server.cpp

This file was deleted.

57 changes: 0 additions & 57 deletions Server.hpp

This file was deleted.

Loading

0 comments on commit ad338b5

Please sign in to comment.