~gabe/flashlight-firmware/anduril2

« back to all changes in this revision

Viewing changes to Tamagotchi/7135x8v2/default/Makefile

  • Committer: Selene Scriven
  • Date: 2015-03-17 08:56:50 UTC
  • mto: This revision was merged to the branch mainline in revision 124.
  • Revision ID: ubuntu@toykeeper.net-20150317085650-s89wr9h28n2co7z1
Added TheStar firmwares from _the_

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
###############################################################################
2
 
# Makefile for the project 7135x8v26
3
 
###############################################################################
4
 
 
5
 
## General Flags
6
 
PROJECT = 7135x8v26
7
 
MCU = attiny13a
8
 
TARGET = 7135x8v26.elf
9
 
CC = avr-gcc
10
 
 
11
 
CPP = avr-g++
12
 
 
13
 
## Options common to compile, link and assembly rules
14
 
COMMON = -mmcu=$(MCU)
15
 
 
16
 
## Compile options common for all C compilation units.
17
 
CFLAGS = $(COMMON)
18
 
CFLAGS += -Wall -gdwarf-2 -std=gnu99         -DF_CPU=4800000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
19
 
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d 
20
 
 
21
 
## Assembly specific flags
22
 
ASMFLAGS = $(COMMON)
23
 
ASMFLAGS += $(CFLAGS)
24
 
ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2
25
 
 
26
 
## Linker flags
27
 
LDFLAGS = $(COMMON)
28
 
LDFLAGS +=  -Wl,-Map=7135x8v26.map
29
 
 
30
 
 
31
 
## Intel Hex file production flags
32
 
HEX_FLASH_FLAGS = -R .eeprom -R .fuse -R .lock -R .signature
33
 
 
34
 
HEX_EEPROM_FLAGS = -j .eeprom
35
 
HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
36
 
HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings
37
 
 
38
 
 
39
 
## Objects that must be built in order to link
40
 
OBJECTS = 7135x8v2.o 
41
 
 
42
 
## Objects explicitly added by the user
43
 
LINKONLYOBJECTS = 
44
 
 
45
 
## Build
46
 
all: $(TARGET) 7135x8v26.hex 7135x8v26.eep 7135x8v26.lss size
47
 
 
48
 
## Compile
49
 
7135x8v2.o: ../7135x8v2.c
50
 
        $(CC) $(INCLUDES) $(CFLAGS) -c  $<
51
 
 
52
 
##Link
53
 
$(TARGET): $(OBJECTS)
54
 
         $(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)
55
 
 
56
 
%.hex: $(TARGET)
57
 
        avr-objcopy -O ihex $(HEX_FLASH_FLAGS)  $< $@
58
 
 
59
 
%.eep: $(TARGET)
60
 
        -avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@ || exit 0
61
 
 
62
 
%.lss: $(TARGET)
63
 
        avr-objdump -h -S $< > $@
64
 
 
65
 
size: ${TARGET}
66
 
        @echo
67
 
        @avr-size -C --mcu=${MCU} ${TARGET}
68
 
 
69
 
## Clean target
70
 
.PHONY: clean
71
 
clean:
72
 
        -rm -rf $(OBJECTS) 7135x8v26.elf dep/* 7135x8v26.hex 7135x8v26.eep 7135x8v26.lss 7135x8v26.map
73
 
 
74
 
 
75
 
## Other dependencies
76
 
-include $(shell mkdir dep 2>NUL) $(wildcard dep/*)
77