42_KFS_LIB/Makefile

35 lines
552 B
Makefile
Raw Normal View History

2024-09-06 18:56:56 -04:00
SRCDIR = src
OBJDIR = obj
BUILDDIR = build
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
2024-09-07 08:32:48 -04:00
.PHONY: clean fclean test all re