blob: 28262557200f788519c000882b0a1b6da6ecfe93 [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 \
rita2ecb1282024-03-04 11:09:33 +080025 -I$(ROOT)$(includedir)/libsim \
rita3f2ca902023-06-16 13:36:53 +080026
27LOCAL_LIBS := \
28 -L. \
29 -ldl \
30 -lstdc++ \
31 -lcutils \
32 -lutils \
33 -lpthread \
34 -llynq-log \
35 -llynq-sim \
36
37
38SOURCES = $(wildcard *.cpp)
39
40EXECUTABLE = liblynq-qser-sim.so
41
42OBJECTS=$(SOURCES:.cpp=.o)
43
44
45.PHONY: build clean install pack_rootfs
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) ##########)
55install:
56 mkdir -p $(ROOT)$(base_libdir)/
57 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
58 mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
59pack_rootfs:
60 mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
61 cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
62 $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
63 mkdir -p $(PACK_TO)$(base_libdir)/
64 cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
65 $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
66.PHONY: clean
67clean:
68 $(RM) $(OBJECTS) $(EXECUTABLE)
69 -find . -name "*.o" -delete