Sunteți pe pagina 1din 4

# -----------------------------------------------------------------------------# Adapted from Yagarto examples (LPC2148Test.zip). See header below.

# -----------------------------------------------------------------------------#****************************************************************************
# Copyright (c) 2006 by Michael Fischer. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
#
notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#
notice, this list of conditions and the following disclaimer in the
#
documentation and/or other materials provided with the distribution.
# 3. Neither the name of the author nor the names of its contributors may
#
be used to endorse or promote products derived from this software
#
without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
# THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
#***************************************************************************
################################################################################
##############
#
#
!!!! Do NOT edit this makefile with an editor which replace tabs by spac
es !!!!
#
################################################################################
##############
#
# On command line:
#
# make all = Create project
#
# make clean = Clean project files.
#
# To rebuild project do "make clean" and "make all".
#
################################################################################
##############
# Start of default section
#
# TRGT = arm-elf-

TRGT
CC
CP
AS
BIN

=
=
=
=
=

arm-none-eabi$(TRGT)gcc
$(TRGT)objcopy
$(TRGT)gcc -x assembler-with-cpp
$(CP) -O ihex

MCU = arm7tdmi
# List all default C defines here, like -D_DEBUG=1
DDEFS =
# List all default ASM defines here, like -D_DEBUG=1
DADEFS = -DROM_RUN
# List all default directories to look for include files here
DINCLUDES =
# List all default libraries here
DLIBS =
#
# End of default section
################################################################################
##############
################################################################################
##############
# Start of user section
#
# Third party dependencies
THIRD_PARTY = ../../third_party
# Define project name here
PROJECT = GPIO_LED_blink
# Define linker script file here
LDSCRIPT_ROM = $(THIRD_PARTY)/toolchain/src/LPC2148-ROM.ld
# List all user C define here, like -D_DEBUG=1
UDEFS =
# Define ASM defines here
UADEFS =
# List C source files here
SRC = \
$(THIRD_PARTY)/toolchain/src/armVIC.c \
$(THIRD_PARTY)/toolchain/src/syscalls.c \
./GPIO_LED_blink.c
# List ASM source files here
ASRC = \
$(THIRD_PARTY)/toolchain/src/crt0.s
# List all user directories here
UINCLUDES = \
-I $(THIRD_PARTY)/toolchain/include
# List all user libraries here

ULIBS =
# Define optimisation level here
OPT =
#
# End of user defines
################################################################################
##############
INCLUDES
DEFS
=
ADEFS =
OBJS
=
LIBS
=
MCFLAGS =

= $(DINCLUDES) $(UINCLUDES)
$(DDEFS) $(UDEFS)
$(DADEFS) $(UADEFS)
$(ASRC:.s=.o) $(SRC:.c=.o)
$(DLIBS) $(ULIBS)
-mcpu=$(MCU)

ASFLAGS = $(MCFLAGS) -g -Wa,-amhls=$(<:.s=.lst) $(ADEFS)


CPFLAGS = $(MCFLAGS) $(OPT) -g -fomit-frame-pointer -Wall -Wstrict-prototypes -f
verbose-asm -Wa,-ahlms=$(<:.c=.lst) $(DEFS)
LDFLAGS_ROM = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT_ROM) -Wl,-Map=$(PROJECT)_rom
.map,--cref,--no-warn-mismatch
# Generate dependency information
CPFLAGS += -MD -MP -MF .dep/$(@F).d
#
# makefile rules
#
all: ROM
ROM: $(OBJS) $(PROJECT)_rom.elf $(PROJECT)_rom.hex
%o : %c
$(CC) -c $(CPFLAGS) -I . $(INCLUDES) $< -o $@
%o : %s
$(AS) -c $(ASFLAGS) $< -o $@
%o : %S
$(AS) -c $(ASFLAGS) $< -o $@
%rom.elf: $(OBJS)
$(CC) $(OBJS) $(LDFLAGS_ROM) $(LIBS) -o $@
%hex: %elf
$(BIN) $< $@
clean:

-rm
-rm
-rm
-rm
-rm
-rm
-rm
-rm
-rm

-f
-f
-f
-f
-f
-f
-f
-f
-f

$(OBJS)
$(PROJECT)_rom.elf
$(PROJECT)_rom.map
$(PROJECT)_rom.hex
$(SRC:.c=.c.bak)
$(SRC:.c=.lst)
$(ASRC:.s=.s.bak)
$(ASRC:.s=.lst)
$(ASRC:.S=.S.bak)

-rm -f $(ASRC:.S=.lst)
-rm -fR .dep

#
# Include the dependency files, should be the last of the makefile
#
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
# *** EOF ***

S-ar putea să vă placă și