Add in new invalid event hook check targets to project makefiles to produce compilati...
[pub/USBasp.git] / Demos / Host / Incomplete / BluetoothHost / makefile
index e16fd40..0195542 100644 (file)
@@ -466,7 +466,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -509,14 +509,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -533,16 +536,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -697,9 +721,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -717,8 +741,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file