42_KFS_LIB/Makefile

34 lines
491 B
Makefile
Raw Normal View History

2024-09-06 18:56:56 -04:00
SRCDIR = src
OBJDIR = obj
BUILDDIR = build
SRC := $(wildcard $(SRCDIR)/**/*.c)
OBJ := $(patsubst $(SRCDIR)/%.c,$(OBJDIR)/%.o,$(SRC))
CC = gcc
CFLAGS = -iquoteheaders -c
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