34 lines
491 B
Makefile
34 lines
491 B
Makefile
|
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
|