Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8 relink after ft list edit #12

Merged
merged 2 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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