blob: 9e6c72b83d58c33ce23122faa6752e989b8c698a [file] [log] [blame]
b.liu4d51b682024-04-07 16:31:09 +08001BUILD_ROOT = $(shell pwd)/..
2include $(BUILD_ROOT)/Make.defines
3
b.liu9f91db32025-02-13 11:24:18 +08004#ifeq ($(MBTK_DEV_INFO_VERSION), 2)
5#DEFINE = -DMBTK_DEV_INFO_VERSION_2
6#endif
b.liu4d51b682024-04-07 16:31:09 +08007
b.liub7530d22025-06-16 19:49:05 +08008#INC_DIR += \
9# -I$(LOCAL_PATH)
b.liu4d51b682024-04-07 16:31:09 +080010
11CC=gcc
12
13LOCAL_SRC_FILES = $(wildcard *.c) $(wildcard *.cpp)
14
15$(info LOCAL_SRC_FILES = $(LOCAL_SRC_FILES))
16
17OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(LOCAL_SRC_FILES)))
18BINS = $(patsubst %.o,%,$(OBJS))
19
20all: $(BINS)
21
22$(BINS):$(OBJS)
23 @echo " BIN $@"
b.liu472cfaf2024-12-19 19:08:19 +080024 $(CC) $@.o $(DEFINE) -o $(OUT_DIR)/bin/$@
b.liu4d51b682024-04-07 16:31:09 +080025
26%.o:%.c
b.liu472cfaf2024-12-19 19:08:19 +080027 $(CC) $(INC_DIR) $(DEFINE) -c $< -o $@
b.liu4d51b682024-04-07 16:31:09 +080028
29%.o:%.cpp
b.liu472cfaf2024-12-19 19:08:19 +080030 $(CC) $(INC_DIR) $(DEFINE) -c $< -o $@
b.liu4d51b682024-04-07 16:31:09 +080031
32clean:
33 rm -f $(OBJS) $(BINS)
34