blob: 0eafd49be1d6ec73d3b25d8892459ec4c3b10e06 [file] [log] [blame]
ritaef2512f2023-05-19 16:40:44 +08001SHELL = /bin/sh
2RM = rm -f
3
4LOCAL_CFLAGS := -Wall \
5 -std=c++11 \
6 -g -Os \
7 -flto \
8 -DRIL_SHLIB \
9 -DATCI_PARSE \
10 -fPIC \
11 -DKEEP_ALIVE \
12 -DECALL_SUPPORT \
13 -fpermissive \
14
15
16ifeq ($(strip $(TARGET_PLATFORM)), T106)
xy.hebdd03692023-12-01 23:30:30 -080017LOCAL_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 -DMOBILETEK_TARGET_PLATFORM_T106 -Wl,-Bsymbolic
ritaef2512f2023-05-19 16:40:44 +080018endif
19
jb.qi30f0d452024-02-26 23:25:59 -080020ifeq ($(strip $(TARGET_PLATFORM)), T106)
21 LOCAL_CFLAGS += -DMOBILETEK_TARGET_PLATFORM_T106
22endif
23
ritaef2512f2023-05-19 16:40:44 +080024$(warning ################# lynq sim ROOT: $(ROOT),includedir:$(includedir))
25LOCAL_PATH = .
26
27LOCAL_C_INCLUDES = \
28 -I. \
29 -I$(LOCAL_PATH)/include \
30 -I$(ROOT)$(includedir)/vendor-ril \
31 -I$(ROOT)$(includedir)/logger \
32 -I$(ROOT)$(includedir)/liblog \
33 -I$(ROOT)$(includedir)/lynq_shm \
34
35
36LOCAL_LIBS := \
37 -L. \
38 -ldl \
39 -lstdc++ \
40 -llog \
41 -lcutils \
42 -lutils \
43 -lbinder \
44 -lpthread \
45 -llynq-log \
46 -llynq-shm \
47
48SOURCES = $(wildcard *.c wildcard *.h src/*.cpp)
49
50EXECUTABLE = liblynq-sim.so
51
52OBJECTS=$(SOURCES:.cpp=.o)
53
54
55.PHONY: build clean install pack_rootfs
56
57all: build
58$(EXECUTABLE): $(OBJECTS)
59 $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
60
61%.o : %.cpp
62 $(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
63
64build: $(EXECUTABLE)
65 $(warning ########## build $(EXECUTABLE) ##########)
66
67install:
68 mkdir -p $(ROOT)$(base_libdir)/
69 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
70 mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
71pack_rootfs:
72 mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
73 cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
74 $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
75 mkdir -p $(PACK_TO)$(base_libdir)/
76 cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
77 $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
78
79.PHONY: clean
80clean:
81 $(RM) $(OBJECTS) $(EXECUTABLE)
82 -find . -name "*.o" -delete