blob: 209bf036717ad1edbf5c9e45fe98551a0623ee5e [file] [log] [blame]
lhe6a93fb2023-04-10 22:53:27 -07001SHELL = /bin/sh
2RM = rm -f
3
4LOCAL_CFLAGS := -Wall \
5 -g -Os \
6 -flto \
7 -fPIC \
8
9$(warning ################# C2K support: $(RAT_CONFIG_C2K_SUPPORT))
10ifeq ($(strip $(RAT_CONFIG_C2K_SUPPORT)), yes)
11 LOCAL_CFLAGS += -DC2K_SUPPORT
12
13endif
14
15ifeq ($(strip $(MTK_MULTI_SIM_SUPPORT)), dsds)
16 LOCAL_CFLAGS += -DANDROID_SIM_COUNT_2 \
17 -DANDROID_MULTI_SIM \
18 -DMODE_DSDS
19endif
20
21ifeq ($(strip $(MTK_MULTI_SIM_SUPPORT)), dsss)
22 LOCAL_CFLAGS += -DMODE_DSSS
23endif
24
25$(warning ################# TARGET_PLATFORM: $(TARGET_PLATFORM))
26ifeq ($(strip $(TARGET_PLATFORM)), mt2731)
27#$(warning #################add for debug $(ROOT), $(includedir))
28$(warning ################# TARGET_PLATFORM_MT2731)
29 LOCAL_CFLAGS += -DTARGET_PLATFORM_MT2731 \
30 -DMD_93_SUPPORT
31else ifeq ($(strip $(TARGET_PLATFORM)), mt2635)
32$(warning ################# TARGET_PLATFORM_MT2635)
33 LOCAL_CFLAGS += -DTARGET_PLATFORM_MT2635 \
34 -DMD_90_SUPPORT
35endif
36
37$(warning ################# RITA ROOT: $(ROOT),includedir:$(includedir))
38LOCAL_PATH = .
39
40LOCAL_C_INCLUDES = \
41 -I. \
42 -I$(LOCAL_PATH)/include \
43
44
45LOCAL_LIBS := \
46 -L. \
47 -ldl \
48 -lpthread \
49 -luci \
50
51SOURCES = $(wildcard *.c wildcard *.h src/*.c)
52
53EXECUTABLE = liblynq-uci.so
54
55OBJECTS=$(SOURCES:.c=.o)
56
57
58.PHONY: build clean install pack_rootfs
59
60all: build
61$(EXECUTABLE): $(OBJECTS)
62 $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
63
64%.o : %.c
65 $(CC) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
66
67build: $(EXECUTABLE)
68 $(warning ########## build $(EXECUTABLE) ##########)
69
70install:
71 mkdir -p $(ROOT)$(base_libdir)/
72 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
73 mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
74
75pack_rootfs:
76 mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
77 cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
78 $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
79 mkdir -p $(PACK_TO)$(base_libdir)/
80 cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
81 $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
82
83.PHONY: clean
84clean:
85 $(RM) $(OBJECTS) $(EXECUTABLE)