l.yang | 7d7b51c | 2023-08-04 17:02:48 +0800 | [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 |
|
| 12 |
|
| 13 | ifeq ($(strip $(TARGET_PLATFORM)), T106)
|
| 14 | 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
|
| 15 | endif
|
| 16 |
|
| 17 |
|
| 18 | $(warning ################# rock ROOT: $(ROOT),includedir:$(includedir),)
|
| 19 |
|
| 20 | LOCAL_PATH = .
|
| 21 |
|
| 22 | LOCAL_C_INCLUDES = \
|
| 23 | -I. \
|
| 24 | -I$(LOCAL_PATH)/include \
|
| 25 | -I$(ROOT)$(includedir)/logger \
|
| 26 | -I$(ROOT)$(includedir)/liblog \
|
| 27 | -I$(ROOT)$(includedir)/glib-2.0 \
|
| 28 | -I$(ROOT)$(libdir)/glib-2.0/include \
|
| 29 | -I$(ROOT)$(includedir) \
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 | LOCAL_LIBS := \
|
| 34 | -L. \
|
| 35 | -ldl \
|
| 36 | -lstdc++ \
|
| 37 | -llynq-log \
|
| 38 | -lupi_ab \
|
| 39 | -lcrypto \
|
| 40 | -lnvram \
|
xf.li | ce87319 | 2023-11-08 17:10:35 -0800 | [diff] [blame] | 41 | -lflags \
|
xf.li | 7ccf837 | 2024-03-07 00:08:02 -0800 | [diff] [blame^] | 42 | -lzxiclzma \
|
l.yang | 7d7b51c | 2023-08-04 17:02:48 +0800 | [diff] [blame] | 43 |
|
| 44 |
|
| 45 | SOURCES = $(wildcard *.cpp)
|
| 46 |
|
| 47 | EXECUTABLE = liblynq-fota.so
|
| 48 |
|
| 49 | OBJECTS=$(SOURCES:.cpp=.o)
|
| 50 |
|
| 51 |
|
| 52 | .PHONY: build clean install pack_rootfs
|
| 53 |
|
| 54 | all: build
|
| 55 | $(EXECUTABLE): $(OBJECTS)
|
| 56 | $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
|
| 57 |
|
| 58 | %.o : %.cpp
|
| 59 | $(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
|
| 60 |
|
| 61 | build: $(EXECUTABLE)
|
| 62 | $(warning ########## build $(EXECUTABLE) ##########)
|
| 63 |
|
| 64 | install:
|
| 65 | mkdir -p $(ROOT)$(base_libdir)/
|
| 66 | install $(EXECUTABLE) $(ROOT)$(base_libdir)/
|
| 67 | mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
|
| 68 |
|
| 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)
|