lichengzhang | 29fc2fa | 2023-08-02 23:20:48 -0700 | [diff] [blame] | 1 | SHELL = /bin/sh
|
| 2 | RM = rm -f
|
| 3 |
|
| 4 | LOCAL_CFLAGS := -Wall \
|
| 5 | -std=gnu++14 \
|
| 6 | -g -Os \
|
| 7 | -flto \
|
| 8 | -fPIC \
|
| 9 | -fpermissive \
|
| 10 |
|
| 11 | ifeq ($(strip $(TARGET_PLATFORM)), T106)
|
| 12 | 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
|
| 13 | endif
|
lichengzhang | f492f9d | 2024-02-22 14:53:41 +0800 | [diff] [blame] | 14 |
|
| 15 | ifeq ($(strip $(MOBILETEK_GNSS_TYPE)), HD)
|
| 16 | LOCAL_CFLAGS += -DHD_GNSS
|
| 17 | else ifeq ($(strip $(MOBILETEK_GNSS_TYPE)), HX)
|
| 18 | LOCAL_CFLAGS += -DHX_GNSS
|
| 19 | endif
|
| 20 |
|
sj.zhang | 5ad9331 | 2023-10-13 03:08:29 -0700 | [diff] [blame] | 21 | $(warning lynq qser gnss demo ROOT = $(ROOT), includedir = $(includedir))
|
lichengzhang | 29fc2fa | 2023-08-02 23:20:48 -0700 | [diff] [blame] | 22 | LOCAL_PATH = .
|
| 23 |
|
| 24 | LOCAL_C_INCLUDES = \
|
| 25 | -I. \
|
| 26 | -I$(LOCAL_PATH)/include/ \
|
| 27 | -I$(ROOT)$(includedir)/logger \
|
| 28 | -I$(ROOT)$(includedir)/liblog \
|
| 29 | -I$(ROOT)$(includedir)/libxml2 \
|
sj.zhang | 5ad9331 | 2023-10-13 03:08:29 -0700 | [diff] [blame] | 30 | -I$(ROOT)$(includedir)\
|
lichengzhang | 29fc2fa | 2023-08-02 23:20:48 -0700 | [diff] [blame] | 31 |
|
| 32 |
|
| 33 | LOCAL_LIBS := \
|
| 34 | -L. \
|
| 35 | -lstdc++ \
|
sj.zhang | 5ad9331 | 2023-10-13 03:08:29 -0700 | [diff] [blame] | 36 | -llog \
|
lichengzhang | 29fc2fa | 2023-08-02 23:20:48 -0700 | [diff] [blame] | 37 | -lcutils \
|
| 38 | -lutils \
|
| 39 | -lpthread \
|
| 40 | -llynq-log \
|
| 41 | -lxml2 \
|
sj.zhang | d578813 | 2023-10-10 03:23:17 -0700 | [diff] [blame] | 42 | -llynq-uci \
|
sj.zhang | 5ad9331 | 2023-10-13 03:08:29 -0700 | [diff] [blame] | 43 | -lsctel \
|
lichengzhang | 645d365 | 2023-10-18 01:48:04 -0700 | [diff] [blame] | 44 | -lbsp \
|
xy.he | 75a6794 | 2023-12-07 00:02:40 -0800 | [diff] [blame] | 45 | -lnvram \
|
lichengzhang | 29fc2fa | 2023-08-02 23:20:48 -0700 | [diff] [blame] | 46 |
|
| 47 |
|
| 48 | SOURCES = $(wildcard *.c wildcard *.h src/*.cpp)
|
| 49 |
|
| 50 | EXECUTABLE = liblynq-qser-gnss.so
|
| 51 |
|
| 52 | OBJECTS=$(SOURCES:.cpp=.o)
|
| 53 |
|
| 54 |
|
| 55 | .PHONY: build clean install pack_rootfs
|
| 56 | all: build
|
| 57 | $(EXECUTABLE): $(OBJECTS)
|
| 58 | $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
|
| 59 |
|
| 60 | %.o : %.cpp
|
| 61 | $(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
|
| 62 |
|
| 63 | build: $(EXECUTABLE)
|
| 64 | $(warning ########## build $(EXECUTABLE) ##########)
|
| 65 | install:
|
| 66 | mkdir -p $(ROOT)$(base_libdir)/
|
| 67 | install $(EXECUTABLE) $(ROOT)$(base_libdir)/
|
| 68 | mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
|
| 69 | pack_rootfs:
|
| 70 | mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
|
| 71 | cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
|
| 72 | $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
|
| 73 | mkdir -p $(PACK_TO)$(base_libdir)/
|
| 74 | cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
|
| 75 | $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
|
| 76 | .PHONY: clean
|
| 77 | clean:
|
| 78 | $(RM) $(OBJECTS) $(EXECUTABLE)
|
| 79 | -find . -name "*.o" -delete
|