Makefile: Allow the debug build

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
diff --git a/Makefile b/Makefile
index feed19b..d912813 100644
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,7 @@
 	@echo
 	@echo "Run 'make setup' to setup Rust to build libtock-rs."
 	@echo "Run 'make <board>' to build libtock-rs for that board"
+	@echo "    Set the DEBUG flag to enable the debug build"
 	@echo "    Set the FEATURES flag to enable features"
 	@echo "Run 'make flash-<board> EXAMPLE=<>' to flash EXAMPLE to that board"
 	@echo "Run 'make test' to test any local changes you have made"
@@ -25,6 +26,10 @@
 	features=--features=$(FEATURES)
 endif
 
+ifndef DEBUG
+	release=--release
+endif
+
 .PHONY: setup
 setup:
 	rustup target add thumbv7em-none-eabi
@@ -48,43 +53,43 @@
 
 .PHONY: hail
 hail:
-	PLATFORM=hail cargo build --release --target=thumbv7em-none-eabi --examples $(features)
+	PLATFORM=hail cargo build $(release) --target=thumbv7em-none-eabi --examples $(features)
 
 .PHONY: flash-hail
 flash-hail:
-	PLATFORM=hail cargo run --release --target=thumbv7em-none-eabi --example $(EXAMPLE) $(features)
+	PLATFORM=hail cargo run $(release) --target=thumbv7em-none-eabi --example $(EXAMPLE) $(features)
 
 .PHONY: nrf52840
 nrf52840:
-	PLATFORM=nrf52840 cargo build --release --target=thumbv7em-none-eabi --examples $(features)
+	PLATFORM=nrf52840 cargo build $(release) --target=thumbv7em-none-eabi --examples $(features)
 
 .PHONY: flash-nrf52840
 flash-nrf52840:
-	PLATFORM=nrf52840 cargo run --release --target=thumbv7em-none-eabi --example $(EXAMPLE) $(features)
+	PLATFORM=nrf52840 cargo run $(release) --target=thumbv7em-none-eabi --example $(EXAMPLE) $(features)
 
 .PHONY: opentitan
 opentitan:
-	PLATFORM=opentitan cargo build --release --target=riscv32imc-unknown-none-elf --examples $(features)
+	PLATFORM=opentitan cargo build $(release) --target=riscv32imc-unknown-none-elf --examples $(features)
 
 .PHONY: flash-opentitan
 flash-opentitan:
-	PLATFORM=opentitan cargo run --release --target=riscv32imac-unknown-none-elf --example $(EXAMPLE) $(features)
+	PLATFORM=opentitan cargo run $(release) --target=riscv32imac-unknown-none-elf --example $(EXAMPLE) $(features)
 
 .PHONY: hifive1
 hifive1:
-	PLATFORM=hifive1 cargo build --release --target=riscv32imac-unknown-none-elf --examples $(features)
+	PLATFORM=hifive1 cargo build $(release) --target=riscv32imac-unknown-none-elf --examples $(features)
 
 .PHONY: flash-hifive1
 flash-hifive1:
-	PLATFORM=hifive1 cargo run --release --target=riscv32imac-unknown-none-elf --example $(EXAMPLE) $(features)
+	PLATFORM=hifive1 cargo run $(release) --target=riscv32imac-unknown-none-elf --example $(EXAMPLE) $(features)
 
 .PHONY: nrf52
 nrf52:
-	PLATFORM=nrf52 cargo build --release --target=thumbv7em-none-eabi --examples $(features)
+	PLATFORM=nrf52 cargo build $(release) --target=thumbv7em-none-eabi --examples $(features)
 
 .PHONY: flash-nrf52
 flash-nrf52:
-	PLATFORM=nrf52 cargo run --release --target=thumbv7em-none-eabi --example $(EXAMPLE) $(features)
+	PLATFORM=nrf52 cargo run $(release) --target=thumbv7em-none-eabi --example $(EXAMPLE) $(features)
 
 .PHONY: clean
 clean: