diff --git a/Makefile b/Makefile index 8d35450..7e35da0 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ DIR_UTEST = $(DIR_LIB)utest/ # ------------- SHORTCUTS ------------- # OBJ = $(patsubst %.s, $(DIR_BUILD)%.o, $(SRC)) -DEP = $(patsubst %.c, $(DIR_BUILD)%.d, $(SRC)) +DEP = $(patsubst %.s, $(DIR_BUILD)%.d, $(SRC)) SRC = $(addprefix $(DIR_SRC), $(LIST_ASM_SRC)) TEST_SRC = $(addprefix $(DIR_TEST), $(LIST_TEST_SRC)) TEST_DEP = $(patsubst %.c, $(DIR_BUILD)%.d, $(TEST_SRC)) @@ -71,6 +71,7 @@ MKDIR = mkdir -p #*********************************** RULES **********************************# + .PHONY: all all: $(NAME) @@ -88,9 +89,10 @@ $(NAME): $(OBJ) # ---------- COMPILED RULES ----------- # +-include $(DEP) $(DIR_BUILD)%.o: %.s mkdir -p $(shell dirname $@) - $(AS) $(ASFLAGS) $< -o $@ + $(AS) $(ASFLAGS) -MD $(@:.o=.d) $< -o $@ -include $(TEST_DEP) $(DIR_BUILD)%.o: %.c diff --git a/src/ft_create_elem.s b/src/ft_create_elem.s index a9c72b2..bbb51f2 100644 --- a/src/ft_create_elem.s +++ b/src/ft_create_elem.s @@ -25,6 +25,7 @@ ft_create_elem: pop rdi mov [rax + LIST_DATA_OFFSET], rdi mov qword [rax + LIST_NEXT_OFFSET], 0 - return + jmp return + return: ret diff --git a/src/ft_list_push_front.s b/src/ft_list_push_front.s index 30eba74..863f602 100644 --- a/src/ft_list_push_front.s +++ b/src/ft_list_push_front.s @@ -29,6 +29,7 @@ ft_list_push_front: mov rsi, [rdi] mov qword [rax + LIST_NEXT_OFFSET], rsi mov qword [rdi], rax - .return + jmp .return + .return: ret