git-svn-id: svn+ssh://oldsvn/home/mlalondesvn/svn/cral@22 3ee9b42a-b53c-0410-a25e-f0b6218d5d5bmaster
parent
76493565b3
commit
ec11138f57
@ -1,111 +1,111 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
# Makefile for the project EVBs_061114
|
# Makefile for the project EVBs_061114
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
## General Flags
|
## General Flags
|
||||||
PROJECT = EVB_W5100_DNS
|
PROJECT = EVB_W5100_DNS
|
||||||
MCU = atmega128
|
MCU = atmega128
|
||||||
TARGET = $(PROJECT)_direct_mode.elf
|
TARGET = $(PROJECT)_direct_mode.elf
|
||||||
#TARGET = $(PROJECT)_indirect_mode.elf
|
#TARGET = $(PROJECT)_indirect_mode.elf
|
||||||
#TARGET = $(PROJECT)_spi_mode.elf
|
#TARGET = $(PROJECT)_spi_mode.elf
|
||||||
CC = avr-gcc.exe
|
CC = avr-gcc.exe
|
||||||
|
|
||||||
## Options common to compile, link and assembly rules
|
## Options common to compile, link and assembly rules
|
||||||
COMMON = -mmcu=$(MCU)
|
COMMON = -mmcu=$(MCU)
|
||||||
|
|
||||||
## Compile options common for all C compilation units.
|
## Compile options common for all C compilation units.
|
||||||
CFLAGS = $(COMMON)
|
CFLAGS = $(COMMON)
|
||||||
CFLAGS += -Wall -gdwarf-2 -O0 -fsigned-char
|
CFLAGS += -Wall -gdwarf-2 -O0 -fsigned-char
|
||||||
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d -D__COMPILER_VERSION__=2
|
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d -D__COMPILER_VERSION__=2
|
||||||
INCLUDES = -I../mcu -I../iinchip -I../main -I../inet -I../util
|
INCLUDES = -I../mcu -I../iinchip -I../main -I../inet -I../util
|
||||||
|
|
||||||
## Assembly specific flags
|
## Assembly specific flags
|
||||||
ASMFLAGS = $(COMMON)
|
ASMFLAGS = $(COMMON)
|
||||||
ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2
|
ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2
|
||||||
|
|
||||||
## Linker flags
|
## Linker flags
|
||||||
LDFLAGS = $(COMMON)
|
LDFLAGS = $(COMMON)
|
||||||
LDFLAGS +=
|
LDFLAGS +=
|
||||||
|
|
||||||
|
|
||||||
## Intel Hex file production flags
|
## Intel Hex file production flags
|
||||||
HEX_FLASH_FLAGS = -R .eeprom
|
HEX_FLASH_FLAGS = -R .eeprom
|
||||||
|
|
||||||
HEX_EEPROM_FLAGS = -j .eeprom
|
HEX_EEPROM_FLAGS = -j .eeprom
|
||||||
HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
|
HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
|
||||||
HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0
|
HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0
|
||||||
|
|
||||||
|
|
||||||
## Objects that must be built in order to link
|
## Objects that must be built in order to link
|
||||||
OBJECTS = md5.o socket.o w5100.o main.o delay.o serial.o mcu.o dns.o sockutil.o util.o
|
OBJECTS = md5.o socket.o w5100.o main.o delay.o serial.o mcu.o dns.o sockutil.o util.o
|
||||||
|
|
||||||
## Objects explicitly added by the user
|
## Objects explicitly added by the user
|
||||||
LINKONLYOBJECTS =
|
LINKONLYOBJECTS =
|
||||||
|
|
||||||
## Build
|
## Build
|
||||||
all: $(TARGET) $(PROJECT)_direct_mode.hex $(PROJECT)_direct_mode.eep size
|
all: $(TARGET) $(PROJECT)_direct_mode.hex $(PROJECT)_direct_mode.eep size
|
||||||
#all: $(TARGET) $(PROJECT)_indirect_mode.hex $(PROJECT)_indirect_mode.eep size
|
#all: $(TARGET) $(PROJECT)_indirect_mode.hex $(PROJECT)_indirect_mode.eep size
|
||||||
#all: $(TARGET) $(PROJECT)_spi_mode.hex $(PROJECT)_spi_mode.eep size
|
#all: $(TARGET) $(PROJECT)_spi_mode.hex $(PROJECT)_spi_mode.eep size
|
||||||
|
|
||||||
## Compile
|
## Compile
|
||||||
delay.o: ../mcu/delay.c
|
delay.o: ../mcu/delay.c
|
||||||
$(CC) $(INCLUDES) $(CFLAGS) -c $<
|
$(CC) $(INCLUDES) $(CFLAGS) -c $<
|
||||||
|
|
||||||
mcu.o: ../mcu/mcu.c
|
mcu.o: ../mcu/mcu.c
|
||||||
$(CC) $(INCLUDES) $(CFLAGS) -c $<
|
$(CC) $(INCLUDES) $(CFLAGS) -c $<
|
||||||
|
|
||||||
serial.o: ../mcu/serial.c
|
serial.o: ../mcu/serial.c
|
||||||
$(CC) $(INCLUDES) $(CFLAGS) -c $<
|
$(CC) $(INCLUDES) $(CFLAGS) -c $<
|
||||||
|
|
||||||
#timer.o: ../mcu/timer.c
|
#timer.o: ../mcu/timer.c
|
||||||
# $(CC) $(INCLUDES) $(CFLAGS) -c $<
|
# $(CC) $(INCLUDES) $(CFLAGS) -c $<
|
||||||
|
|
||||||
main.o: ../main/main.c
|
main.o: ../main/main.c
|
||||||
$(CC) $(INCLUDES) $(CFLAGS) -c $<
|
$(CC) $(INCLUDES) $(CFLAGS) -c $<
|
||||||
|
|
||||||
md5.o: ../iinchip/md5.c
|
md5.o: ../iinchip/md5.c
|
||||||
$(CC) $(INCLUDES) $(CFLAGS) -c $<
|
$(CC) $(INCLUDES) $(CFLAGS) -c $<
|
||||||
|
|
||||||
socket.o: ../iinchip/socket.c
|
socket.o: ../iinchip/socket.c
|
||||||
$(CC) $(INCLUDES) $(CFLAGS) -c $<
|
$(CC) $(INCLUDES) $(CFLAGS) -c $<
|
||||||
|
|
||||||
w5100.o: ../iinchip/w5100.c
|
w5100.o: ../iinchip/w5100.c
|
||||||
$(CC) $(INCLUDES) $(CFLAGS) -c $<
|
$(CC) $(INCLUDES) $(CFLAGS) -c $<
|
||||||
|
|
||||||
dns.o: ../inet/dns.c
|
dns.o: ../inet/dns.c
|
||||||
$(CC) $(INCLUDES) $(CFLAGS) -c $<
|
$(CC) $(INCLUDES) $(CFLAGS) -c $<
|
||||||
|
|
||||||
sockutil.o: ../util/sockutil.c
|
sockutil.o: ../util/sockutil.c
|
||||||
$(CC) $(INCLUDES) $(CFLAGS) -c $<
|
$(CC) $(INCLUDES) $(CFLAGS) -c $<
|
||||||
|
|
||||||
util.o: ../util/util.c
|
util.o: ../util/util.c
|
||||||
$(CC) $(INCLUDES) $(CFLAGS) -c $<
|
$(CC) $(INCLUDES) $(CFLAGS) -c $<
|
||||||
|
|
||||||
##Link
|
##Link
|
||||||
$(TARGET): $(OBJECTS)
|
$(TARGET): $(OBJECTS)
|
||||||
$(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)
|
$(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)
|
||||||
|
|
||||||
%.hex: $(TARGET)
|
%.hex: $(TARGET)
|
||||||
avr-objcopy -O ihex $(HEX_FLASH_FLAGS) $< $@
|
avr-objcopy -O ihex $(HEX_FLASH_FLAGS) $< $@
|
||||||
|
|
||||||
%.eep: $(TARGET)
|
%.eep: $(TARGET)
|
||||||
avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@
|
avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@
|
||||||
|
|
||||||
%.lss: $(TARGET)
|
%.lss: $(TARGET)
|
||||||
avr-objdump -h -S $< > $@
|
avr-objdump -h -S $< > $@
|
||||||
|
|
||||||
size: ${TARGET}
|
size: ${TARGET}
|
||||||
@echo
|
@echo
|
||||||
@avr-size -C --mcu=${MCU} ${TARGET}
|
@avr-size -C --mcu=${MCU} ${TARGET}
|
||||||
|
|
||||||
## Clean target
|
## Clean target
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
-rm -rf $(OBJECTS) dep/*
|
-rm -rf $(OBJECTS) dep/*
|
||||||
-rm -f $(PROJECT)_direct_mode.elf $(PROJECT)_direct_mode.hex $(PROJECT)_direct_mode.eep
|
-rm -f $(PROJECT)_direct_mode.elf $(PROJECT)_direct_mode.hex $(PROJECT)_direct_mode.eep
|
||||||
-rm -f $(PROJECT)_indirect_mode.elf $(PROJECT)_indirect_mode.hex $(PROJECT)_indirect_mode.eep
|
-rm -f $(PROJECT)_indirect_mode.elf $(PROJECT)_indirect_mode.hex $(PROJECT)_indirect_mode.eep
|
||||||
-rm -f $(PROJECT)_spi_mode.elf $(PROJECT)_spi_mode.hex $(PROJECT)_spi_mode.eep
|
-rm -f $(PROJECT)_spi_mode.elf $(PROJECT)_spi_mode.hex $(PROJECT)_spi_mode.eep
|
||||||
|
|
||||||
## Other dependencies
|
## Other dependencies
|
||||||
-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)
|
-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)
|
||||||
|
|
||||||
|
Loading…
Reference in new issue