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