| BUILD_ROOT = $(shell pwd)/.. |
| include $(BUILD_ROOT)/Make.defines |
| INSTALL_DIR := $(BUILD_ROOT)/../mbtk/rootfs/lib |
| |
| LOCAL_PATH=$(BUILD_ROOT)/libgsw_lib |
| |
| INC_DIR += \ |
| -I$(LOCAL_PATH) |
| |
| LIB_DIR += |
| |
| LIBS += -lmbtk_lib -llog -ldl |
| |
| CFLAGS += -shared -Wl,-shared,-Bsymbolic |
| |
| DEFINE += |
| |
| MY_FILES_PATH:=$(LOCAL_PATH) |
| #ifeq ($(CONFIG_MBTK_QL_SUPPORT),y) |
| #MY_FILES_PATH += $(LOCAL_PATH)/ql |
| #endif |
| |
| #ifeq ($(CONFIG_MBTK_PLATFORM),linux) |
| #MY_FILES_PATH += $(LOCAL_PATH)/platform/linux |
| #endif |
| |
| MY_FILES_SUFFIX:=%.c %.cpp |
| My_All_Files := $(foreach src_path,$(MY_FILES_PATH), $(shell find "$(src_path)" -type f)) |
| MY_SRC_LIST := $(filter $(MY_FILES_SUFFIX),$(My_All_Files)) |
| MY_SRC_LIST := $(MY_SRC_LIST:$(LOCAL_PATH)/%=%) |
| LOCAL_SRC_FILES += $(MY_SRC_LIST) |
| $(info LOCAL_SRC_FILES = $(LOCAL_SRC_FILES)) |
| OBJS = $(patsubst %.c, %.o, $(patsubst %.cpp, %.o, $(LOCAL_SRC_FILES))) |
| $(info OBJS = $(OBJS)) |
| |
| dtarget := $(OUT_DIR)/lib/libgsw_lib.so |
| |
| all: $(dtarget) install |
| |
| $(dtarget): $(OBJS) |
| $(CC) $(CFLAGS) $(LIB_DIR) $(LIBS) $(OBJS) -o $@ |
| |
| install: |
| cp $(dtarget) $(INSTALL_DIR) |
| @echo "Installed $(dtarget) to $(INSTALL_DIR)" |
| |
| %.o:%.c |
| $(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@ |
| |
| %.o:%.cpp |
| $(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@ |
| |
| clean: |
| rm -f $(OBJS) $(dtarget) |
| |