Project

General

Profile

Statistics
| Branch: | Revision:

root / toolbox / Makefile @ e8960789

History | View | Annotate | Download (817 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
TOOL_ADDRESS?=-1
13

    
14
FLAGS=-Os -Wall -mmcu=$(MCU) -DF_CPU=$(F_CPU) -I.. \
15
			-DRTS_ENABLE -DTOOL_ADDRESS=$(TOOL_ADDRESS) \
16
			-Ifreemodbus/port \
17
			-Ifreemodbus/modbus/rtu \
18
			-Ifreemodbus/modbus/ascii \
19
			-Ifreemodbus/modbus/include
20

    
21
PROG=avrispMKII
22

    
23
all: toolbox.hex
24

    
25
%.hex: %.elf
26
	avr-objcopy -j .text -j .data -O ihex $< $@
27

    
28
toolbox.elf: $(SRC) $(HDR)
29
	avr-gcc $(FLAGS) $(SRC) -o $@
30

    
31
%.asm: %.c
32
	avr-gcc -S $(FLAGS) $< -o $@
33

    
34
program: toolbox.hex
35
	avrdude -p $(PART) -c $(PROG) -P usb -B 3 -F -U flash:w:toolbox.hex
36

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