blob: 3f929a2999d405bb17cc4119711889ee6f9125bf [file] [log] [blame]
SHELL = /bin/sh
RM = rm -f
LOCAL_CFLAGS := -Wall \
-std=gnu++14 \
-g -Os \
-flto \
-DRIL_SHLIB \
-DATCI_PARSE \
-DKEEP_ALIVE \
-DECALL_SUPPORT \
-fpermissive \
CFLAGS += -fPIC -O2 $(INCLUDE) -D_LARGEFILE64_SOURCE
$(warning ################# C2K support: $(RAT_CONFIG_C2K_SUPPORT))
ifeq ($(strip $(RAT_CONFIG_C2K_SUPPORT)), yes)
LOCAL_CFLAGS += -DC2K_SUPPORT
endif
ifeq ($(strip $(MTK_MULTI_SIM_SUPPORT)), dsds)
LOCAL_CFLAGS += -DANDROID_SIM_COUNT_2 \
-DANDROID_MULTI_SIM \
-DMODE_DSDS
endif
ifeq ($(strip $(MTK_MULTI_SIM_SUPPORT)), dsss)
LOCAL_CFLAGS += -DMODE_DSSS
endif
$(warning ################# TARGET_PLATFORM: $(TARGET_PLATFORM))
ifeq ($(strip $(TARGET_PLATFORM)), mt2731)
#$(warning #################add for debug $(ROOT), $(includedir))
$(warning ################# TARGET_PLATFORM_MT2731)
LOCAL_CFLAGS += -DTARGET_PLATFORM_MT2731 \
-DMD_93_SUPPORT
else ifeq ($(strip $(TARGET_PLATFORM)), mt2635)
$(warning ################# TARGET_PLATFORM_MT2635)
LOCAL_CFLAGS += -DTARGET_PLATFORM_MT2635 \
-DMD_90_SUPPORT
endif
$(warning ################# RITA ROOT: $(ROOT),includedir:$(includedir))
LOCAL_PATH = .
LOCAL_C_INCLUDES = \
-I. \
-I$(LOCAL_PATH)/../include/liblog \
-I$(ROOT)$(includedir) \
-I$(ROOT)$(includedir)/logger \
LOCAL_LIBS := \
-L. \
-ldl \
-lstdc++ \
-llog \
-lcutils \
-lutils \
-lpower \
-lpal \
-lnandapi \
-lsncfg \
SOURCES = $(wildcard *.c wildcard *.h)
EXECUTABLE = liblynq-log.so
OBJECTS=$(SOURCES:.c=.o)
.PHONY: build clean install pack_rootfs
all: build
$(EXECUTABLE): $(OBJECTS)
$(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(CFLAGS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
%.o : %.c
$(CC) $(LOCAL_C_INCLUDES) $(CFLAGS) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
build: $(EXECUTABLE)
$(warning ########## build $(EXECUTABLE) ##########)
install:
mkdir -p $(ROOT)$(base_libdir)/
install $(EXECUTABLE) $(ROOT)$(base_libdir)/
mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
pack_rootfs:
mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
$(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
mkdir -p $(PACK_TO)$(base_libdir)/
cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
$(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
.PHONY: clean
clean:
$(RM) $(OBJECTS) $(EXECUTABLE)