Project

General

Profile

Revision 1518

Added by Brad Neuman over 14 years ago

updated library to add DRAGONFLY_DEBUG stuff
Can now call make debug which will recompile the library with debug flags!

View differences:

Makefile
40 40
# make program = Download the hex file to the device, using avrdude.
41 41
#                Please customize the avrdude settings below first!
42 42
#
43
# make debug = Start either simulavr or avarice as specified for debugging,
43
# make avrdebug = Start either simulavr or avarice as specified for debugging,
44 44
#              with avr-gdb or avr-insight as the front end for debugging.
45 45
#
46
# make debug = recompile the library with debug flags
47
#
46 48
# make library = Build the library, then make software
47 49
#
48 50
# make filename.s = Just compile filename.c into the assembler code only.
......
92 94
#     Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
93 95
#     AVR Studio 4.10 requires dwarf-2.
94 96
#     AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
95
DEBUG =
97
AVRDEBUG =
96 98

  
97 99
# Compiler flag to set the C Standard level.
98 100
#     c89   = "ANSI" C
......
124 126
#  -Wa,...:      tell GCC to pass this to the assembler.
125 127
#    -adhlns...: create assembler listing
126 128
CFLAGS =
127
# CFLAGS = -g$(DEBUG)
129
# CFLAGS = -g$(AVRDEBUG)
128 130
CFLAGS += $(CDEFS) $(CINCS)
129 131
CFLAGS += -O$(OPT)
130 132
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
......
315 317

  
316 318
# Combine all necessary flags and optional flags.
317 319
# Add target processor to flags.
318
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
320
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS) $(GLOBAL_CFLAGS)
319 321
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
320 322

  
321 323

  
......
378 380
	$(AVRMEM) 2>/dev/null; echo; fi
379 381

  
380 382

  
383
# debug flags
384
debug: ALL_CFLAGS += -DDRAGONFLY_DEBUG
385
debug: test debug_library  build  checksize 
381 386

  
387
test:
388
	echo "$(ALL_CFLAGS)"
389

  
390

  
391
# Build the library
392
debug_library:
393
	@echo $(MSG_LIBRARY_BUILD)
394
	make clean -C $(COLONYROOT)/code/projects/libdragonfly
395
	make debug_dist -C $(COLONYROOT)/code/projects/libdragonfly
396
	make clean -C $(COLONYROOT)/code/projects/libwireless/lib
397
	make dist -C $(COLONYROOT)/code/projects/libwireless/lib
398

  
382 399
# Display compiler version information.
383 400
gccversion :
384 401
	@$(CC) --version
385
  
386
  
402

  
403

  
387 404
# Build the library
388 405
library:
389 406
	@echo $(MSG_LIBRARY_BUILD)
......
419 436
endif
420 437
	@echo break main >> $(GDBINIT_FILE)
421 438

  
422
debug: gdb-config $(TARGET).elf
439
avrdebug: gdb-config $(TARGET).elf
423 440
ifeq ($(DEBUG_BACKEND), avarice)
424 441
	@echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
425 442
	@$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \

Also available in: Unified diff