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