start project

This commit is contained in:
2025-03-27 17:11:46 +01:00
commit 589addcb91
9 changed files with 113 additions and 0 deletions

38
Makefile Normal file
View File

@ -0,0 +1,38 @@
NAME ?= libasm.a
SRCS_DIR = srcs
OBJS_DIR = .objs
SRCS_NAMES = ft_strlen.s\
ft_strcpy.s\
ft_strcmp.s\
ft_write.s\
ft_read.s\
ft_strdup.s
SRCS = $(addprefix $(SRCS_DIR)/, $(SRCS_NAMES))
OBJS = $(addprefix $(OBJS_DIR)/, $(SRCS_NAMES:.s=.o))
all: $(NAME)
test: test.c $(NAME)
gcc -o test.o -c test.c
ld tests.c -L. -lasm
$(NAME): $(OBJS_DIR) $(OBJS)
ar rcs $@ $(OBJS)
$(OBJS_DIR):
mkdir -p $(OBJS_DIR)
$(OBJS_DIR)/%.o: $(SRCS_DIR)/%.s
nasm -o $@ $<
clean:
rm -rf $(OBJS_DIR)
fclean: clean
rm -f $(NAME) test
.PHONY: fclean clean all