blob: 228b1bcad475b84a3d38a61fc6b0a49b68ba924c [file] [log] [blame]
SHELL = /bin/sh
RM = rm -f
LOCAL_CFLAGS := -Wall \
-std=gnu++14 \
-g -Os \
-flto \
-fPIC \
-fpermissive \
ifeq ($(strip $(TARGET_PLATFORM)), T106)
LOCAL_CFLAGS += -DBINDER_IPC_32BIT=1 -DHAVE_ENDIAN_H -DHAVE_PTHREADS -DHAVE_SYS_UIO_H -DHAVE_POSIX_FILEMAP -DHAVE_STRLCPY -DHAVE_PRCTL -DHAVE_MEMSET16 -DHAVE_MEMSET32 -DANDROID_SMP=0
endif
ifeq ($(strip $(MOBILETEK_GNSS_TYPE)), HD)
LOCAL_CFLAGS += -DHD_GNSS
else ifeq ($(strip $(MOBILETEK_GNSS_TYPE)), HX)
LOCAL_CFLAGS += -DHX_GNSS
endif
$(warning lynq qser gnss demo ROOT = $(ROOT), includedir = $(includedir))
LOCAL_PATH = .
LOCAL_C_INCLUDES = \
-I. \
-I$(LOCAL_PATH)/include/ \
-I$(ROOT)$(includedir)/logger \
-I$(ROOT)$(includedir)/liblog \
-I$(ROOT)$(includedir)/libxml2 \
-I$(ROOT)$(includedir)\
LOCAL_LIBS := \
-L. \
-lstdc++ \
-llog \
-lcutils \
-lutils \
-lpthread \
-llynq-log \
-lxml2 \
-llynq-uci \
-lsctel \
-lscrtc \
-lbsp \
-lnvram \
SOURCES = $(wildcard *.c wildcard *.h src/*.cpp)
EXECUTABLE = liblynq-qser-gnss.so
OBJECTS=$(SOURCES:.cpp=.o)
.PHONY: build clean install pack_rootfs
all: build
$(EXECUTABLE): $(OBJECTS)
$(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
%.o : %.cpp
$(CXX) $(LOCAL_C_INCLUDES) $(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)
-find . -name "*.o" -delete