2024-09-06 18:56:56 -04:00
|
|
|
SRCDIR = src
|
|
|
|
OBJDIR = obj
|
|
|
|
BUILDDIR = build
|
|
|
|
|
2024-09-07 08:17:08 -04:00
|
|
|
SRC := $(shell find $(SRCDIR) -name '*.c')
|
2024-09-06 18:56:56 -04:00
|
|
|
OBJ := $(patsubst $(SRCDIR)/%.c,$(OBJDIR)/%.o,$(SRC))
|
|
|
|
|
2024-09-06 19:44:17 -04:00
|
|
|
CC = i386-elf-gcc
|
|
|
|
CFLAGS = -std=gnu99 -ffreestanding -O2 -Wall -Wextra -iquoteheaders -c
|
2024-09-06 18:56:56 -04:00
|
|
|
|
|
|
|
AR = ar
|
|
|
|
ARFLAGS =
|
|
|
|
|
|
|
|
NAME = libbozo.a
|
|
|
|
|
|
|
|
$(OBJDIR)/%.o: $(SRCDIR)/%.c
|
|
|
|
mkdir -p $(dir $@)
|
|
|
|
$(CC) $(CFLAGS) $< -o $@
|
|
|
|
|
|
|
|
all : $(NAME)
|
|
|
|
|
|
|
|
clean :
|
|
|
|
rm -rf $(OBJDIR)
|
|
|
|
|
|
|
|
fclean : clean
|
|
|
|
rm -rf $(BUILDDIR)
|
|
|
|
|
|
|
|
$(NAME) : $(OBJ)
|
|
|
|
mkdir -p $(BUILDDIR)
|
|
|
|
$(AR) -rc $(BUILDDIR)/$(NAME) $(OBJ)
|
|
|
|
|
|
|
|
re: fclean all
|
|
|
|
|
|
|
|
.PHONY: clean fclean test all re
|