b.liu | 4d51b68 | 2024-04-07 16:31:09 +0800 | [diff] [blame] | 1 | BUILD_ROOT = $(shell pwd)/.. |
| 2 | include $(BUILD_ROOT)/Make.defines |
| 3 | |
b.liu | 9f91db3 | 2025-02-13 11:24:18 +0800 | [diff] [blame] | 4 | #ifeq ($(MBTK_DEV_INFO_VERSION), 2) |
| 5 | #DEFINE = -DMBTK_DEV_INFO_VERSION_2 |
| 6 | #endif |
b.liu | 4d51b68 | 2024-04-07 16:31:09 +0800 | [diff] [blame] | 7 | |
b.liu | b7530d2 | 2025-06-16 19:49:05 +0800 | [diff] [blame] | 8 | #INC_DIR += \ |
| 9 | # -I$(LOCAL_PATH) |
b.liu | 4d51b68 | 2024-04-07 16:31:09 +0800 | [diff] [blame] | 10 | |
| 11 | CC=gcc |
| 12 | |
| 13 | LOCAL_SRC_FILES = $(wildcard *.c) $(wildcard *.cpp) |
| 14 | |
| 15 | $(info LOCAL_SRC_FILES = $(LOCAL_SRC_FILES)) |
| 16 | |
| 17 | OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(LOCAL_SRC_FILES))) |
| 18 | BINS = $(patsubst %.o,%,$(OBJS)) |
| 19 | |
| 20 | all: $(BINS) |
| 21 | |
| 22 | $(BINS):$(OBJS) |
| 23 | @echo " BIN $@" |
b.liu | 472cfaf | 2024-12-19 19:08:19 +0800 | [diff] [blame] | 24 | $(CC) $@.o $(DEFINE) -o $(OUT_DIR)/bin/$@ |
b.liu | 4d51b68 | 2024-04-07 16:31:09 +0800 | [diff] [blame] | 25 | |
| 26 | %.o:%.c |
b.liu | 472cfaf | 2024-12-19 19:08:19 +0800 | [diff] [blame] | 27 | $(CC) $(INC_DIR) $(DEFINE) -c $< -o $@ |
b.liu | 4d51b68 | 2024-04-07 16:31:09 +0800 | [diff] [blame] | 28 | |
| 29 | %.o:%.cpp |
b.liu | 472cfaf | 2024-12-19 19:08:19 +0800 | [diff] [blame] | 30 | $(CC) $(INC_DIR) $(DEFINE) -c $< -o $@ |
b.liu | 4d51b68 | 2024-04-07 16:31:09 +0800 | [diff] [blame] | 31 | |
| 32 | clean: |
| 33 | rm -f $(OBJS) $(BINS) |
| 34 | |