diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -6,18 +6,23 @@ # 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: 2020/04/12 19:53:58 by charles ### ########.fr # # # # **************************************************************************** # RM = rm -f LIB = ar rcs +UNAME = $(shell uname) CC = gcc -CCFLAGS = -g -Wall -Wextra -fomit-frame-pointer +CCFLAGS = -Wall -Wextra -fomit-frame-pointer -fPIC NASM = nasm -NASMFLAGS = -f macho64 +ifeq ($(UNAME),Linux) + NASMFLAGS = -f elf64 +else + NASMFLAGS = -f macho64 +endif NAME = libasm.a ASMSRC = ft_strlen.s ft_strcpy.s ft_strcmp.s ft_write.s ft_read.s \ @@ -25,13 +30,15 @@ ASMSRC = ft_strlen.s ft_strcpy.s ft_strcmp.s ft_write.s ft_read.s \ ft_list_size.s ft_list_sort.s ft_list_remove_if.s ASMOBJ = $(ASMSRC:.s=.o) +TESTNAME = runtest + all: $(NAME) $(NAME): $(ASMOBJ) $(LIB) $(NAME) $(ASMOBJ) test: all - $(CC) main.c $(NAME) + $(CC) main.c $(NAME) -o $(TESTNAME) %.o: %.s $(NASM) $(NASMFLAGS) -o $@ $< |
