From 7b240b0c110bac11b3b3bb396a7c1630cbc6aa35 Mon Sep 17 00:00:00 2001 From: gbrochar Date: Tue, 27 Aug 2024 12:09:07 +0200 Subject: [PATCH] chore(Makefile): better libs rules --- Makefile | 6 +++--- README.md | 3 +++ ft_printf/Makefile | 10 ++++++---- 3 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 README.md diff --git a/Makefile b/Makefile index 1b3b594..7e5c4c7 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ WHITE = \033[0m all: $(NAME) -$(NAME): ft_printf $(OBJ) $(INC) +$(NAME): $(LIB) $(OBJ) $(INC) @$(CC) $(CFLAGS) $(OBJ) $(LIB) -o $(NAME) @echo -e "$(GREEN)[OK]$(WHITE) $(NAME)" @@ -39,7 +39,7 @@ $(OBJ_DIR)%.o: $(SRC_DIR)%.c $(INC) @$(CC) $(CFLAGS) -I $(INC_DIR) -I ft_printf/inc -o $@ -c $< @echo -e "$(CYAN)[CC]$(WHITE) $(<:$(SRC_DIR)%=%)" -ft_printf: +$(LIB): @echo -e "$(PURPLE)[MAKE]$(WHITE) ft_printf" @make --no-print-directory -C ft_printf @@ -57,4 +57,4 @@ fclean: re: fclean all -.PHONY: all ft_printf clean fclean re +.PHONY: all clean fclean re diff --git a/README.md b/README.md new file mode 100644 index 0000000..2103ac0 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Woody Woodpacker + +Woody Woodpacker is a simple ELF packer that will encrypt the text section of an ELF program and add a payload that will write "....WOODY...." and decypher the text section before executing it normally. diff --git a/ft_printf/Makefile b/ft_printf/Makefile index a83eab5..9ab1e5c 100644 --- a/ft_printf/Makefile +++ b/ft_printf/Makefile @@ -25,6 +25,8 @@ INC = $(addprefix $(INC_DIR), $(INC_FILE)) CC = gcc CFLAGS = -Wall -Werror -Wextra +LIB = libft/libft.a + GREEN = \033[32m RED = \033[31m ORANGE = \033[33m @@ -34,8 +36,8 @@ WHITE = \033[0m all: $(NAME) -$(NAME): libft $(OBJ) $(INC) - @cp libft/libft.a $(NAME) +$(NAME): $(LIB) $(OBJ) $(INC) + @cp $(LIB) $(NAME) @ar -rcs $(NAME) $(OBJ) @ranlib $(NAME) @echo -e "$(GREEN)[OK]$(WHITE) $(NAME)" @@ -47,7 +49,7 @@ $(OBJ_DIR)%.o: $(SRC_DIR)%.c libft/ $(INC) @$(CC) $(CFLAGS) -I $(INC_DIR) -I libft/inc -o $@ -c $< @echo -e "$(CYAN)[CC]$(WHITE) $(<:$(SRC_DIR)%=%)" -libft: +$(LIB): @echo -e "$(PURPLE)[MAKE]$(WHITE) libft" @make --no-print-directory -C ./libft @@ -65,4 +67,4 @@ fclean: re: fclean all -.PHONY: all libft clean fclean re +.PHONY: all clean fclean re