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