blob: 5e40ec5f83488d48fb25c0274ae12f8cb7ac782c [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)
17LOCAL_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
18endif
19
20$(warning ################# lynq sim ROOT: $(ROOT),includedir:$(includedir))
21LOCAL_PATH = .
22
23LOCAL_C_INCLUDES = \
24 -I. \
25 -I$(LOCAL_PATH)/include \
26 -I$(ROOT)$(includedir)/vendor-ril \
27 -I$(ROOT)$(includedir)/logger \
28 -I$(ROOT)$(includedir)/liblog \
29 -I$(ROOT)$(includedir)/lynq_shm \
30
31
32LOCAL_LIBS := \
33 -L. \
34 -ldl \
35 -lstdc++ \
36 -llog \
37 -lcutils \
38 -lutils \
39 -lbinder \
40 -lpthread \
41 -llynq-log \
42 -llynq-shm \
43
44SOURCES = $(wildcard *.c wildcard *.h src/*.cpp)
45
46EXECUTABLE = liblynq-sim.so
47
48OBJECTS=$(SOURCES:.cpp=.o)
49
50
51.PHONY: build clean install pack_rootfs
52
53all: 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
60build: $(EXECUTABLE)
61 $(warning ########## build $(EXECUTABLE) ##########)
62
63install:
64 mkdir -p $(ROOT)$(base_libdir)/
65 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
66 mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
67pack_rootfs:
68 mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
69 cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
70 $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
71 mkdir -p $(PACK_TO)$(base_libdir)/
72 cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
73 $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
74
75.PHONY: clean
76clean:
77 $(RM) $(OBJECTS) $(EXECUTABLE)
78 -find . -name "*.o" -delete