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 \
|
| 40 |
|
| 41 |
|
| 42 | SOURCES = $(wildcard *.cpp)
|
| 43 |
|
| 44 | EXECUTABLE = liblynq-at-common.so
|
| 45 |
|
| 46 | OBJECTS=$(SOURCES:.cpp=.o)
|
| 47 |
|
| 48 | .PHONY: build clean install pack_rootfs
|
| 49 |
|
| 50 | all: build
|
| 51 | $(EXECUTABLE): $(OBJECTS)
|
| 52 | $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
|
| 53 |
|
| 54 | %.o : %.cpp
|
| 55 | $(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
|
| 56 |
|
| 57 | build: $(EXECUTABLE)
|
| 58 | $(warning ########## build $(EXECUTABLE) ##########)
|
| 59 |
|
| 60 | install:
|
| 61 | mkdir -p $(ROOT)$(base_libdir)/
|
| 62 | install $(EXECUTABLE) $(ROOT)$(base_libdir)/
|
| 63 | mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
|
| 64 |
|
| 65 | pack_rootfs:
|
| 66 | mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
|
| 67 | cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
|
| 68 | $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
|
| 69 | mkdir -p $(PACK_TO)$(base_libdir)/
|
| 70 | cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
|
| 71 | $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
|
| 72 |
|
| 73 | .PHONY: clean
|
| 74 | clean:
|
| 75 | $(RM) $(OBJECTS) $(EXECUTABLE)
|
| 76 | -find . -name "*.o" -delete
|