Add `debug.adc` and option DEBUG
The GNAT configuration file `debug.adc` has Assertion_Policy Debug
enabled to compile `pragma Debug` code. If `DEBUG` is set to `1`
during build, `debug.adc` is used instead of the default `gnat.adc`.
Change-Id: If5b52f5251cae7deed7aca2765f9b5db1c148fb7
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20558
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/Makefile b/Makefile
index 91ef025..09881e5 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
DESTDIR ?= dest
name ?= hw
-hw-install = Makefile Makefile.proof gnat.adc spark.adc
+hw-install = Makefile Makefile.proof debug.adc gnat.adc spark.adc
top := $(CURDIR)
cnf := .config
@@ -34,6 +34,12 @@
include $(libhw-dir)/Makefile.proof
+ifeq ($(DEBUG),1)
+gnat-adc = $(libhw-dir)/debug.adc
+else
+gnat-adc = $(libhw-dir)/gnat.adc
+endif
+
CC = $(CROSS_COMPILE)gcc
GNATBIND = $(CROSS_COMPILE)gnatbind
@@ -43,7 +49,7 @@
CFLAGS += -fno-common -fomit-frame-pointer
CFLAGS += -ffunction-sections -fdata-sections
-ADAFLAGS += $(CFLAGS) -gnatA -gnatec=$(libhw-dir)/gnat.adc -gnatp
+ADAFLAGS += $(CFLAGS) -gnatA -gnatec=$(gnat-adc) -gnatp
# Ada warning options:
#
# a Activate most optional warnings.