> compile NEMU
221220000 张三 Linux zzy 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux 09:57:21 up 13:56, 2 users, load average: 0.26, 0.21, 0.14
This commit is contained in:
@ -25,12 +25,24 @@ INCLUDES = $(addprefix -I, $(INC_PATH))
|
||||
CFLAGS := -O2 -MMD -Wall -Werror $(INCLUDES) $(CFLAGS)
|
||||
LDFLAGS := -O2 $(LDFLAGS)
|
||||
|
||||
# Define a variable to hold the test macro flag
|
||||
TEST_CFLAGS ?=
|
||||
|
||||
# Check if the user passed the "test any" command
|
||||
ifeq ("$(findstring test,$(MAKECMDGOALS))","test")
|
||||
TEST_CFLAGS += -D$(MAKECMDGOALS:~1)
|
||||
endif
|
||||
|
||||
# Add the test macro flag to the compilation flags
|
||||
CFLAGS += $(TEST_CFLAGS)
|
||||
|
||||
OBJS = $(SRCS:%.c=$(OBJ_DIR)/%.o) $(CXXSRC:%.cc=$(OBJ_DIR)/%.o)
|
||||
|
||||
# Compilation patterns
|
||||
$(OBJ_DIR)/%.o: %.c
|
||||
@echo + CC $<
|
||||
@mkdir -p $(dir $@)
|
||||
@echo + TEST_CFLAGS $(CFLAGS)
|
||||
@$(CC) $(CFLAGS) -c -o $@ $<
|
||||
$(call call_fixdep, $(@:.o=.d), $@)
|
||||
|
||||
|
@ -171,6 +171,10 @@ void sdb_set_batch_mode() {
|
||||
}
|
||||
|
||||
void sdb_mainloop() {
|
||||
#ifdef _TEST_SDB_MAIN_LOOP_
|
||||
Log("_TEST_SDB_MAIN_LOOP_");
|
||||
#endif
|
||||
|
||||
if (is_batch_mode) {
|
||||
cmd_c(NULL);
|
||||
return;
|
||||
|
Reference in New Issue
Block a user