source: firmware/FSC/test_projects/test_ethernet/default/Makefile@ 10697

Last change on this file since 10697 was 10668, checked in by neise, 14 years ago
File size: 3.0 KB
Line 
1###############################################################################
2# Makefile for the project test_ethernet
3###############################################################################
4
5## General Flags
6PROJECT = test_ethernet
7MCU = atmega32
8TARGET = test_ethernet.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=test_ethernet.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 = w5100_spi_interface.o ad7719_adc.o application.o atmega_adc.o interpol.o muxer_fsc.o output.o parser.o spi_master.o usart.o num_conversion.o FSC_test.o
41
42## Objects explicitly added by the user
43LINKONLYOBJECTS =
44
45## Build
46all: $(TARGET) test_ethernet.hex test_ethernet.eep test_ethernet.lss size
47
48## Compile
49w5100_spi_interface.o: ../../../src/w5100_spi_interface.c
50 $(CC) $(INCLUDES) $(CFLAGS) -c $<
51
52ad7719_adc.o: ../../../src/ad7719_adc.c
53 $(CC) $(INCLUDES) $(CFLAGS) -c $<
54
55application.o: ../../../src/application.c
56 $(CC) $(INCLUDES) $(CFLAGS) -c $<
57
58atmega_adc.o: ../../../src/atmega_adc.c
59 $(CC) $(INCLUDES) $(CFLAGS) -c $<
60
61interpol.o: ../../../src/interpol.c
62 $(CC) $(INCLUDES) $(CFLAGS) -c $<
63
64muxer_fsc.o: ../../../src/muxer_fsc.c
65 $(CC) $(INCLUDES) $(CFLAGS) -c $<
66
67output.o: ../../../src/output.c
68 $(CC) $(INCLUDES) $(CFLAGS) -c $<
69
70parser.o: ../../../src/parser.c
71 $(CC) $(INCLUDES) $(CFLAGS) -c $<
72
73spi_master.o: ../../../src/spi_master.c
74 $(CC) $(INCLUDES) $(CFLAGS) -c $<
75
76usart.o: ../../../src/usart.c
77 $(CC) $(INCLUDES) $(CFLAGS) -c $<
78
79num_conversion.o: ../../../src/num_conversion.c
80 $(CC) $(INCLUDES) $(CFLAGS) -c $<
81
82FSC_test.o: ../../../src/FSC_test.c
83 $(CC) $(INCLUDES) $(CFLAGS) -c $<
84
85##Link
86$(TARGET): $(OBJECTS)
87 $(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)
88
89%.hex: $(TARGET)
90 avr-objcopy -O ihex $(HEX_FLASH_FLAGS) $< $@
91
92%.eep: $(TARGET)
93 -avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@ || exit 0
94
95%.lss: $(TARGET)
96 avr-objdump -h -S $< > $@
97
98size: ${TARGET}
99 @echo
100 @avr-size -C --mcu=${MCU} ${TARGET}
101
102## Clean target
103.PHONY: clean
104clean:
105 -rm -rf $(OBJECTS) test_ethernet.elf dep/* test_ethernet.hex test_ethernet.eep test_ethernet.lss test_ethernet.map
106
107
108## Other dependencies
109-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)
110
Note: See TracBrowser for help on using the repository browser.