fix bonus rule and fix error in write and read (returned -1 instead of 0)
This commit is contained in:
10
Makefile
10
Makefile
@ -3,7 +3,6 @@ NAME ?= libasm.a
|
||||
SRCS_DIR = srcs
|
||||
SRCS_BONUS_DIR = srcs/bonus
|
||||
OBJS_DIR = .objs
|
||||
|
||||
SRCS_NAMES = ft_strlen.s\
|
||||
ft_strcpy.s\
|
||||
ft_strcmp.s\
|
||||
@ -27,13 +26,13 @@ FLAGS = -felf64
|
||||
|
||||
all: $(NAME)
|
||||
|
||||
libasm_bonus.a : $(OBJS_DIR) $(OBJS) $(OBJS_BONUS)
|
||||
ar rcs libasm_bonus.a $(OBJS) $(OBJS_BONUS)
|
||||
|
||||
test: test.c libasm_bonus.a
|
||||
test: test.c bonus
|
||||
clang -z noexecstack test.c -L. -lasm_bonus -o test -g
|
||||
./test || echo -e "\033[31m tests exited with an error code"
|
||||
|
||||
bonus: $(OBJS_DIR) $(OBJS) $(OBJS_BONUS)
|
||||
ar rcs $@ $(OBJS) $(OBJS_BONUS)
|
||||
|
||||
$(NAME): $(OBJS_DIR) $(OBJS)
|
||||
ar rcs $@ $(OBJS)
|
||||
|
||||
@ -51,6 +50,5 @@ clean:
|
||||
|
||||
fclean: clean
|
||||
rm -f $(NAME) test
|
||||
rm -f libasm_bonus.a
|
||||
|
||||
.PHONY: fclean clean all
|
||||
|
@ -7,7 +7,7 @@ ft_read:
|
||||
syscall
|
||||
|
||||
cmp rax, 0 ; if return is < 0, it's an error in negative
|
||||
jg success
|
||||
jge success
|
||||
|
||||
neg rax ; inv errno, and set errno
|
||||
mov edi, eax
|
||||
|
@ -7,7 +7,7 @@ ft_write:
|
||||
syscall
|
||||
|
||||
cmp rax, 0 ; if return is < 0, it's an error in negative
|
||||
jg success
|
||||
jge success
|
||||
|
||||
neg rax ; inv errno, and set errno
|
||||
mov edi, eax
|
||||
|
Reference in New Issue
Block a user