sj.zhang | 47c326a | 2023-08-22 15:28:52 +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 | 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
|
| 14 |
|
| 15 | ifeq ($(strip $(TARGET_PLATFORM)), T106)
|
| 16 | LOCAL_CFLAGS += -DMOBILETEK_TARGET_PLATFORM_T106
|
| 17 | endif
|
| 18 |
|
| 19 | LOCAL_CFLAGS += $(CFLAGS)
|
| 20 | $(warning ################# rock ROOT: $(ROOT),includedir:$(includedir),)
|
| 21 |
|
| 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) \
|
| 30 |
|
| 31 |
|
| 32 | LOCAL_LIBS := \
|
| 33 | -L. \
|
| 34 | -ldl \
|
| 35 | -lstdc++ \
|
| 36 | -lpthread \
|
| 37 | -lsctel \
|
xf.li | 7ccf837 | 2024-03-07 00:08:02 -0800 | [diff] [blame^] | 38 | -lscrtc \
|
sj.zhang | 47c326a | 2023-08-22 15:28:52 +0800 | [diff] [blame] | 39 | -llynq-uci \
|
sj.zhang | fdb20be | 2023-08-23 10:02:53 +0800 | [diff] [blame] | 40 | -llynq-log \
|
xy.he | 75a6794 | 2023-12-07 00:02:40 -0800 | [diff] [blame] | 41 | -lnvram \
|
xy.he | 5859d89 | 2024-01-04 00:33:36 -0800 | [diff] [blame] | 42 | -lscipc \
|
sj.zhang | 47c326a | 2023-08-22 15:28:52 +0800 | [diff] [blame] | 43 |
|
| 44 |
|
| 45 | SOURCES = $(wildcard *.cpp)
|
| 46 |
|
| 47 | EXECUTABLE = liblynq-systime.so
|
| 48 |
|
| 49 | OBJECTS=$(SOURCES:.cpp=.o)
|
| 50 |
|
| 51 | .PHONY: build clean install pack_rootfs
|
| 52 |
|
| 53 | all: build
|
| 54 | $(EXECUTABLE): $(OBJECTS)
|
| 55 | $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
|
| 56 |
|
| 57 | %.o : %.cpp
|
| 58 | $(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
|
| 59 |
|
| 60 | build: $(EXECUTABLE)
|
| 61 | $(warning ########## build $(EXECUTABLE) ##########)
|
| 62 |
|
| 63 | install:
|
| 64 | mkdir -p $(ROOT)$(base_libdir)/
|
| 65 | install $(EXECUTABLE) $(ROOT)$(base_libdir)/
|
| 66 | mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
|
| 67 |
|
| 68 | pack_rootfs:
|
| 69 | mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
|
| 70 | cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
|
| 71 | $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
|
| 72 | mkdir -p $(PACK_TO)$(base_libdir)/
|
| 73 | cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
|
| 74 | $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
|
| 75 | .PHONY: clean
|
| 76 | clean:
|
| 77 | $(RM) $(OBJECTS) $(EXECUTABLE)
|
| 78 |
|