From: Kevin Rosenberg Date: Sat, 29 Mar 2008 00:41:07 +0000 (-0600) Subject: add missing avr458 Makefile X-Git-Url: http://git.kpe.io/?p=avr_bc100.git;a=commitdiff_plain;h=70667e37128288b141e5def02dfb0e47a5e60034 add missing avr458 Makefile --- diff --git a/BaseTinyFirmware/GCC/ChangeLog b/BaseTinyFirmware/GCC/ChangeLog index 07131e9..87d741b 100644 --- a/BaseTinyFirmware/GCC/ChangeLog +++ b/BaseTinyFirmware/GCC/ChangeLog @@ -1,8 +1,9 @@ -2008-03-12 Kevin Rosenberg +2008-03-28 Kevin Rosenberg * BaseTinyFirmware/GCC/avr463/Makefile: Added -Wl,-relax to linker flags. On my system this crashes avr-ld.exe, but others have reported a large reduction in firmware size with this option. I added this option for others to try. + * BaseTinyFirmware/GCC/avr458/Makefile: Added missing file 2008-03-14 Martin Thomas * added "volatile" to structure object and array declarations for diff --git a/BaseTinyFirmware/GCC/avr458/Makefile b/BaseTinyFirmware/GCC/avr458/Makefile new file mode 100644 index 0000000..d74f9d4 --- /dev/null +++ b/BaseTinyFirmware/GCC/avr458/Makefile @@ -0,0 +1,107 @@ + ############################################################################### +# Makefile for the project avr458 +############################################################################### + +## General Flags +PROJECT = avr458 +MCU = attiny861 +TARGET = $(PROJECT).elf +CC = avr-gcc.exe + +## Options common to compile, link and assembly rules +COMMON = -mmcu=$(MCU) + +## Compile options common for all C compilation units. +CFLAGS = $(COMMON) +CFLAGS += -Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -DLIION +CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d + +## Assembly specific flags +ASMFLAGS = $(COMMON) +ASMFLAGS += $(CFLAGS) +ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2 + +## Linker flags +LDFLAGS = $(COMMON) +LDFLAGS += -Wl,-Map=$(PROJECT).map -Wl,-relax + + +## Intel Hex file production flags +HEX_FLASH_FLAGS = -R .eeprom + +HEX_EEPROM_FLAGS = -j .eeprom +HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load" +HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings + + +## Libraries +LIBS = -lm + +## Objects that must be built in order to link +OBJECTS = ADC.o battery.o chargefunc.o main.o menu.o LIIONcharge.o OWI.o PWM.o statefunc.o time.o USI.o + +## Objects explicitly added by the user +LINKONLYOBJECTS = + +## Build +all: $(TARGET) $(PROJECT).hex $(PROJECT).eep $(PROJECT).lss size + +## Compile +ADC.o: ../ADC.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +battery.o: ../battery.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +chargefunc.o: ../chargefunc.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +main.o: ../main.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +menu.o: ../menu.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +LIIONcharge.o: ../LIIONcharge.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +OWI.o: ../OWI.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +PWM.o: ../PWM.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +statefunc.o: ../statefunc.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +time.o: ../time.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +USI.o: ../USI.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + +##Link +$(TARGET): $(OBJECTS) + $(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET) + +%.hex: $(TARGET) + avr-objcopy -O ihex $(HEX_FLASH_FLAGS) $< $@ + +%.eep: $(TARGET) + -avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@ || exit 0 + +%.lss: $(TARGET) + avr-objdump -h -S $< > $@ + +size: ${TARGET} + @echo + @avr-size -C --mcu=${MCU} ${TARGET} + +## Clean target +.PHONY: clean +clean: + -rm -rf $(OBJECTS) $(PROJECT).elf dep $(PROJECT).hex $(PROJECT).eep $(PROJECT).lss $(PROJECT).map + + +## Other dependencies +-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*) diff --git a/BaseTinyFirmware/GCC/avr463/Makefile b/BaseTinyFirmware/GCC/avr463/Makefile index 44c49e4..826b345 100644 --- a/BaseTinyFirmware/GCC/avr463/Makefile +++ b/BaseTinyFirmware/GCC/avr463/Makefile @@ -1,11 +1,11 @@ -############################################################################### + ############################################################################### # Makefile for the project avr463 ############################################################################### ## General Flags PROJECT = avr463 MCU = attiny861 -TARGET = avr463.elf +TARGET = $(PROJECT).elf CC = avr-gcc.exe ## Options common to compile, link and assembly rules @@ -23,7 +23,7 @@ ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2 ## Linker flags LDFLAGS = $(COMMON) -LDFLAGS += -Wl,-Map=avr463.map -Wl,-relax +LDFLAGS += -Wl,-Map=$(PROJECT).map -Wl,-relax ## Intel Hex file production flags @@ -44,7 +44,7 @@ OBJECTS = ADC.o battery.o chargefunc.o main.o menu.o NIMHcharge.o OWI.o PWM.o st LINKONLYOBJECTS = ## Build -all: $(TARGET) avr463.hex avr463.eep avr463.lss size +all: $(TARGET) $(PROJECT).hex $(PROJECT).eep $(PROJECT).lss size ## Compile ADC.o: ../ADC.c @@ -100,9 +100,8 @@ size: ${TARGET} ## Clean target .PHONY: clean clean: - -rm -rf $(OBJECTS) avr463.elf dep avr463.hex avr463.eep avr463.lss avr463.map + -rm -rf $(OBJECTS) $(PROJECT).elf dep $(PROJECT).hex $(PROJECT).eep $(PROJECT).lss $(PROJECT).map ## Other dependencies -include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*) -