Ahmet Kerem Final
libasm Makefile
Makefile 496 B
NAME = libasm.a
TEST = libasm_test
SRCS = ft_strlen.s ft_strcpy.s ft_strcmp.s ft_write.s ft_read.s ft_strdup.s ft_calloc.s
OBJS = $(SRCS:.s=.o)
NASM = nasm
NAFLAGS = -f elf64
CC = cc
CFLAGS = -Wall -Wextra -Werror
all: $(NAME)
$(NAME): $(OBJS)
ar rcs $@ $(OBJS)
%.o: %.s
$(NASM) $(NAFLAGS) $< -o $@
test: $(NAME) main.c
$(CC) $(CFLAGS) main.c -L. -lasm -o $(TEST)
./$(TEST)
clean:
rm -f $(OBJS)
fclean: clean
rm -f $(NAME) $(TEST)
re: fclean all
.PHONY: all clean fclean re test