root / toolbox / Makefile @ 1b054655
History | View | Annotate | Download (769 Bytes)
1 | 20e5429c | Tom Mullins | PART=t1634 |
---|---|---|---|
2 | MCU=attiny1634 |
||
3 | #MCU=atmega2560 |
||
4 | 92a430bc | Tom Mullins | F_CPU=8000000UL |
5 | 1b054655 | Tom Mullins | SRC=*.c \ |
6 | 20e5429c | Tom Mullins | freemodbus/port/*.c \ |
7 | freemodbus/modbus/mb.c \ |
||
8 | freemodbus/modbus/rtu/mbrtu.c \ |
||
9 | freemodbus/modbus/ascii/mbascii.c \ |
||
10 | freemodbus/modbus/functions/*.c |
||
11 | 1b054655 | Tom Mullins | HDR=../tooltron_mb.h *.h freemodbus/port/*.h |
12 | 20e5429c | Tom Mullins | |
13 | ae250f1a | Tom Mullins | FLAGS=-Os -Wall -mmcu=$(MCU) -DF_CPU=$(F_CPU) -I.. \ |
14 | e80ba701 | Tom Mullins | -DRTS_ENABLE \ |
15 | 20e5429c | Tom Mullins | -Ifreemodbus/port \ |
16 | -Ifreemodbus/modbus/rtu \ |
||
17 | -Ifreemodbus/modbus/ascii \ |
||
18 | -Ifreemodbus/modbus/include |
||
19 | |||
20 | PROG=avrispMKII |
||
21 | |||
22 | all: toolbox.hex |
||
23 | |||
24 | %.hex: %.elf |
||
25 | avr-objcopy -j .text -j .data -O ihex $< $@ |
||
26 | |||
27 | toolbox.elf: $(SRC) $(HDR) |
||
28 | avr-gcc $(FLAGS) $(SRC) -o $@ |
||
29 | |||
30 | %.asm: %.c |
||
31 | avr-gcc -S $(FLAGS) $< -o $@ |
||
32 | |||
33 | program: toolbox.hex |
||
34 | e80ba701 | Tom Mullins | avrdude -p $(PART) -c $(PROG) -P usb -B 3 -F -U flash:w:toolbox.hex |
35 | 20e5429c | Tom Mullins | |
36 | clean: |
||
37 | rm -f *.elf *.hex |