blob: 171052a35480988d47149ebd70a3e42d9a583dbd [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
20$(warning ################# lynq sim ROOT: $(ROOT),includedir:$(includedir))
21LOCAL_PATH = .
22
23LOCAL_C_INCLUDES = \
24 -I. \
25 -I$(LOCAL_PATH)/include \
rita2ecb1282024-03-04 11:09:33 +080026 -I$(LOCAL_PATH)/include/libsim \
ritaef2512f2023-05-19 16:40:44 +080027 -I$(ROOT)$(includedir)/vendor-ril \
28 -I$(ROOT)$(includedir)/logger \
29 -I$(ROOT)$(includedir)/liblog \
30 -I$(ROOT)$(includedir)/lynq_shm \
31
32
33LOCAL_LIBS := \
34 -L. \
35 -ldl \
36 -lstdc++ \
37 -llog \
38 -lcutils \
39 -lutils \
40 -lbinder \
41 -lpthread \
42 -llynq-log \
43 -llynq-shm \
44
rita2ecb1282024-03-04 11:09:33 +080045SOURCES = $(wildcard *.cpp)
ritaef2512f2023-05-19 16:40:44 +080046
47EXECUTABLE = liblynq-sim.so
48
49OBJECTS=$(SOURCES:.cpp=.o)
50
51
52.PHONY: build clean install pack_rootfs
53
54all: 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
61build: $(EXECUTABLE)
62 $(warning ########## build $(EXECUTABLE) ##########)
63
64install:
65 mkdir -p $(ROOT)$(base_libdir)/
66 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
67 mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
68pack_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
76.PHONY: clean
77clean:
78 $(RM) $(OBJECTS) $(EXECUTABLE)
79 -find . -name "*.o" -delete