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

Last change on this file since 46 was 46, checked in by sven, 14 years ago

First import of the AVR Documenta M200 Punch Card Reader Controller. This project was started at 09.11.2009. Current status: Working (Beta status). Pending work: Cleaning up, find bug in circular buffer system, implementing a protocol (FTP/Hayes command set like).
Work was done on Windows 2000 with WinAVR and AVR Studio 4 (ISP programming).

File size: 2.3 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## Objects that must be built in order to link
40OBJECTS = main.o punchcard.o
41
42## Objects explicitly added by the user
43LINKONLYOBJECTS = 
44
45## Build
46all: $(TARGET) avr-m200-card-reader-controller.hex avr-m200-card-reader-controller.eep avr-m200-card-reader-controller.lss size
47
48## Compile
49main.o: ../src/main.c
50        $(CC) $(INCLUDES) $(CFLAGS) -c  $<
51
52punchcard.o: ../src/punchcard.c
53        $(CC) $(INCLUDES) $(CFLAGS) -c  $<
54
55##Link
56$(TARGET): $(OBJECTS)
57         $(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)
58
59%.hex: $(TARGET)
60        avr-objcopy -O ihex $(HEX_FLASH_FLAGS)  $< $@
61
62%.eep: $(TARGET)
63        -avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@ || exit 0
64
65%.lss: $(TARGET)
66        avr-objdump -h -S $< > $@
67
68size: ${TARGET}
69        @echo
70        @avr-size -C --mcu=${MCU} ${TARGET}
71
72## Clean target
73.PHONY: clean
74clean:
75        -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
76
77
78## Other dependencies
79-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)
80
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