Makefile 1.54 KB
Newer Older
springob's avatar
springob committed
1 2 3 4 5 6 7 8 9 10 11 12


all: libbob3.a

##################
# Compiler setup
PREFIX = /opt/avr/avr-gcc-4.3.4/bin/
GCC_VERSION=-4.3.4

# PREFIX =
# GCC_VERSION=

springob's avatar
springob committed
13 14
-include Makefile.local

springob's avatar
springob committed
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
##################
# AVR compiler setup
CC = $(PREFIX)avr-gcc$(GCC_VERSION)
OBJCOPY = $(PREFIX)avr-objcopy
OBJDUMP = $(PREFIX)avr-objdump
SIZE = $(PREFIX)avr-size
AR = $(PREFIX)avr-ar

##################
# Platforms
LIBS =

##################
# Math and printf
MATH =
PRINTF =


##################
# Platform
DEVICE = atmega88
F_CPU = 8000000
PLATFORM = B-O-B-3
LIBFOLDER = m88-8
EFUSE=07
HFUSE=df
LFUSE=e2

##################
# NIBObee Lib
CFLAGS += -D_BOB3_
CCFLAGS += -D_BOB3_
PROGRAMMER = avrispv2
CFLAGS += -std=c99 -Os -ffunction-sections -DAVR -Wall -I..
CCFLAGS += -Os -ffunction-sections -DAVR -Wall -I..


##################
# Standard Flags
CFLAGS += -mmcu=$(DEVICE) -DF_CPU=$(F_CPU)
CCFLAGS += -mmcu=$(DEVICE) -DF_CPU=$(F_CPU)
CLDFLAGS += -mmcu=$(DEVICE)


##################
# General Rules
LINECOUNT_CMD = 'a=`cat \$0|wc -l` ; echo "compiled $a lines" >>compiler.err'

%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@
	@$(SIZE) -B $@ >>sizes.log

%.o: %.cpp
	$(CC) $(CCFLAGS) -c $< -o $@
	@$(SIZE) -B $@ >>sizes.log

libbob3.a: analog.o  bob3.o ircom.o leds.o main.o

%.a:
	rm -f $@
	$(AR) -q $@ $^

clean:
	rm -f *.d *.o *~ *.elf *.log *.err $(BASENAME).hex $(TEMP_FILES) $(BASENAME).xhex $(BASENAME).lss


.PHONY: all clean clean-errors %.c-compile link-success compile-success compile-info link-info build-success
.SECONDARY: $(BASENAME).hex $(BASENAME).xhex $(BASENAME).elf $(BASENAME).o $(OBJS) $(LOBJS)