source: projects/punch-card/driver/documation-m200/bin/Makefile @ 51

Last change on this file since 51 was 51, checked in by sven, 10 years ago

Sorted the sources a bit:

  • moved all the interrupt and card ring buffer related things to driver.c
  • renamed io.c (stupid name) to protocol.c (good name)
File size: 2.7 KB
Line 
1###############################################################################
2# Makefile for the project avr-m200-card-reader-controller
3###############################################################################
4
5## General Flags
6PROJECT = avr-m200-card-reader-controller
7MCU = atmega644
8TARGET = avr-m200-card-reader-controller.elf
9CC = avr-gcc
10
11CPP = avr-g++
12
13## Options common to compile, link and assembly rules
14COMMON = -mmcu=$(MCU)
15
16## Compile options common for all C compilation units.
17CFLAGS = $(COMMON)
18CFLAGS += -Wall -gdwarf-2 -std=gnu99   -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
19CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d
20
21## Assembly specific flags
22ASMFLAGS = $(COMMON)
23ASMFLAGS += $(CFLAGS)
24ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2
25
26## Linker flags
27LDFLAGS = $(COMMON)
28LDFLAGS +=  -Wl,-Map=avr-m200-card-reader-controller.map
29
30
31## Intel Hex file production flags
32HEX_FLASH_FLAGS = -R .eeprom -R .fuse -R .lock -R .signature
33
34HEX_EEPROM_FLAGS = -j .eeprom
35HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
36HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings
37
38
39## Include Directories
40INCLUDES = -I"D:\Server\htdocs\paper-tape-project\punch-card\driver\documation-m200\..\protocols\documation-m200" -I"D:\Server\htdocs\paper-tape-project\punch-card\driver\documation-m200\..\..\protocols\documation-m200" 
41
42## Objects that must be built in order to link
43OBJECTS = main.o punchcard.o protocol.o driver.o
44
45## Objects explicitly added by the user
46LINKONLYOBJECTS = 
47
48## Build
49all: $(TARGET) avr-m200-card-reader-controller.hex avr-m200-card-reader-controller.eep avr-m200-card-reader-controller.lss size
50
51## Compile
52main.o: ../src/main.c
53        $(CC) $(INCLUDES) $(CFLAGS) -c  $<
54
55punchcard.o: ../src/punchcard.c
56        $(CC) $(INCLUDES) $(CFLAGS) -c  $<
57
58protocol.o: ../src/protocol.c
59        $(CC) $(INCLUDES) $(CFLAGS) -c  $<
60
61driver.o: ../src/driver.c
62        $(CC) $(INCLUDES) $(CFLAGS) -c  $<
63
64##Link
65$(TARGET): $(OBJECTS)
66         $(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)
67
68%.hex: $(TARGET)
69        avr-objcopy -O ihex $(HEX_FLASH_FLAGS)  $< $@
70
71%.eep: $(TARGET)
72        -avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@ || exit 0
73
74%.lss: $(TARGET)
75        avr-objdump -h -S $< > $@
76
77size: ${TARGET}
78        @echo
79        @avr-size -C --mcu=${MCU} ${TARGET}
80
81## Clean target
82.PHONY: clean
83clean:
84        -rm -rf $(OBJECTS) avr-m200-card-reader-controller.elf dep/* avr-m200-card-reader-controller.hex avr-m200-card-reader-controller.eep avr-m200-card-reader-controller.lss avr-m200-card-reader-controller.map
85
86
87## Other dependencies
88-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)
89
Note: See TracBrowser for help on using the repository browser.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License