From cd5c9e6a923878e797212d27476ee217eb844a14 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Thu, 11 Feb 2021 15:40:48 +0100 Subject: Added Linux compatibility --- Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3bf5764..1e16d1a 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # By: cacharle +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2019/11/22 02:56:22 by cacharle #+# #+# # -# Updated: 2020/02/08 20:55:14 by cacharle ### ########.fr # +# Updated: 2021/02/11 14:50:09 by charles ### ########.fr # # # # **************************************************************************** # @@ -17,7 +17,11 @@ CC = gcc CCFLAGS = -g -Wall -Wextra -fomit-frame-pointer NASM = nasm -NASMFLAGS = -f macho64 +ifeq ($(shell uname),Linux) + NASMFLAGS = -f elf64 -D__LINUX__=1 +else + NASMFLAGS = -f macho64 +endif NAME = libasm.a ASMSRC = ft_strlen.s ft_strcpy.s ft_strcmp.s ft_write.s ft_read.s \ @@ -27,6 +31,8 @@ ASMOBJ = $(ASMSRC:.s=.o) all: $(NAME) +bonus: all + $(NAME): $(ASMOBJ) $(LIB) $(NAME) $(ASMOBJ) @@ -43,3 +49,5 @@ fclean: clean $(RM) $(NAME) re: fclean all + +.PHONY: all bonus test clean fclean re -- cgit