> compile NEMU

ysyx_22040000 李心杨
Linux calcite 6.1.71 #1-NixOS SMP PREEMPT_DYNAMIC Fri Jan  5 14:18:41 UTC 2024 x86_64 GNU/Linux
 17:24:14  up 2 days  6:19,  2 users,  load average: 0.62, 0.49, 0.56
This commit is contained in:
tracer-ysyx 2024-01-15 17:24:14 +08:00 committed by xinyangli
parent 9362deec51
commit f5cdb499b8
2 changed files with 6 additions and 7 deletions

View file

@ -63,11 +63,10 @@ endif
.PHONY: test
include $(NEMU_HOME)/tests/Makefile
TEST_NAMES = $(notdir $(basename $(TEST_SRCS)))
TEST_OBJS = $(filter-out $(OBJ_DIR)/src/nemu-main.o, $(OBJS))
CFLAGS += $(shell pkg-config --cflags check)
LDFLAGS += $(shell pkg-config --libs check)
$(TEST_NAMES):: $(OBJ_DIR)/tests/%
all-tests: TEST_OBJS = $(filter-out $(OBJ_DIR)/src/nemu-main.o, $(OBJS))
all-tests: CFLAGS += $(shell pkg-config --cflags check)
all-tests: LDFLAGS += $(shell pkg-config --libs check)
all-tests: $(TEST_SRCS:%.c=$(OBJ_DIR)/%)
test: $(addprefix $(OBJ_DIR)/tests/, $(TEST_NAMES))
test: $(addprefix $(OBJ_DIR), $(TEST_NAMES))
@$(OBJ_DIR)/tests/expr_test

View file

@ -1,7 +1,7 @@
TEST_SRCS += tests/expr_test.c
YACC = bison
$(OBJ_DIR)/%: %.c $(TEST_OBJS) app
$(OBJ_DIR)/% %: %.c $(TEST_OBJS) app
@mkdir -p $(dir $@)
@echo + CC $<
@$(CC) $(CFLAGS) -o $@.o -c $<