blob: 3f9f7576d26b70829cbfe037dad6e9603690b643 [file] [log] [blame]
llbd9cc172022-12-30 16:36:18 +08001
2SHELL = /bin/sh
3RM = rm -f
4
5LOCAL_CFLAGS := -Wall \
6 -std=gnu++14 \
7 -g -Os \
8 -flto \
9 -DRIL_SHLIB \
10 -DATCI_PARSE \
11 -fPIC \
12 -DKEEP_ALIVE \
13 -DECALL_SUPPORT \
14 -fpermissive \
15
16$(warning ################# lynq at factory demo ROOT: $(ROOT),includedir:$(includedir))
17LOCAL_PATH = .
18
19LOCAL_C_INCLUDES = \
20 -I. \
21 -I$(LOCAL_PATH)/include/libat \
22 -I$(ROOT)$(includedir)/logger \
23 -I$(ROOT)$(includedir)/liblog \
24 -I$(ROOT)$(includedir)/vendor-ril \
25
26
27LOCAL_LIBS := \
28 -L. \
29 -ldl \
30 -lstdc++ \
31 -llog \
32 -lcutils \
33 -lutils \
34 -lbinder \
35 -lpthread \
36
37
38SOURCES = $(wildcard *.cpp)
39
40EXECUTABLE = liblynq-at-common.so
41
42OBJECTS=$(SOURCES:.cpp=.o)
43
44.PHONY: build clean install pack_rootfs
45
46all: build
47$(EXECUTABLE): $(OBJECTS)
48 $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
49
50%.o : %.cpp
51 $(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
52
53build: $(EXECUTABLE)
54 $(warning ########## build $(EXECUTABLE) ##########)
55
56install:
57 mkdir -p $(ROOT)$(base_libdir)/
58 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
59 mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
60
61pack_rootfs:
62 mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
63 cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
64 $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
65 mkdir -p $(PACK_TO)$(base_libdir)/
66 cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
67 $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
68
69.PHONY: clean
70clean:
71 $(RM) $(OBJECTS) $(EXECUTABLE)
72 -find . -name "*.o" -delete