build: added XXX-debug option to builds for debug build

This commit is contained in:
Andrew Tridgell 2015-05-18 07:13:07 +10:00
parent db871cc581
commit 5f963cbf82
2 changed files with 5 additions and 1 deletions

View File

@ -3,6 +3,5 @@ TOOLCHAIN = NATIVE
include $(MK_DIR)/find_tools.mk
# Linux build is just the same as SITL for now
OPTFLAGS = -O3
LIBS = -lm -lpthread -lrt
include $(MK_DIR)/board_native.mk

View File

@ -64,6 +64,9 @@ empty: all
# cope with OBC targets
%-obc: EXTRAFLAGS += "-DOBC_FAILSAFE=ENABLED "
# support debug build
%-debug: OPTFLAGS = -g -O0
# cope with -nologging
%-nologging: EXTRAFLAGS += "-DLOGGING_ENABLED=DISABLED "
@ -75,10 +78,12 @@ define frame_template
$(1)-$(2) : EXTRAFLAGS += "-DFRAME_CONFIG=$(shell echo $(2) | tr a-z A-Z | sed s/-/_/g)_FRAME "
$(1)-$(2) : $(1)
$(1)-$(2)-hil : $(1)-$(2)
$(1)-$(2)-debug : $(1)-$(2)
$(1)-$(2)-hilsensors : $(1)-$(2)
$(1)-$(2)-upload : $(1)-$(2)
$(1)-$(2)-upload : $(1)-upload
$(1)-hil : $(1)
$(1)-debug : $(1)
$(1)-hilsensors : $(1)
endef