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 | 1acd338 | 2023-10-11 16:29:12 +0800 | [diff] [blame^] | 32 | # *.cc 文件需要手动添加才会编译 |
| 33 | ifeq ($(BUILD_PLATFORM), asr1803) |
| 34 | LOCAL_SRC_FILES += polarssl_demo.cc |
| 35 | endif |
| 36 | |
| 37 | OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(patsubst %.cc,%.o,$(LOCAL_SRC_FILES)))) |
| 38 | BINS = $(patsubst %.o,%,$(OBJS)) |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 39 | |
| 40 | all: $(BINS) |
| 41 | |
b.liu | 1acd338 | 2023-10-11 16:29:12 +0800 | [diff] [blame^] | 42 | $(BINS):$(OBJS) |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 43 | @echo " BIN $@" |
b.liu | 1acd338 | 2023-10-11 16:29:12 +0800 | [diff] [blame^] | 44 | $(CC) $(CFLAGS) $(LIB_DIR) $(LIBS) $@.o -o $(OUT_DIR)/bin/$@ |
| 45 | |
| 46 | %.o:%.c |
| 47 | $(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@ |
| 48 | |
| 49 | %.o:%.cpp |
| 50 | $(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@ |
| 51 | |
| 52 | %.o:%.cc |
| 53 | $(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@ |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 54 | |
| 55 | clean: |