liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 1 | ROOT = $(shell pwd)/../.. |
| 2 | include ../Make.defines |
| 3 | |
| 4 | LOCAL_PATH=$(BUILD_ROOT)/lynq_lib |
| 5 | |
| 6 | INC_DIR += |
b.liu | 5fa9e77 | 2023-11-23 18:00:55 +0800 | [diff] [blame] | 7 | |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 8 | LIB_DIR += |
| 9 | |
b.liu | 2fd2998 | 2024-01-03 16:52:49 +0800 | [diff] [blame^] | 10 | LIBS += -llog -lmbtk_lib |
| 11 | ifeq ($(BUILD_PLATFORM), asr1806) |
| 12 | LIBS += -lmbtk_audio_lib |
| 13 | endif |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 14 | |
| 15 | CFLAGS += -shared -Wl,-shared,-Bsymbolic |
| 16 | |
| 17 | DEFINE += |
| 18 | |
| 19 | MY_FILES_PATH:=$(LOCAL_PATH)/src |
| 20 | #ifeq ($(CONFIG_MBTK_QL_SUPPORT),y) |
| 21 | #MY_FILES_PATH += $(LOCAL_PATH)/ql |
| 22 | #endif |
| 23 | |
| 24 | #ifeq ($(CONFIG_MBTK_PLATFORM),linux) |
| 25 | #MY_FILES_PATH += $(LOCAL_PATH)/platform/linux |
| 26 | #endif |
| 27 | |
b.liu | 2fd2998 | 2024-01-03 16:52:49 +0800 | [diff] [blame^] | 28 | #LOCAL_SRC_FILES = $(wildcard src/*.c) $(wildcard src/*.cpp) |
| 29 | LOCAL_SRC_FILES = src/lynq_adc.c \ |
| 30 | src/lynq_alarm.c \ |
| 31 | src/lynq_data_call.c \ |
| 32 | src/lynq_fota.c \ |
| 33 | src/lynq_gnss.c \ |
| 34 | src/lynq_gpio.c \ |
| 35 | src/lynq_irq.c \ |
| 36 | src/lynq_log.c \ |
| 37 | src/lynq_net_light.c \ |
| 38 | src/lynq_network.c \ |
| 39 | src/lynq_sim.c \ |
| 40 | src/lynq_sleep.c \ |
| 41 | src/lynq_sms.c \ |
| 42 | src/lynq_time.c \ |
| 43 | src/lynq_voice_call.c |
| 44 | |
| 45 | ifeq ($(BUILD_PLATFORM), asr1806) |
| 46 | LOCAL_SRC_FILES += src/lynq_audio.c |
| 47 | endif |
| 48 | |
b.liu | 1acd338 | 2023-10-11 16:29:12 +0800 | [diff] [blame] | 49 | OBJS = $(patsubst %.c, %.o, $(patsubst %.cpp, %.o, $(LOCAL_SRC_FILES))) |
| 50 | $(info OBJS = $(OBJS)) |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 51 | |
| 52 | dtarget := $(OUT_DIR)/lib/liblynq_lib.so |
| 53 | |
| 54 | all: $(dtarget) |
| 55 | |
b.liu | 1acd338 | 2023-10-11 16:29:12 +0800 | [diff] [blame] | 56 | $(dtarget): $(OBJS) |
| 57 | $(CC) $(CFLAGS) $(LIB_DIR) $(LIBS) $(OBJS) -o $@ |
| 58 | |
| 59 | %.o:%.c |
| 60 | $(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@ |
b.liu | 5fa9e77 | 2023-11-23 18:00:55 +0800 | [diff] [blame] | 61 | |
b.liu | 1acd338 | 2023-10-11 16:29:12 +0800 | [diff] [blame] | 62 | %.o:%.cpp |
| 63 | $(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@ |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 64 | |
| 65 | clean: |
b.liu | 1acd338 | 2023-10-11 16:29:12 +0800 | [diff] [blame] | 66 | rm -f $(OBJS) $(dtarget) |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 67 | |