aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-11-23 00:28:03 +0100
committerCharles <sircharlesaze@gmail.com>2019-11-23 00:28:03 +0100
commitc90117251f11e03452ae9808ff8626016c7958a1 (patch)
treeb4ef9f0f562d3394e23af4a698ad35964f18bc23 /Makefile
parent8e3a5ac569a3ccc1101b58fe8ef673f02b4961fb (diff)
downloadlibasm-c90117251f11e03452ae9808ff8626016c7958a1.tar.gz
libasm-c90117251f11e03452ae9808ff8626016c7958a1.tar.bz2
libasm-c90117251f11e03452ae9808ff8626016c7958a1.zip
Compiling with nasm
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 12 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 21ebf11..9eee32f 100644
--- a/Makefile
+++ b/Makefile
@@ -6,21 +6,23 @@
# By: cacharle <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/11/22 02:56:22 by cacharle #+# #+# #
-# Updated: 2019/11/22 03:58:18 by cacharle ### ########.fr #
+# Updated: 2019/11/23 00:27:22 by cacharle ### ########.fr #
# #
# **************************************************************************** #
-NAME = libasm.a
+RM = rm -f
+LIB = ar rcs
CC = gcc
-CCFLAGS = -masm=intel -m64
+CCFLAGS = -Wall -Wextra
-ASMSRC = ft_strlen.s ft_strcpy.s ft_strcmp.s ft_write.s ft_read.s ft_strdup.s \
- ft_atoi_base.s
-ASMOBJ = $(ASMSRC:.s=.o)
+NASM = nasm
+NASMFLAGS = -f macho64
-RM = rm -f
-LIB = ar rcs
+NAME = libasm.a
+ASMSRC = ft_strlen.s ft_strcpy.s ft_strcmp.s ft_write.s ft_read.s \
+ ft_strdup.s ft_atoi_base.s
+ASMOBJ = $(ASMSRC:.s=.o)
all: $(NAME)
@@ -28,11 +30,10 @@ $(NAME): $(ASMOBJ)
$(LIB) $(NAME) $(ASMOBJ)
test: all
- $(CC) main.c -L. -lasm
+ $(CC) main.c $(NAME)
%.o: %.s
- $(CC) $(CCFLAGS) -c -o $@ $<
- @#nasm -f macho64 -o $@ $<
+ $(NASM) $(NASMFLAGS) -o $@ $<
clean:
$(RM) $(ASMOBJ)