blob: cafc77c292bf6fc4e555a0a2d76bdbacf32ef284 [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
13
14$(warning ################# lynq qser sms demo ROOT: $(ROOT),includedir:$(includedir))
15LOCAL_PATH = .
16
17LOCAL_C_INCLUDES = \
18 -I. \
19 -I$(LOCAL_PATH)/include/ \
20 -I$(ROOT)$(includedir)/logger \
21 -I$(ROOT)$(includedir)/liblog \
22
23LOCAL_LIBS := \
24 -L. \
25 -ldl \
26 -lstdc++ \
27 -lcutils \
28 -lutils \
29 -lpthread \
30 -llynq-log \
31 -llynq-sim \
32
33
34SOURCES = $(wildcard *.cpp)
35
36EXECUTABLE = liblynq-qser-sim.so
37
38OBJECTS=$(SOURCES:.cpp=.o)
39
40
41.PHONY: build clean install pack_rootfs
42all: build
43$(EXECUTABLE): $(OBJECTS)
44 $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
45
46%.o : %.cpp
47 $(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
48
49build: $(EXECUTABLE)
50 $(warning ########## build $(EXECUTABLE) ##########)
51install:
52 mkdir -p $(ROOT)$(base_libdir)/
53 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
54 mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
55pack_rootfs:
56 mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
57 cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
58 $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
59 mkdir -p $(PACK_TO)$(base_libdir)/
60 cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
61 $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
62.PHONY: clean
63clean:
64 $(RM) $(OBJECTS) $(EXECUTABLE)
65 -find . -name "*.o" -delete