aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-01-14 15:47:21 +0100
committerCharles <sircharlesaze@gmail.com>2020-01-14 15:47:21 +0100
commit94d61d8aaee7a3df0dc1f055e27e0f4484cb3ffa (patch)
tree932c0e5d40822e8d98ad04485c6f7fc088c31c09 /Makefile
parent6808cd0fbd3edf68422228d2ee6a41ad70f971d5 (diff)
downloadlibasm-94d61d8aaee7a3df0dc1f055e27e0f4484cb3ffa.tar.gz
libasm-94d61d8aaee7a3df0dc1f055e27e0f4484cb3ffa.tar.bz2
libasm-94d61d8aaee7a3df0dc1f055e27e0f4484cb3ffa.zip
Linux version without '_' prefix
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 12 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index f1aa92d..7a3282e 100644
--- a/Makefile
+++ b/Makefile
@@ -12,26 +12,33 @@
RM = rm -f
LIB = ar rcs
+UNAME = $(shell uname)
CC = gcc
-CCFLAGS = -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 \
- ft_strdup.s ft_atoi_base.s ft_list_push_front.s \
- ft_list_size.s ft_list_sort.s ft_list_remove_if.s
+ ft_strdup.s ft_atoi_base.s #ft_list_push_front.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 $@ $<