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 |
| 14 | endif |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 15 | |
b.liu | 79884c2 | 2023-09-21 15:10:16 +0800 | [diff] [blame] | 16 | CFLAGS += |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 17 | |
| 18 | DEFINE += |
| 19 | |
| 20 | MY_FILES_PATH:=$(LOCAL_PATH) |
| 21 | #ifeq ($(CONFIG_MBTK_QL_SUPPORT),y) |
| 22 | #MY_FILES_PATH += $(LOCAL_PATH)/ql |
| 23 | #endif |
| 24 | |
| 25 | #ifeq ($(CONFIG_MBTK_PLATFORM),linux) |
| 26 | #MY_FILES_PATH += $(LOCAL_PATH)/platform/linux |
| 27 | #endif |
| 28 | |
b.liu | 1acd338 | 2023-10-11 16:29:12 +0800 | [diff] [blame] | 29 | LOCAL_SRC_FILES = $(wildcard *.c) $(wildcard *.cpp) |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 30 | $(info LOCAL_SRC_FILES = $(LOCAL_SRC_FILES)) |
| 31 | |
b.liu | 510ab71 | 2023-10-11 16:40:04 +0800 | [diff] [blame] | 32 | OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(LOCAL_SRC_FILES))) |
b.liu | 1acd338 | 2023-10-11 16:29:12 +0800 | [diff] [blame] | 33 | BINS = $(patsubst %.o,%,$(OBJS)) |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 34 | |
| 35 | all: $(BINS) |
| 36 | |
b.liu | 1acd338 | 2023-10-11 16:29:12 +0800 | [diff] [blame] | 37 | $(BINS):$(OBJS) |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 38 | @echo " BIN $@" |
b.liu | 1acd338 | 2023-10-11 16:29:12 +0800 | [diff] [blame] | 39 | $(CC) $(CFLAGS) $(LIB_DIR) $(LIBS) $@.o -o $(OUT_DIR)/bin/$@ |
| 40 | |
| 41 | %.o:%.c |
| 42 | $(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@ |
| 43 | |
| 44 | %.o:%.cpp |
| 45 | $(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@ |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 46 | |
| 47 | clean: |
b.liu | dbea304 | 2023-10-11 16:53:14 +0800 | [diff] [blame] | 48 | rm -f $(OBJS) |