Skip to content

Commit

Permalink
Merge pull request #12 from tdameros/8-relink-after-ft_list-edit
Browse files Browse the repository at this point in the history
8 relink after ft list edit
  • Loading branch information
tdameros authored Aug 3, 2024
2 parents 628a842 + b664b79 commit cb4b6bd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -71,6 +71,7 @@ MKDIR = mkdir -p

#*********************************** RULES **********************************#


.PHONY: all
all: $(NAME)

Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/ft_create_elem.s
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion src/ft_list_push_front.s
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit cb4b6bd

Please sign in to comment.