comparison Makefile @ 19:5f9a40d6991b

Import SD handling from http://www.roland-riegel.de/sd-reader/index.html Use smaller build options
author Matt Johnston <matt@ucc.asn.au>
date Tue, 25 Jun 2013 13:55:11 +0800
parents 021e6e0006f4
children 292cd17de2a4
comparison
equal deleted inserted replaced
18:021e6e0006f4 19:5f9a40d6991b
15 # add settings like this to your ~/.avrduderc file: 15 # add settings like this to your ~/.avrduderc file:
16 # default_programmer = "stk500v2" 16 # default_programmer = "stk500v2"
17 # default_serial = "avrdoper" 17 # default_serial = "avrdoper"
18 # FUSES ........ Parameters for avrdude to flash the fuses appropriately. 18 # FUSES ........ Parameters for avrdude to flash the fuses appropriately.
19 19
20 DEVICE = atmega328 20 DEVICE = atmega328p
21 PROGDEVICE = atmega328p 21 PROGDEVICE = atmega328p
22 CLOCK = 4915200 22 CLOCK = 4915200
23 PROGRAMMER = #-c stk500v2 -P avrdoper 23 PROGRAMMER = #-c stk500v2 -P avrdoper
24 PROGRAMMER = -c stk500 -P ~/dev/stk500 -p $(PROGDEVICE) -B 2 24 PROGRAMMER = -c stk500 -P ~/dev/stk500 -p $(PROGDEVICE) -B 2
25 SOURCE_1WIRE = onewire.c simple_ds18b20.c crc8.c 25 SOURCE_1WIRE = onewire.c simple_ds18b20.c crc8.c
26 SOURCE_CRYPTO = hmac-sha1.c sha1-asm.S aes.c 26 SOURCE_CRYPTO = hmac-sha1.c sha1-asm.S aes.c
27 SOURCE_SD = byteordering.c fat.c partition.c sd_raw.c
27 SOURCE = main.c 28 SOURCE = main.c
28 SOURCE += $(SOURCE_CRYPTO) 29 SOURCE += $(SOURCE_CRYPTO) $(SOURCE_SD)
29 LIBS = -lm 30 LIBS =
31
32 OBJECTS := $(patsubst %.c,%.o,$(patsubst %.S,%.o,$(SOURCE)))
30 33
31 # default but 2mhz 34 # default but 2mhz
32 FUSES = -U hfuse:w:0xd9:m -U lfuse:w:0x77:m -U efuse:w:0xfd:m 35 FUSES = -U hfuse:w:0xd9:m -U lfuse:w:0x77:m -U efuse:w:0xfd:m
33 36
34 # ATMega8 fuse bits used above (fuse bits for other devices are different!): 37 # ATMega8 fuse bits used above (fuse bits for other devices are different!):
59 # the fuse bit calculator at http://www.engbedded.com/fusecalc/ 62 # the fuse bit calculator at http://www.engbedded.com/fusecalc/
60 63
61 64
62 # Tune the lines below only if you know what you are doing: 65 # Tune the lines below only if you know what you are doing:
63 66
67 SHELL := /bin/bash
68 export PATH := $(PATH):/usr/local/CrossPack-AVR/bin/
69
64 AVRDUDE = avrdude $(PROGRAMMER) 70 AVRDUDE = avrdude $(PROGRAMMER)
65 #COMPILE = avr-gcc -Wall -Os -DF_CPU=$(CLOCK) -mmcu=$(DEVICE) -g -std=c99 -mcall-prologues -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,--relax -fwhole-program -Wl,-u,vfprintf -lprintf_flt -lm 71 #COMPILE = avr-gcc -Wall -Os -DF_CPU=$(CLOCK) -mmcu=$(DEVICE) -g -std=c99 -mcall-prologues -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,--relax -fwhole-program -Wl,-u,vfprintf -lprintf_flt -lm
66 COMPILE = /usr/local/CrossPack-AVR/bin/avr-gcc -Wall -Os -DF_CPU=$(CLOCK) -mmcu=$(DEVICE) -g -std=c99 -Wl,-u,vfprintf -lprintf_flt -lm 72 COMPILE = /usr/local/CrossPack-AVR/bin/avr-gcc -Wall -Os -DF_CPU=$(CLOCK) -mmcu=$(DEVICE) -g -std=c99 -mcall-prologues -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,--relax -fwhole-program -flto
67 73
68 # symbolic targets: 74 # symbolic targets:
69 all: main.hex 75 all: main.hex
70 76
71 .c.o: 77 .c.o: