Skip to content

Commit 1364c98

Browse files
committed
support running on windows
Signed-off-by: Chen Wang <[email protected]>
1 parent 3b3cf8c commit 1364c98

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

Makefile

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
ROOT := $(shell pwd)
2-
TOOL_PATH := /opt/bm4duo-toolchain
2+
3+
ifeq ($(OS), Windows_NT) # is Windows_NT on XP, 2000, 7, Vista, 10...
4+
detected_OS := Windows
5+
else
6+
detected_OS := $(shell uname) # same as "uname -s"
7+
endif
8+
#$(info -----> ${detected_OS})
9+
10+
ifeq ($(detected_OS), Windows)
11+
TOOL_PATH := D:/C-Sky/CDS/MinGW/riscv64-elf-tools/bin
12+
else
13+
TOOL_PATH := /opt/bm4duo-toolchain
14+
endif
315

416
# set this to 1 for debug version
517
# default debug is disabled
@@ -31,6 +43,11 @@ MKDIR := mkdir -p
3143
RM := rm -rf
3244
CP := cp -r
3345
SSEC := *.slow*
46+
ifeq ($(detected_OS), Windows)
47+
PYTHON := python
48+
else
49+
PYTHON := python3
50+
endif
3451

3552
EXT_C_OBJ := $(patsubst %, %.o, $(EXT_C_SRC))
3653
A_OBJ := $(addprefix $(OUTPUT_PATH)/, $(patsubst $(ROOT)/%, %.o, $(A_SRC)))
@@ -131,10 +148,10 @@ all_config:
131148
@$(CC) -E -dM $(DEFS) $(CFLAGS) ./include/config.h | sort | grep "^#define CONFIG_"
132149

133150
chip_conf:
134-
python3 ${ROOT}/scripts/chip_conf.py ${OUTPUT_PATH}/chip_conf.bin
151+
$(PYTHON) ${ROOT}/scripts/chip_conf.py ${OUTPUT_PATH}/chip_conf.bin
135152

136153
gen_fip: $(BIN) chip_conf
137-
python3 ${ROOT}/scripts/fiptool.py -v genfip \
154+
$(PYTHON) ${ROOT}/scripts/fiptool.py -v genfip \
138155
'${OUTPUT_PATH}/fip.bin' \
139156
--MONITOR_RUNADDR="${MONITOR_RUNADDR}" \
140157
--BLCP_2ND_RUNADDR="${BLCP_2ND_RUNADDR}" \

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#make clean; make release;
1+
#!/bin/bash
22

33
CASES="gpio clock irq pwm rtc rtc_irq wdt adc i2c timer spi dbg"
44

docs/quick_guide.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ Codename: focal
3434

3535
**注意**:如果希望采用 Jtag + gdb 进行调试的话,推荐在 Windows 上运行,比较稳定。此时,我们可以在 Windows 上安装 VirtualBox, 然后在 VirtualBox 中安装 Ubuntu。
3636

37-
下载本仓库,假设下载后的路径为 `$WS/bm4duo`
37+
APT 安装一些依赖的工具
38+
```shell
39+
$ sudo apt update
40+
$ sudo apt install git build-essential python3
41+
```
42+
43+
下载本仓库,假设你的工作路径为 `$WS`, 且下载本仓库的路径为 `$WS/bm4duo`
3844

3945
```shell
4046
$ cd $WS

0 commit comments

Comments
 (0)