diff --git a/nemu/tests/Makefile b/nemu/tests/Makefile index a43b7cf..3cd68a6 100644 --- a/nemu/tests/Makefile +++ b/nemu/tests/Makefile @@ -1,9 +1,5 @@ TEST_SRCS += tests/expr_test.c -$(OBJ_DIR)/tests/%.o: tests/%.c +$(OBJ_DIR)/%: %.c $(OBJS) @echo + CC $< - @$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(CFLGAS) - -$(OBJ_DIR)/tests/%: $(OBJ_DIR)/test/%.o $(OBJS) - @echo + LD $< - @$(LD) -e test_main -o $@ $^ $(LDFLAGS) $(CFLGAS) + @$(CC) $(CFLAGS) -Wl,-e,test_main -o $@ $^ $(LIBS) $(LDFLAGS) $(CFLGAS)