removed libft from makefile
This commit is contained in:
parent
d2fb3d5c05
commit
fad9d1cfd0
3 changed files with 16 additions and 31 deletions
|
|
@ -22,10 +22,6 @@ FLAGS = $(W_FLAGS) $(D_FLAGS)
|
||||||
LEN_NAME = `printf "%s" $(NAME) |wc -c`
|
LEN_NAME = `printf "%s" $(NAME) |wc -c`
|
||||||
DELTA = $$(echo "$$(tput cols)-31-$(LEN_NAME)"|bc)
|
DELTA = $$(echo "$$(tput cols)-31-$(LEN_NAME)"|bc)
|
||||||
|
|
||||||
LIBFT_DIR = libft/
|
|
||||||
LIBFT_LIB = $(LIBFT_DIR)libft.a
|
|
||||||
LIBFT_INC = $(LIBFT_DIR)includes/
|
|
||||||
|
|
||||||
SRC_DIR = srcs/
|
SRC_DIR = srcs/
|
||||||
INC_DIR = includes/
|
INC_DIR = includes/
|
||||||
OBJ_DIR = objs/
|
OBJ_DIR = objs/
|
||||||
|
|
@ -39,19 +35,14 @@ NB = $(words $(SRC_BASE))
|
||||||
INDEX = 0
|
INDEX = 0
|
||||||
|
|
||||||
all :
|
all :
|
||||||
@make -C $(LIBFT_DIR)
|
|
||||||
@make -j $(NAME)
|
@make -j $(NAME)
|
||||||
|
|
||||||
$(NAME): $(LIBFT_LIB) $(OBJ_DIR) $(OBJS)
|
$(NAME): $(OBJ_DIR) $(OBJS)
|
||||||
@$(CC) $(OBJS) -o $@ \
|
@$(CC) $(OBJS) -o $@ \
|
||||||
-I $(INC_DIR) \
|
-I $(INC_DIR) \
|
||||||
-I $(LIBFT_INC) \
|
$(FLAGS)
|
||||||
$(LIBFT_LIB) $(FLAGS)
|
|
||||||
@printf "\r\033[38;5;117m✓ MAKE $@ \033[0m\033[K\n"
|
@printf "\r\033[38;5;117m✓ MAKE $@ \033[0m\033[K\n"
|
||||||
|
|
||||||
$(LIBFT_LIB):
|
|
||||||
@make -C $(LIBFT_DIR)
|
|
||||||
|
|
||||||
$(OBJ_DIR) :
|
$(OBJ_DIR) :
|
||||||
@mkdir -p $(OBJ_DIR)
|
@mkdir -p $(OBJ_DIR)
|
||||||
|
|
||||||
|
|
@ -62,20 +53,16 @@ $(OBJ_DIR)%.o : $(SRC_DIR)%.c | $(OBJ_DIR)
|
||||||
@$(eval COLOR=$(shell list=(160 196 202 208 215 221 226 227 190 154 118 82 46); index=$$(($(PERCENT) * $${#list[@]} / 100)); echo "$${list[$$index]}"))
|
@$(eval COLOR=$(shell list=(160 196 202 208 215 221 226 227 190 154 118 82 46); index=$$(($(PERCENT) * $${#list[@]} / 100)); echo "$${list[$$index]}"))
|
||||||
@printf "\r\033[38;5;%dm⌛ [%s]: %2d%% `printf '█%.0s' {0..$(DONE)}`%*s❙%*.*s\033[0m\033[K" $(COLOR) ft_p $(PERCENT) $(TO_DO) "" $(DELTA) $(DELTA) "$(shell echo "$@" | sed 's/^.*\///')"
|
@printf "\r\033[38;5;%dm⌛ [%s]: %2d%% `printf '█%.0s' {0..$(DONE)}`%*s❙%*.*s\033[0m\033[K" $(COLOR) ft_p $(PERCENT) $(TO_DO) "" $(DELTA) $(DELTA) "$(shell echo "$@" | sed 's/^.*\///')"
|
||||||
@$(CC) $(FLAGS) $(OBJ_FLAG) -MMD -c $< -o $@\
|
@$(CC) $(FLAGS) $(OBJ_FLAG) -MMD -c $< -o $@\
|
||||||
-I $(INC_DIR)\
|
-I $(INC_DIR)
|
||||||
-I $(LIBFT_INC)
|
|
||||||
@$(eval INDEX=$(shell echo $$(($(INDEX)+1))))
|
@$(eval INDEX=$(shell echo $$(($(INDEX)+1))))
|
||||||
|
|
||||||
clean: cleanlib
|
clean:
|
||||||
@if [ -e $(OBJ_DIR) ]; then \
|
@if [ -e $(OBJ_DIR) ]; then \
|
||||||
rm -rf $(OBJ_DIR); \
|
rm -rf $(OBJ_DIR); \
|
||||||
printf "\r\033[38;5;202m✗ clean $(NAME) \033[0m\033[K\n"; \
|
printf "\r\033[38;5;202m✗ clean $(NAME) \033[0m\033[K\n"; \
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
cleanlib:
|
fclean: clean
|
||||||
@make -C $(LIBFT_DIR) clean
|
|
||||||
|
|
||||||
fclean: clean fcleanlib
|
|
||||||
@for file in $(NAME); do \
|
@for file in $(NAME); do \
|
||||||
if [ -e $$file ]; then \
|
if [ -e $$file ]; then \
|
||||||
rm -f $$file ; \
|
rm -f $$file ; \
|
||||||
|
|
@ -83,13 +70,8 @@ fclean: clean fcleanlib
|
||||||
fi; \
|
fi; \
|
||||||
done;
|
done;
|
||||||
|
|
||||||
fcleanlib: cleanlib
|
|
||||||
@make -C $(LIBFT_DIR) fclean
|
|
||||||
|
|
||||||
re: fclean all
|
re: fclean all
|
||||||
|
|
||||||
relib: fcleanlib $(LIBFT_LIB)
|
.PHONY : fclean clean re
|
||||||
|
|
||||||
.PHONY : fclean clean re relib cleanlib fcleanlib
|
|
||||||
|
|
||||||
-include $(OBJS:.o=.d)
|
-include $(OBJS:.o=.d)
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,10 @@
|
||||||
#ifndef FT_STRACE_H
|
#ifndef FT_STRACE_H
|
||||||
# define FT_STRACE_H
|
# define FT_STRACE_H
|
||||||
|
|
||||||
# include "libft.h"
|
# include <unistd.h>
|
||||||
|
# include <stdlib.h>
|
||||||
|
# include <stdio.h>
|
||||||
|
# include <string.h>
|
||||||
# include <sys/ptrace.h>
|
# include <sys/ptrace.h>
|
||||||
# include <sys/user.h>
|
# include <sys/user.h>
|
||||||
# include <sys/wait.h>
|
# include <sys/wait.h>
|
||||||
|
|
|
||||||
|
|
@ -17,12 +17,12 @@ extern char **environ;
|
||||||
extern t_syscall g_syscalls[];
|
extern t_syscall g_syscalls[];
|
||||||
|
|
||||||
#define LOAD_PARAMS(params, regs) do { \
|
#define LOAD_PARAMS(params, regs) do { \
|
||||||
ft_memcpy(params + 0, ®s->rdi, 8); \
|
memcpy(params + 0, ®s->rdi, 8); \
|
||||||
ft_memcpy(params + 1, ®s->rsi, 8); \
|
memcpy(params + 1, ®s->rsi, 8); \
|
||||||
ft_memcpy(params + 2, ®s->rdx, 8); \
|
memcpy(params + 2, ®s->rdx, 8); \
|
||||||
ft_memcpy(params + 3, ®s->rcx, 8); \
|
memcpy(params + 3, ®s->rcx, 8); \
|
||||||
ft_memcpy(params + 4, ®s->r8, 8); \
|
memcpy(params + 4, ®s->r8, 8); \
|
||||||
ft_memcpy(params + 5, ®s->r9, 8); \
|
memcpy(params + 5, ®s->r9, 8); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
void print_syscall_params(t_syscall syscall, struct user_regs_struct *regs)
|
void print_syscall_params(t_syscall syscall, struct user_regs_struct *regs)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue