lichengzhang | 4509130 | 2023-10-08 02:10:34 -0700 | [diff] [blame] | 1 |
|
| 2 | SHELL = /bin/sh
|
| 3 | RM = rm -f
|
| 4 |
|
| 5 | LOCAL_CFLAGS := -Wall \
|
| 6 | -std=gnu++14 \
|
| 7 | -g -Os \
|
| 8 | -flto \
|
| 9 | -fPIC \
|
| 10 | -fpermissive \
|
| 11 |
|
| 12 | ifeq ($(strip $(TARGET_PLATFORM)), T106)
|
| 13 | 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
|
| 14 | endif
|
| 15 | ifeq ($(strip $(TARGET_PLATFORM)), T106)
|
| 16 | LOCAL_CFLAGS += -DMOBILETEK_TARGET_PLATFORM_T106
|
| 17 | LOCAL_CFLAGS += -DLYNQ_SW_INSIDE_VERSION=\"$(LYNQ_CONFIG_VERSION)\"
|
| 18 | LOCAL_CFLAGS += -DLYNQ_SW_VERSION=\"$(LYNQ_CONFIG_SW_VERSION)\"
|
| 19 | endif
|
| 20 | $(warning ################# lynq at common demo ROOT: $(ROOT),includedir:$(includedir))
|
| 21 | LOCAL_PATH = .
|
| 22 |
|
| 23 | LOCAL_C_INCLUDES = \
|
| 24 | -I. \
|
| 25 | -I$(LOCAL_PATH)/include/ \
|
| 26 | -I$(ROOT)$(includedir)/logger \
|
| 27 | -I$(ROOT)$(includedir)/liblog \
|
| 28 |
|
| 29 |
|
| 30 | LOCAL_LIBS := \
|
| 31 | -L. \
|
| 32 | -ldl \
|
| 33 | -lstdc++ \
|
| 34 | -llog \
|
| 35 | -lcutils \
|
| 36 | -lutils \
|
| 37 | -lbinder \
|
| 38 | -lpthread \
|
| 39 | -llynq-log \
|
jb.qi | 539afe4 | 2023-11-23 01:52:18 -0800 | [diff] [blame] | 40 | -llynq-qser-autosuspend \
|
lichengzhang | 4509130 | 2023-10-08 02:10:34 -0700 | [diff] [blame] | 41 |
|
| 42 |
|
| 43 | SOURCES = $(wildcard *.cpp)
|
| 44 |
|
| 45 | EXECUTABLE = liblynq-at-common.so
|
| 46 |
|
| 47 | OBJECTS=$(SOURCES:.cpp=.o)
|
| 48 |
|
| 49 | .PHONY: build clean install pack_rootfs
|
| 50 |
|
| 51 | all: build
|
| 52 | $(EXECUTABLE): $(OBJECTS)
|
| 53 | $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
|
| 54 |
|
| 55 | %.o : %.cpp
|
| 56 | $(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
|
| 57 |
|
| 58 | build: $(EXECUTABLE)
|
| 59 | $(warning ########## build $(EXECUTABLE) ##########)
|
| 60 |
|
| 61 | install:
|
| 62 | mkdir -p $(ROOT)$(base_libdir)/
|
| 63 | install $(EXECUTABLE) $(ROOT)$(base_libdir)/
|
| 64 | mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
|
| 65 |
|
| 66 | pack_rootfs:
|
| 67 | mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
|
| 68 | cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
|
| 69 | $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
|
| 70 | mkdir -p $(PACK_TO)$(base_libdir)/
|
| 71 | cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
|
| 72 | $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
|
| 73 |
|
| 74 | .PHONY: clean
|
| 75 | clean:
|
| 76 | $(RM) $(OBJECTS) $(EXECUTABLE)
|
| 77 | -find . -name "*.o" -delete
|