aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2021-02-11 15:40:48 +0100
committerCharles Cabergs <me@cacharle.xyz>2021-02-11 15:40:48 +0100
commitcd5c9e6a923878e797212d27476ee217eb844a14 (patch)
treef5ea8605d0521cbfbf384b05567bf3d2155b0b45 /Makefile
parent28424105e255f0a4c887b6e6a83afd6dce372709 (diff)
downloadlibasm-cd5c9e6a923878e797212d27476ee217eb844a14.tar.gz
libasm-cd5c9e6a923878e797212d27476ee217eb844a14.tar.bz2
libasm-cd5c9e6a923878e797212d27476ee217eb844a14.zip
Added Linux compatibility
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 10 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 3bf5764..1e16d1a 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@
# By: cacharle <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# 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