include ./../../../linux.mk
L := $(notdir $(realpath $(CURDIR)/..))
M := liblog
O := $(LIB_REL)/$(M).a
S := $(SRC_ROOT_DIR)/$(L)/liblog/src
I := -I$(SRC_ROOT_DIR)/$(L)/liblog/inc
B := $(CURDIR)/$(M)/obj
SRCS := $(wildcard $(S)/*.c)
OBJS := $(patsubst $(S)/%.c,$(B)/%.o,$(SRCS))
F := $(C_FLAGS) $(I) -I$(SRC_ROOT_DIR)/public/libfunc/inc
all:
	@mkdir -p $(ROOT_DIR)/release/inc
	@$(MAKE) $(O)
$(O): $(OBJS)
	@mkdir -p $(dir $@)
	$(AR) rcs $@ $^
	@echo "[$(M)] built"
$(B)/%.o: $(S)/%.c
	@mkdir -p $(dir $@)
	$(CC) $(F) -c $< -o $@
clean:
	rm -rf $(B) $(O)
rebuild: clean all
.PHONY: all clean rebuild
