bozolib/Makefile
2023-06-28 18:13:25 +02:00

29 lines
466 B
Makefile

CC = gcc
CFLAGS = -Wall -Wextra -Werror -g
NAME = bozolib.a
SRC_DIR = src
OBJ_DIR = obj
SOURCES = $(shell find $(SRC_DIR) -type f -name '*.c')
OBJECTS = $(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.o,$(SOURCES))
DEPS = $(OBJECTS:.o=.d)
all: $(NAME)
$(NAME): $(OBJECTS)
ar -rc $(NAME) $(OBJECTS)
-include $(DEPS)
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
@mkdir -p $(@D)
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -rf $(OBJ_DIR)
fclean: clean
rm -f $(NAME)
re: fclean $(NAME)