diff 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
line wrap: on
line diff
--- a/Makefile	Thu Jun 13 23:44:59 2013 +0800
+++ b/Makefile	Tue Jun 25 13:55:11 2013 +0800
@@ -17,16 +17,19 @@
 #                   default_serial = "avrdoper"
 # FUSES ........ Parameters for avrdude to flash the fuses appropriately.
 
-DEVICE     = atmega328
+DEVICE     = atmega328p
 PROGDEVICE     = atmega328p
 CLOCK      = 4915200
 PROGRAMMER = #-c stk500v2 -P avrdoper
 PROGRAMMER = -c stk500 -P ~/dev/stk500 -p $(PROGDEVICE)  -B 2
 SOURCE_1WIRE = onewire.c simple_ds18b20.c crc8.c
 SOURCE_CRYPTO = hmac-sha1.c sha1-asm.S aes.c
+SOURCE_SD = byteordering.c fat.c  partition.c sd_raw.c 
 SOURCE    = main.c
-SOURCE += $(SOURCE_CRYPTO)
-LIBS       = -lm
+SOURCE += $(SOURCE_CRYPTO) $(SOURCE_SD)
+LIBS       = 
+
+OBJECTS := $(patsubst %.c,%.o,$(patsubst %.S,%.o,$(SOURCE)))
 
 # default but 2mhz
 FUSES      = -U hfuse:w:0xd9:m -U lfuse:w:0x77:m -U efuse:w:0xfd:m
@@ -61,9 +64,12 @@
 
 # Tune the lines below only if you know what you are doing:
 
+SHELL := /bin/bash
+export PATH := $(PATH):/usr/local/CrossPack-AVR/bin/
+
 AVRDUDE = avrdude $(PROGRAMMER) 
 #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
-COMPILE = /usr/local/CrossPack-AVR/bin/avr-gcc -Wall -Os -DF_CPU=$(CLOCK) -mmcu=$(DEVICE) -g -std=c99 -Wl,-u,vfprintf -lprintf_flt -lm
+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
 
 # symbolic targets:
 all:	main.hex