feat: Makefile and test main
This commit is contained in:
parent
e41fd99ce1
commit
c1a848d05b
|
@ -0,0 +1,27 @@
|
|||
NAME = libasm
|
||||
|
||||
SRC = ft_strlen.s
|
||||
|
||||
OBJ = $(SRC:.s=.o)
|
||||
|
||||
%.o:%.s
|
||||
nasm -f elf64 $< -o $@
|
||||
|
||||
all: $(NAME)
|
||||
|
||||
$(NAME): $(OBJ)
|
||||
ar rcs libasm.a $(OBJ)
|
||||
|
||||
test: $(NAME)
|
||||
gcc -Wall -Werror -Wextra main.c -L. -lasm -o libasm_unit_tests
|
||||
|
||||
clean:
|
||||
rm $(OBJ)
|
||||
|
||||
fclean:
|
||||
rm libasm.a
|
||||
rm libasm_unit_tests
|
||||
|
||||
re: fclean all
|
||||
|
||||
.PHONY: all test
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef _LIBASM_H
|
||||
# define _LIBASM_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
ssize_t ft_strlen(const char *);
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue