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)/test |
| 5 | |
b.liu | 79884c2 | 2023-09-21 15:10:16 +0800 | [diff] [blame] | 6 | INC_DIR += |
| 7 | |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 8 | LIB_DIR += |
| 9 | |
b.liu | 3403c93 | 2023-10-10 16:26:35 +0800 | [diff] [blame] | 10 | LIBS += -lmbtk_lib -lql_lib -llynq_lib -lmbtk_mqtt_lib -laudio-apu -lcutils -ltinyalsa -lacm -lubus -lubox |
| 11 | |
| 12 | ifeq ($(BUILD_PLATFORM), asr1803) |
| 13 | LIBS += -lpolarssl |
b.liu | 1c1c721 | 2023-12-22 16:35:27 +0800 | [diff] [blame^] | 14 | else |
| 15 | LIBS += -lmbtk_audio_lib |
b.liu | 3403c93 | 2023-10-10 16:26:35 +0800 | [diff] [blame] | 16 | endif |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 17 | |
b.liu | 79884c2 | 2023-09-21 15:10:16 +0800 | [diff] [blame] | 18 | CFLAGS += |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 19 | |
| 20 | DEFINE += |
| 21 | |
| 22 | MY_FILES_PATH:=$(LOCAL_PATH) |
| 23 | #ifeq ($(CONFIG_MBTK_QL_SUPPORT),y) |
| 24 | #MY_FILES_PATH += $(LOCAL_PATH)/ql |
| 25 | #endif |
| 26 | |
| 27 | #ifeq ($(CONFIG_MBTK_PLATFORM),linux) |
| 28 | #MY_FILES_PATH += $(LOCAL_PATH)/platform/linux |
| 29 | #endif |
| 30 | |
b.liu | 1acd338 | 2023-10-11 16:29:12 +0800 | [diff] [blame] | 31 | LOCAL_SRC_FILES = $(wildcard *.c) $(wildcard *.cpp) |
b.liu | 1c1c721 | 2023-12-22 16:35:27 +0800 | [diff] [blame^] | 32 | ifeq ($(BUILD_PLATFORM), asr1803) |
| 33 | LOCAL_SRC_FILES += $(wildcard asr1803/*.c) $(wildcard asr1803/*.cpp) |
| 34 | else |
| 35 | LOCAL_SRC_FILES += $(wildcard asr1806/*.c) $(wildcard asr1806/*.cpp) |
| 36 | endif |
| 37 | |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 38 | $(info LOCAL_SRC_FILES = $(LOCAL_SRC_FILES)) |
| 39 | |
b.liu | 510ab71 | 2023-10-11 16:40:04 +0800 | [diff] [blame] | 40 | OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(LOCAL_SRC_FILES))) |
b.liu | 1acd338 | 2023-10-11 16:29:12 +0800 | [diff] [blame] | 41 | BINS = $(patsubst %.o,%,$(OBJS)) |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 42 | |
| 43 | all: $(BINS) |
| 44 | |
b.liu | 1acd338 | 2023-10-11 16:29:12 +0800 | [diff] [blame] | 45 | $(BINS):$(OBJS) |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 46 | @echo " BIN $@" |
b.liu | 1acd338 | 2023-10-11 16:29:12 +0800 | [diff] [blame] | 47 | $(CC) $(CFLAGS) $(LIB_DIR) $(LIBS) $@.o -o $(OUT_DIR)/bin/$@ |
b.liu | 1c1c721 | 2023-12-22 16:35:27 +0800 | [diff] [blame^] | 48 | |
b.liu | 1acd338 | 2023-10-11 16:29:12 +0800 | [diff] [blame] | 49 | %.o:%.c |
| 50 | $(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@ |
b.liu | 1c1c721 | 2023-12-22 16:35:27 +0800 | [diff] [blame^] | 51 | |
b.liu | 1acd338 | 2023-10-11 16:29:12 +0800 | [diff] [blame] | 52 | %.o:%.cpp |
| 53 | $(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@ |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 54 | |
| 55 | clean: |
b.liu | dbea304 | 2023-10-11 16:53:14 +0800 | [diff] [blame] | 56 | rm -f $(OBJS) |