diff --git a/.gitignore b/.gitignore index 752e637..25f4059 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.out server +libhttpablu.a diff --git a/Makefile b/Makefile index 9ab412a..91cd220 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,37 @@ -run: build +CC = g++ +CFLAGS = -Wall -Wextra -Werror +CFILES = router.cpp path.cpp request.cpp response.cpp +OFILES = router.o path.o request.o response.o +HFILES = router.hpp path.hpp request.hpp response.hpp http.hpp + +NAME = libhttpablu.a + +all: $(NAME) clean + +$(NAME): ofiles + ar rcs $(NAME) $(OFILES) + +ofiles: + g++ -std=c++20 -O -c $(CFILES) + +clean: + rm -f $(OFILES) + +fclean: + rm -f $(NAME) + +re: fclean $(NAME) + +run: all + g++ -std=c++20 -o server main.cpp -L. -lhttpablu ./server -build: - g++ -std=c++20 main.cpp router.cpp path.cpp http.hpp request.cpp response.cpp -g -o server +install: all + mv $(NAME) /lib + cp $(HFILES) /usr/include + +remove: + rm /lib/$(NAME) + rm -d /usr/include/ -f $(HFILES) + +.PHONY: all clean fclean re run ofiles remove install