From 7346cfaad4d969db060f3c7ae242ea93f4fff5c0 Mon Sep 17 00:00:00 2001 From: VG Date: Wed, 26 Aug 2015 18:45:01 +0200 Subject: first commit --- boo-stanby-watcher/Makefile | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 boo-stanby-watcher/Makefile (limited to 'boo-stanby-watcher/Makefile') diff --git a/boo-stanby-watcher/Makefile b/boo-stanby-watcher/Makefile new file mode 100644 index 0000000..2646d03 --- /dev/null +++ b/boo-stanby-watcher/Makefile @@ -0,0 +1,39 @@ +DEVICE = attiny25 +CLOCK = 1000000 +FUSES = -U lfuse:w:0x62:m -U hfuse:w:0xdd:m + +PROGRAMMER = avrdude +PROGRAMMER += -c buspirate +PROGRAMMER += -P /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A400XJSH-if00-port0 +PROGRAMMER += -p $(DEVICE) -B 4 + +DEFS = -DF_CPU=$(CLOCK)UL +CFLAGS = -Wall -Werror -pedantic -std=c99 +CFLAGS += -O2 -funsigned-bitfields -fpack-struct -fshort-enums +CFLAGS += -mmcu=$(DEVICE) $(DEFS) +#LIBS = -Wl,--relax,--gc-sections,--print-gc-sections,--entry=main +#LIBS = -Wl,--entry=main,--gc-sections,--rela +#LDFLAGS = $(LIBS) + +all: main.hex size + +main.hex: main.c + avr-gcc -o main.elf $? $(CFLAGS) $(LDFLAGS) + avr-objcopy -j .text -j .data -O ihex main.elf main.hex + +f: flash +flash: all + $(PROGRAMMER) -U flash:w:main.hex:i + +fuse: + $(PROGRAMMER) $(FUSES) + +clean: + rm -f *.o *.elf *.hex + +size: + avr-size --mcu=$(DEVICE) -t -A main.elf + avr-size --mcu=$(DEVICE) -C main.elf + avr-nm --size-sort main.elf + + -- cgit v1.2.3