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 | 2974e4a | 2024-02-21 00:14:24 -0800 | [diff] [blame] | 15 | ifeq ($(strip $(MOBILETEK_RIL_CFG)), GSW) |
| 16 | LOCAL_CFLAGS += -DGSW_RIL_CFG |
| 17 | endif |
lh | 328e7ed | 2022-01-20 03:12:06 -0800 | [diff] [blame] | 18 | |
ll | 7683a72 | 2023-01-19 11:14:23 +0800 | [diff] [blame] | 19 | $(warning ################# lynq data demo ROOT: $(ROOT),includedir:$(includedir)) |
lh | 328e7ed | 2022-01-20 03:12:06 -0800 | [diff] [blame] | 20 | LOCAL_PATH = . |
| 21 | |
| 22 | LOCAL_C_INCLUDES = \ |
| 23 | -I. \ |
| 24 | -I$(LOCAL_PATH)/include/libsms \ |
ll | 7683a72 | 2023-01-19 11:14:23 +0800 | [diff] [blame] | 25 | -I$(ROOT)$(includedir)/logger \ |
lh | 328e7ed | 2022-01-20 03:12:06 -0800 | [diff] [blame] | 26 | -I$(ROOT)$(includedir)/liblog \ |
ll | 7683a72 | 2023-01-19 11:14:23 +0800 | [diff] [blame] | 27 | -I$(ROOT)$(includedir)/vendor-ril \ |
| 28 | -I$(ROOT)$(includedir)/lynq_shm \ |
lh | 328e7ed | 2022-01-20 03:12:06 -0800 | [diff] [blame] | 29 | |
| 30 | |
| 31 | LOCAL_LIBS := \ |
| 32 | -L. \ |
| 33 | -ldl \ |
ll | 7683a72 | 2023-01-19 11:14:23 +0800 | [diff] [blame] | 34 | -lstdc++ \ |
| 35 | -llog \ |
lh | 328e7ed | 2022-01-20 03:12:06 -0800 | [diff] [blame] | 36 | -lcutils \ |
ll | 7683a72 | 2023-01-19 11:14:23 +0800 | [diff] [blame] | 37 | -lutils \ |
| 38 | -lbinder \ |
| 39 | -lpthread \ |
lh | 328e7ed | 2022-01-20 03:12:06 -0800 | [diff] [blame] | 40 | -llynq-log \ |
ll | 7683a72 | 2023-01-19 11:14:23 +0800 | [diff] [blame] | 41 | -llynq-shm \ |
lh | 328e7ed | 2022-01-20 03:12:06 -0800 | [diff] [blame] | 42 | |
ll | 7683a72 | 2023-01-19 11:14:23 +0800 | [diff] [blame] | 43 | SOURCES = $(wildcard *.cpp) |
lh | 328e7ed | 2022-01-20 03:12:06 -0800 | [diff] [blame] | 44 | |
| 45 | EXECUTABLE = liblynq-sms.so |
| 46 | |
ll | 7683a72 | 2023-01-19 11:14:23 +0800 | [diff] [blame] | 47 | OBJECTS=$(SOURCES:.cpp=.o) |
lh | 328e7ed | 2022-01-20 03:12:06 -0800 | [diff] [blame] | 48 | |
| 49 | |
| 50 | .PHONY: build clean install pack_rootfs |
lh | 328e7ed | 2022-01-20 03:12:06 -0800 | [diff] [blame] | 51 | all: build |
| 52 | $(EXECUTABLE): $(OBJECTS) |
| 53 | $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@ |
| 54 | |
ll | 7683a72 | 2023-01-19 11:14:23 +0800 | [diff] [blame] | 55 | %.o : %.cpp |
| 56 | $(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $< |
lh | 328e7ed | 2022-01-20 03:12:06 -0800 | [diff] [blame] | 57 | |
| 58 | build: $(EXECUTABLE) |
| 59 | $(warning ########## build $(EXECUTABLE) ##########) |
lh | 328e7ed | 2022-01-20 03:12:06 -0800 | [diff] [blame] | 60 | install: |
| 61 | mkdir -p $(ROOT)$(base_libdir)/ |
| 62 | install $(EXECUTABLE) $(ROOT)$(base_libdir)/ |
ll | 7683a72 | 2023-01-19 11:14:23 +0800 | [diff] [blame] | 63 | mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk |
lh | 328e7ed | 2022-01-20 03:12:06 -0800 | [diff] [blame] | 64 | pack_rootfs: |
| 65 | mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/ |
| 66 | cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/ |
| 67 | $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE) |
| 68 | mkdir -p $(PACK_TO)$(base_libdir)/ |
| 69 | cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/ |
| 70 | $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE) |
lh | 328e7ed | 2022-01-20 03:12:06 -0800 | [diff] [blame] | 71 | .PHONY: clean |
| 72 | clean: |
| 73 | $(RM) $(OBJECTS) $(EXECUTABLE) |
ll | 7683a72 | 2023-01-19 11:14:23 +0800 | [diff] [blame] | 74 | -find . -name "*.o" -delete |