lh | e6a93fb | 2023-04-10 22:53:27 -0700 | [diff] [blame] | 1 | SHELL = /bin/sh |
| 2 | RM = rm -f |
| 3 | |
| 4 | LOCAL_CFLAGS := -Wall \ |
| 5 | -g -Os \ |
| 6 | -flto \ |
| 7 | -fPIC \ |
| 8 | |
| 9 | $(warning ################# C2K support: $(RAT_CONFIG_C2K_SUPPORT)) |
| 10 | ifeq ($(strip $(RAT_CONFIG_C2K_SUPPORT)), yes) |
| 11 | LOCAL_CFLAGS += -DC2K_SUPPORT |
| 12 | |
| 13 | endif |
| 14 | |
| 15 | ifeq ($(strip $(MTK_MULTI_SIM_SUPPORT)), dsds) |
| 16 | LOCAL_CFLAGS += -DANDROID_SIM_COUNT_2 \ |
| 17 | -DANDROID_MULTI_SIM \ |
| 18 | -DMODE_DSDS |
| 19 | endif |
| 20 | |
| 21 | ifeq ($(strip $(MTK_MULTI_SIM_SUPPORT)), dsss) |
| 22 | LOCAL_CFLAGS += -DMODE_DSSS |
| 23 | endif |
| 24 | |
| 25 | $(warning ################# TARGET_PLATFORM: $(TARGET_PLATFORM)) |
| 26 | ifeq ($(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 |
| 31 | else ifeq ($(strip $(TARGET_PLATFORM)), mt2635) |
| 32 | $(warning ################# TARGET_PLATFORM_MT2635) |
| 33 | LOCAL_CFLAGS += -DTARGET_PLATFORM_MT2635 \ |
| 34 | -DMD_90_SUPPORT |
| 35 | endif |
| 36 | |
| 37 | $(warning ################# RITA ROOT: $(ROOT),includedir:$(includedir)) |
| 38 | LOCAL_PATH = . |
| 39 | |
| 40 | LOCAL_C_INCLUDES = \ |
| 41 | -I. \ |
| 42 | -I$(LOCAL_PATH)/include \ |
| 43 | |
| 44 | |
| 45 | LOCAL_LIBS := \ |
| 46 | -L. \ |
| 47 | -ldl \ |
| 48 | -lpthread \ |
| 49 | -luci \ |
| 50 | |
| 51 | SOURCES = $(wildcard *.c wildcard *.h src/*.c) |
| 52 | |
| 53 | EXECUTABLE = liblynq-uci.so |
| 54 | |
| 55 | OBJECTS=$(SOURCES:.c=.o) |
| 56 | |
| 57 | |
| 58 | .PHONY: build clean install pack_rootfs |
| 59 | |
| 60 | all: 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 | |
| 67 | build: $(EXECUTABLE) |
| 68 | $(warning ########## build $(EXECUTABLE) ##########) |
| 69 | |
| 70 | install: |
| 71 | mkdir -p $(ROOT)$(base_libdir)/ |
| 72 | install $(EXECUTABLE) $(ROOT)$(base_libdir)/ |
| 73 | mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk |
| 74 | |
| 75 | pack_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 |
| 84 | clean: |
| 85 | $(RM) $(OBJECTS) $(EXECUTABLE) |