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

Last change on this file since 50 was 50, checked in by sven, 10 years ago
  • The PC Documation M200 uC Serial Communication Protocol: Initial write
  • driver/documation-m200: Implemented the protocol (code compiles, but not tested yet on device)

-- Sven @ p3

File size: 2.6 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 io.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
58io.o: ../src/io.c
59        $(CC) $(INCLUDES) $(CFLAGS) -c  $<
60
61##Link
62$(TARGET): $(OBJECTS)
63         $(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)
64
65%.hex: $(TARGET)
66        avr-objcopy -O ihex $(HEX_FLASH_FLAGS)  $< $@
67
68%.eep: $(TARGET)
69        -avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@ || exit 0
70
71%.lss: $(TARGET)
72        avr-objdump -h -S $< > $@
73
74size: ${TARGET}
75        @echo
76        @avr-size -C --mcu=${MCU} ${TARGET}
77
78## Clean target
79.PHONY: clean
80clean:
81        -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
82
83
84## Other dependencies
85-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)
86
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