[Modified] update makefile
This commit is contained in:
31
Makefile
31
Makefile
@@ -7,30 +7,29 @@ submodue-update-init:
|
||||
|
||||
# prepare loongarch toolchain
|
||||
|
||||
TOOLCHAIN_PK := loongarch64-linux-gnu/toolchain-loongarch64-linux-gnu-gcc8-host-x86_64-2022-07-18.tar.xz
|
||||
TOOLCHAIN_URL := https://gitee.com/loongson-edu/la32r-toolchains/releases/download/v0.0.2/loongarch32r-linux-gnusf-2022-05-20-x86.tar.gz
|
||||
LA_GDB_URL := https://gitee.com/loongson-edu/la32r-toolchains/releases/download/v0.0.2/loongarch32r-linux-gnusf-gdb-x86
|
||||
|
||||
LA_PATH := ext/toolchain-loongarch64-linux-gnu-gcc8-host-x86_64-2022-07-18/bin
|
||||
LA_ARCH := loongarch64-linux-gnu-
|
||||
LA := $(LA_PATH)/$(LA_ARCH)
|
||||
TOOLCHAIN_TAR := $(notdir $(TOOLCHAIN_URL))
|
||||
LA_GDB_TAR := $(notdir $(LA_GDB_URL))
|
||||
|
||||
GCC := $(LA)gcc
|
||||
OD := $(LA)objdump
|
||||
OC := $(LA)objcopy
|
||||
RE := $(LA)readelf
|
||||
ext/$(TOOLCHAIN_TAR):
|
||||
wget $(TOOLCHAIN_URL)
|
||||
tar -zxvf $(notdir $@)
|
||||
mv loongarch32r-linux-gnusf-* ext
|
||||
|
||||
LA_TOOLS := $(GCC) $(OD) $(OC) $(RE)
|
||||
lagcc: ext/$(TOOLCHAIN_TAR)
|
||||
|
||||
unpk-gcc: submodue-update-init
|
||||
mkdir -p ext
|
||||
tar -xvf $(TOOLCHAIN_PK) -C ext
|
||||
|
||||
$(LA_TOOLS): unpk-gcc
|
||||
LA_ARCH := loongarch32r-linux-gnusf-
|
||||
|
||||
# prepare loongarch source code
|
||||
|
||||
xv6:
|
||||
TOOLPREFIX=$(CURDIR)/$(LA) $(MAKE) -C lasoft/xv6-la build
|
||||
xv6: lagcc
|
||||
TOOLPREFIX=$(CURDIR)/$(shell find ext -type d -name '$(LA_ARCH)*')/bin/$(LA_ARCH) \
|
||||
$(MAKE) -C lasoft/xv6-la build
|
||||
|
||||
xv6-clean:
|
||||
$(MAKE) -C lasoft/xv6-la clean
|
||||
|
||||
clean-latc:
|
||||
rm -r ext/*
|
||||
|
||||
Reference in New Issue
Block a user