From aa2cb1d59c971ad593ada22ce167379efcd818f6 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Tue, 20 Dec 2016 16:08:47 -0800 Subject: Default to freedom-e300-hifive1 And parameterize the help message on the default options. --- Makefile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 272ca15..ab02199 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,9 @@ srcdir := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) srcdir := $(srcdir:/=) wrkdir := $(CURDIR)/work +DEFAULT_BOARD := freedom-e300-hifive1 +DEFAULT_PROGRAM := demo_gpio + ############################################################# # Prints help message ############################################################# @@ -14,20 +17,20 @@ help : @echo " tools:" @echo " Install compilation & debugging tools" @echo "" - @echo " software [PROGRAM=demo_gpio BOARD=freedom-e300-arty]:" + @echo " software [PROGRAM=$(DEFAULT_PROGRAM) BOARD=$(DEFAULT_BOARD)]:" @echo " Build a software program to load with the" @echo " debugger." @echo "" - @echo " run_debug [PROGRAM=demo_gpio BOARD=freedom-e300-arty]:" + @echo " run_debug [PROGRAM=$(DEFAULT_PROGRAM) BOARD=$(DEFAULT_BOARD)]:" @echo " Launch OpenOCD & GDB to load or debug " @echo " running programs." @echo "" - @echo " upload [PROGRAM=demo_gpio BOARD=freedom-e300-arty]:" + @echo " upload [PROGRAM=$(DEFAULT_PROGRAM) BOARD=$(DEFAULT_BOARD)]:" @echo " Launch OpenOCD to flash your program to the" @echo " on-board Flash" @echo "" - @echo " run_openocd [BOARD=freedom-e300-arty]:" - @echo " run_gdb [PROGRAM=demo_gpio BOARD=freedom-e300-arty]:" + @echo " run_openocd [BOARD=$(DEFAULT_BOARD)]:" + @echo " run_gdb [PROGRAM=$(DEFAULT_PROGRAM) BOARD=$(DEFAULT_BOARD)]:" @echo " Launch OpenOCD or GDB seperately" @echo "" @echo " For more information, visit dev.sifive.com" @@ -80,8 +83,8 @@ uninstall: ############################################################# # This Section is for Software Compilation ############################################################# -BOARD ?= freedom-e300-arty -PROGRAM ?= demo_gpio +BOARD ?= $(DEFAULT_BOARD) +PROGRAM ?= $(DEFAULT_PROGRAM) PROGRAM_DIR = $(srcdir)/software/$(PROGRAM) PROGRAM_ELF = $(srcdir)/software/$(PROGRAM)/$(PROGRAM) -- cgit v1.2.3