2017-05-21 23:22:51 +08:00
|
|
|
include $(AM_HOME)/Makefile.check
|
2019-03-08 00:03:53 +08:00
|
|
|
$(info # Building lib-$(NAME) [$(ARCH)])
|
2017-05-21 23:22:51 +08:00
|
|
|
|
|
|
|
LIB_DIR ?= $(shell pwd)
|
|
|
|
INC_DIR += $(LIB_DIR)/include/
|
|
|
|
DST_DIR ?= $(LIB_DIR)/build/$(ARCH)/
|
|
|
|
ARCHIVE ?= $(LIB_DIR)/build/$(NAME)-$(ARCH).a
|
|
|
|
|
2019-06-14 03:04:24 +08:00
|
|
|
## Default: Build a linkable archive (.a)
|
2019-03-21 17:32:08 +08:00
|
|
|
default: $(ARCHIVE)
|
2017-08-12 15:57:19 +08:00
|
|
|
|
2017-05-29 17:05:36 +08:00
|
|
|
INC_DIR += $(addsuffix /include/, $(addprefix $(AM_HOME)/libs/, $(LIBS)))
|
2019-03-22 00:32:08 +08:00
|
|
|
CFLAGS += -fdata-sections -ffunction-sections -fno-builtin
|
2017-05-21 23:22:51 +08:00
|
|
|
|
2019-06-14 03:04:24 +08:00
|
|
|
## Paste in "Makefile.compile" here
|
2017-05-21 23:22:51 +08:00
|
|
|
include $(AM_HOME)/Makefile.compile
|
|
|
|
|
2019-06-14 03:04:24 +08:00
|
|
|
## Compliation rule for objects -> .a (using ar)
|
2017-08-12 15:57:19 +08:00
|
|
|
$(ARCHIVE): $(OBJS)
|
2019-02-18 11:36:17 +08:00
|
|
|
@echo + AR "->" $(shell realpath $@ --relative-to .)
|
2017-08-12 15:58:53 +08:00
|
|
|
@ar rcs $(ARCHIVE) $(OBJS)
|
2017-05-21 23:22:51 +08:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(LIB_DIR)/build/
|
2019-03-22 00:32:08 +08:00
|
|
|
|
|
|
|
.PHONY: default clean
|