From f62f4aae84a0fcf2ff4093be41553fca553fd99e Mon Sep 17 00:00:00 2001 From: mwachs5 Date: Wed, 17 May 2017 10:57:03 -0700 Subject: Update Makefile and README with how to use precompiled binaries. --- Makefile | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 0e785dd..f561668 100644 --- a/Makefile +++ b/Makefile @@ -103,13 +103,15 @@ tools: riscv-gnu-toolchain openocd toolchain_builddir := $(builddir)/riscv-gnu-toolchain/riscv64-unknown-elf toolchain_prefix := $(toolchain_builddir)/prefix -RISCV_GCC := $(abspath $(toolchain_prefix)/bin/riscv64-unknown-elf-gcc) -RISCV_GXX := $(abspath $(toolchain_prefix)/bin/riscv64-unknown-elf-g++) -RISCV_OBJDUMP := $(abspath $(toolchain_prefix)/bin/riscv64-unknown-elf-objdump) -RISCV_GDB := $(abspath $(toolchain_prefix)/bin/riscv64-unknown-elf-gdb) -RISCV_AR := $(abspath $(toolchain_prefix)/bin/riscv64-unknown-elf-ar) +RISCV_PREFIX ?= $(toolchain_prefix) -PATH := $(abspath $(toolchain_prefix)/bin):$(PATH) +RISCV_GCC := $(abspath $(RISCV_PREFIX)/bin/riscv64-unknown-elf-gcc) +RISCV_GXX := $(abspath $(RISCV_PREFIX)/bin/riscv64-unknown-elf-g++) +RISCV_OBJDUMP := $(abspath $(RISCV_PREFIX)/bin/riscv64-unknown-elf-objdump) +RISCV_GDB := $(abspath $(RISCV_PREFIX)/bin/riscv64-unknown-elf-gdb) +RISCV_AR := $(abspath $(RISCV_PREFIX)/bin/riscv64-unknown-elf-ar) + +PATH := $(abspath $(RISCV_PREFIX)/bin):$(PATH) $(RISCV_GCC) $(RISCV_GXX) $(RISCV_OBJDUMP) $(RISCV_GDB) $(RISCV_AR): $(toolchain_builddir)/install.stamp touch -c $@ @@ -148,7 +150,9 @@ toolchain-clean: # initializing the target. openocd_builddir := $(builddir)/openocd openocd_prefix := $(openocd_builddir)/prefix -RISCV_OPENOCD := $(openocd_prefix)/bin/openocd + +RISCV_OPENOCD_PREFIX ?= $(openocd_prefix) +RISCV_OPENOCD ?= $(RISCV_OPENOCD_PREFIX)/bin/openocd .PHONY: openocd openocd: $(RISCV_OPENOCD) @@ -215,7 +219,7 @@ GDB_UPLOAD_CMDS += -ex "quit" upload: $(RISCV_OPENOCD) $(OPENOCDARGS) & \ - $(RISCV_GDB) $(PROGRAM_DIR)/$(PROGRAM) $(GDB_UPLOAD_ARGS) $(GDB_UPLOAD_CMDS);\ + $(RISCV_GDB) $(PROGRAM_DIR)/$(PROGRAM) $(GDB_UPLOAD_ARGS) $(GDB_UPLOAD_CMDS) && \ echo "Successfully uploaded '$(PROGRAM)' to $(BOARD)." ############################################################# -- cgit v1.2.3 From 05cb35bb1700ce1b93a8502ce2d7e4ca3f22e3fd Mon Sep 17 00:00:00 2001 From: mwachs5 Date: Wed, 17 May 2017 13:42:39 -0700 Subject: rename 'PREFIX' to 'PATH' for more intuitive naming --- Makefile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f561668..0e12777 100644 --- a/Makefile +++ b/Makefile @@ -103,15 +103,15 @@ tools: riscv-gnu-toolchain openocd toolchain_builddir := $(builddir)/riscv-gnu-toolchain/riscv64-unknown-elf toolchain_prefix := $(toolchain_builddir)/prefix -RISCV_PREFIX ?= $(toolchain_prefix) +RISCV_PATH ?= $(toolchain_prefix) -RISCV_GCC := $(abspath $(RISCV_PREFIX)/bin/riscv64-unknown-elf-gcc) -RISCV_GXX := $(abspath $(RISCV_PREFIX)/bin/riscv64-unknown-elf-g++) -RISCV_OBJDUMP := $(abspath $(RISCV_PREFIX)/bin/riscv64-unknown-elf-objdump) -RISCV_GDB := $(abspath $(RISCV_PREFIX)/bin/riscv64-unknown-elf-gdb) -RISCV_AR := $(abspath $(RISCV_PREFIX)/bin/riscv64-unknown-elf-ar) +RISCV_GCC := $(abspath $(RISCV_PATH)/bin/riscv64-unknown-elf-gcc) +RISCV_GXX := $(abspath $(RISCV_PATH)/bin/riscv64-unknown-elf-g++) +RISCV_OBJDUMP := $(abspath $(RISCV_PATH)/bin/riscv64-unknown-elf-objdump) +RISCV_GDB := $(abspath $(RISCV_PATH)/bin/riscv64-unknown-elf-gdb) +RISCV_AR := $(abspath $(RISCV_PATH)/bin/riscv64-unknown-elf-ar) -PATH := $(abspath $(RISCV_PREFIX)/bin):$(PATH) +PATH := $(abspath $(RISCV_PATH)/bin):$(PATH) $(RISCV_GCC) $(RISCV_GXX) $(RISCV_OBJDUMP) $(RISCV_GDB) $(RISCV_AR): $(toolchain_builddir)/install.stamp touch -c $@ @@ -151,8 +151,8 @@ toolchain-clean: openocd_builddir := $(builddir)/openocd openocd_prefix := $(openocd_builddir)/prefix -RISCV_OPENOCD_PREFIX ?= $(openocd_prefix) -RISCV_OPENOCD ?= $(RISCV_OPENOCD_PREFIX)/bin/openocd +RISCV_OPENOCD_PATH ?= $(openocd_prefix) +RISCV_OPENOCD ?= $(RISCV_OPENOCD_PATH)/bin/openocd .PHONY: openocd openocd: $(RISCV_OPENOCD) -- cgit v1.2.3