Project

General

Profile

Statistics
| Branch: | Revision:

root / toolbox / Makefile @ 1b054655

History | View | Annotate | Download (769 Bytes)

1
PART=t1634
2
MCU=attiny1634
3
#MCU=atmega2560
4
F_CPU=8000000UL
5
SRC=*.c \
6
		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
HDR=../tooltron_mb.h *.h freemodbus/port/*.h
12

    
13
FLAGS=-Os -Wall -mmcu=$(MCU) -DF_CPU=$(F_CPU) -I.. \
14
			-DRTS_ENABLE \
15
			-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
	avrdude -p $(PART) -c $(PROG) -P usb -B 3 -F -U flash:w:toolbox.hex
35

    
36
clean:
37
	rm -f *.elf *.hex