「✨」 feat(write + strcmp): fixed strcmp, write done ! first syscall git status :D
This commit is contained in:
44
Makefile
Normal file
44
Makefile
Normal file
@@ -0,0 +1,44 @@
|
||||
SHELL = bash
|
||||
|
||||
# --- lib ---
|
||||
|
||||
NAME = libasm.a
|
||||
|
||||
OBJ_DIR = obj/
|
||||
SRC_DIR = src/
|
||||
SRC = $(shell find $(SRC_DIR) -name '*.s')
|
||||
OBJ = $(addprefix $(OBJ_DIR), $(SRC:.s=.o))
|
||||
|
||||
AS = nasm
|
||||
ASFLAGS = -f elf64
|
||||
|
||||
# --- tester ---
|
||||
|
||||
t_CC = gcc
|
||||
t_CFLAGS = -z noexecstack
|
||||
t_SRC = src/tests/main.c
|
||||
t_NAME = tester
|
||||
|
||||
all: $(NAME)
|
||||
|
||||
$(NAME): $(OBJ)
|
||||
ar rcs -o $@ $(OBJ)
|
||||
|
||||
$(OBJ_DIR)%.o: %.s
|
||||
@mkdir -p $(@D)
|
||||
$(AS) $(ASFLAGS) $< -o $@
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJ_DIR)
|
||||
|
||||
|
||||
fclean: clean
|
||||
rm $(NAME)
|
||||
|
||||
re: fclean
|
||||
$(MAKE) -s all
|
||||
|
||||
test: $(OBJ)
|
||||
$(t_CC) $(OBJ) $(t_SRC) $(t_CFLAGS) -o $(t_NAME)
|
||||
|
||||
.PHONY: clean fclean all re
|
||||
Reference in New Issue
Block a user