diff options
Diffstat (limited to 'app/Makefile')
-rw-r--r-- | app/Makefile | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/app/Makefile b/app/Makefile index 08febc7..f2dd0fc 100644 --- a/app/Makefile +++ b/app/Makefile @@ -20,20 +20,24 @@ CPROTO=cproto PROG=kvm + V=1 default: ${PROG}.elf -CSRCS=dfu.c mouse.c keyboard.c main.c usb.c tablet.c usart.c kvm.c ring.c +CSRCS=dfu.c mouse.c keyboard.c main.c usb.c tablet.c usart.c kvm.c ring.c led.c BINARY = ${PROG} OBJS = ${CSRCS:%.c=%.o} -${PROG}.dfu:${PROG}.elf - ${OBJCOPY} -Obinary $< $@ +include ../Makefile.include + +DID=$(shell printf '\#include "id.h"\nID_PRODUCT' | ${CC} -I.. -E - | grep -v ^\# ) + +INCLUDES += -I.. dfu:${PROG}.dfu - dfu-util -R -a 0 -d 1d6b:0ee3 -s 0x08002000:leave -D $< + dfu-util -R -a 0 -d 1d6b:${DID} -s 0x08002000:leave -D $< program: ${PROG}.elf echo halt | nc -t localhost 4444 @@ -45,4 +49,3 @@ protos: ${CPROTO} $(INCLUDES) $(DEFINES) -e -v ${CSRCS} > prototypes.h.tmp mv -f prototypes.h.tmp prototypes.h -include ../Makefile.include |