rjw | 1f88458 | 2022-01-06 17:20:42 +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 \ |
| 8 | -DRIL_SHLIB \ |
| 9 | -DATCI_PARSE \ |
| 10 | -DKEEP_ALIVE \ |
| 11 | -DECALL_SUPPORT \ |
| 12 | -fpermissive \ |
| 13 | |
| 14 | $(warning ################# C2K support: $(RAT_CONFIG_C2K_SUPPORT)) |
| 15 | ifeq ($(strip $(RAT_CONFIG_C2K_SUPPORT)), yes) |
| 16 | LOCAL_CFLAGS += -DC2K_SUPPORT |
| 17 | |
| 18 | endif |
| 19 | |
| 20 | ifeq ($(strip $(MTK_MULTI_SIM_SUPPORT)), dsds) |
| 21 | LOCAL_CFLAGS += -DANDROID_SIM_COUNT_2 \ |
| 22 | -DANDROID_MULTI_SIM \ |
| 23 | -DMODE_DSDS |
| 24 | endif |
| 25 | |
| 26 | ifeq ($(strip $(MTK_MULTI_SIM_SUPPORT)), dsss) |
| 27 | LOCAL_CFLAGS += -DMODE_DSSS |
| 28 | endif |
| 29 | |
| 30 | $(warning ################# TARGET_PLATFORM: $(TARGET_PLATFORM)) |
| 31 | ifeq ($(strip $(TARGET_PLATFORM)), mt2731) |
| 32 | #$(warning #################add for debug $(ROOT), $(includedir)) |
| 33 | $(warning ################# TARGET_PLATFORM_MT2731) |
| 34 | LOCAL_CFLAGS += -DTARGET_PLATFORM_MT2731 \ |
| 35 | -DMD_93_SUPPORT |
| 36 | else ifeq ($(strip $(TARGET_PLATFORM)), mt2635) |
| 37 | $(warning ################# TARGET_PLATFORM_MT2635) |
| 38 | LOCAL_CFLAGS += -DTARGET_PLATFORM_MT2635 \ |
| 39 | -DMD_90_SUPPORT |
| 40 | endif |
| 41 | |
| 42 | $(warning ################# RITA ROOT: $(ROOT),includedir:$(includedir)) |
| 43 | LOCAL_PATH = . |
| 44 | |
| 45 | LOCAL_C_INCLUDES = \ |
| 46 | -I. \ |
| 47 | -I$(ROOT)$(includedir)/openssl \ |
| 48 | -I$(ROOT)$(includedir)/liblog \ |
| 49 | -I$(LOCAL_PATH)/include \ |
| 50 | |
| 51 | |
| 52 | LOCAL_LIBS := \ |
| 53 | -L. \ |
| 54 | -ldl \ |
| 55 | -lpthread \ |
| 56 | -llynq-log \ |
| 57 | -lssl \ |
| 58 | -lcrypto \ |
| 59 | -lmosquitto \ |
| 60 | |
| 61 | SOURCES = $(wildcard *.c wildcard *.h ftp/*.c http/src/*.c lynq_mqtt/*.c) |
| 62 | |
| 63 | EXECUTABLE = liblynq-protcl.so |
| 64 | |
| 65 | OBJECTS=$(SOURCES:.c=.o) |
| 66 | |
| 67 | |
| 68 | .PHONY: build clean install pack_rootfs |
| 69 | |
| 70 | all: build |
| 71 | $(EXECUTABLE): $(OBJECTS) |
| 72 | $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@ |
| 73 | |
| 74 | %.o : %.c |
| 75 | $(CC) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $< |
| 76 | |
| 77 | build: $(EXECUTABLE) |
| 78 | $(warning ########## build $(EXECUTABLE) ##########) |
| 79 | |
| 80 | install: |
| 81 | mkdir -p $(ROOT)$(base_libdir)/ |
| 82 | install $(EXECUTABLE) $(ROOT)$(base_libdir)/ |
| 83 | mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk |
| 84 | |
| 85 | pack_rootfs: |
| 86 | mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/ |
| 87 | cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/ |
| 88 | $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE) |
| 89 | mkdir -p $(PACK_TO)$(base_libdir)/ |
| 90 | cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/ |
| 91 | $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE) |
| 92 | .PHONY: clean |
| 93 | clean: |
| 94 | $(RM) $(OBJECTS) $(EXECUTABLE) |