|
1 | 1 | 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 |
3 | 15 |
|
4 | 16 | # set this to 1 for debug version
|
5 | 17 | # default debug is disabled
|
@@ -31,6 +43,11 @@ MKDIR := mkdir -p
|
31 | 43 | RM := rm -rf
|
32 | 44 | CP := cp -r
|
33 | 45 | SSEC := *.slow*
|
| 46 | +ifeq ($(detected_OS), Windows) |
| 47 | +PYTHON := python |
| 48 | +else |
| 49 | +PYTHON := python3 |
| 50 | +endif |
34 | 51 |
|
35 | 52 | EXT_C_OBJ := $(patsubst %, %.o, $(EXT_C_SRC))
|
36 | 53 | A_OBJ := $(addprefix $(OUTPUT_PATH)/, $(patsubst $(ROOT)/%, %.o, $(A_SRC)))
|
@@ -131,10 +148,10 @@ all_config:
|
131 | 148 | @$(CC) -E -dM $(DEFS) $(CFLAGS) ./include/config.h | sort | grep "^#define CONFIG_"
|
132 | 149 |
|
133 | 150 | 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 |
135 | 152 |
|
136 | 153 | gen_fip: $(BIN) chip_conf
|
137 |
| - python3 ${ROOT}/scripts/fiptool.py -v genfip \ |
| 154 | + $(PYTHON) ${ROOT}/scripts/fiptool.py -v genfip \ |
138 | 155 | '${OUTPUT_PATH}/fip.bin' \
|
139 | 156 | --MONITOR_RUNADDR="${MONITOR_RUNADDR}" \
|
140 | 157 | --BLCP_2ND_RUNADDR="${BLCP_2ND_RUNADDR}" \
|
|
0 commit comments