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