2002-04-27 11:09:31 +00:00
|
|
|
#
|
2006-09-01 17:49:50 +00:00
|
|
|
# (C) Copyright 2000-2006
|
2002-04-27 11:09:31 +00:00
|
|
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
#
|
|
|
|
# See file CREDITS for list of people who contributed to this
|
|
|
|
# project.
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License as
|
|
|
|
# published by the Free Software Foundation; either version 2 of
|
|
|
|
# the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
# MA 02111-1307 USA
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/config.mk
|
|
|
|
|
2009-09-04 23:54:45 +00:00
|
|
|
ELF-$(ARCH) :=
|
|
|
|
ELF-$(BOARD) :=
|
|
|
|
ELF-$(CPU) :=
|
|
|
|
ELF-y := hello_world
|
|
|
|
|
|
|
|
ELF-$(CONFIG_SMC91111) += smc91111_eeprom
|
|
|
|
ELF-$(CONFIG_SMC911X) += smc911x_eeprom
|
|
|
|
ELF-$(CONFIG_SPI_FLASH_ATMEL) += atmel_df_pow2
|
|
|
|
ELF-i386 += 82559_eeprom
|
|
|
|
ELF-mpc5xxx += interrupt
|
|
|
|
ELF-mpc8xx += test_burst timer
|
|
|
|
ELF-mpc8260 += mem_to_mem_idma2intr
|
|
|
|
ELF-ppc += sched
|
|
|
|
ELF-oxc += eepro100_eeprom
|
|
|
|
|
2009-11-09 17:13:00 +00:00
|
|
|
#
|
|
|
|
# Some versions of make do not handle trailing white spaces properly;
|
|
|
|
# leading to build failures. The problem was found with GNU Make 3.80.
|
|
|
|
# Using 'strip' as a workaround for the problem.
|
|
|
|
#
|
|
|
|
ELF := $(strip $(ELF-y) $(ELF-$(ARCH)) $(ELF-$(BOARD)) $(ELF-$(CPU)))
|
|
|
|
|
2009-09-04 23:54:45 +00:00
|
|
|
SREC = $(addsuffix .srec,$(ELF))
|
|
|
|
BIN = $(addsuffix .bin,$(ELF))
|
|
|
|
|
|
|
|
COBJS := $(ELF:=.o)
|
2002-04-27 11:09:31 +00:00
|
|
|
|
2006-09-01 17:49:50 +00:00
|
|
|
LIB = $(obj)libstubs.a
|
2009-09-04 23:54:45 +00:00
|
|
|
|
|
|
|
LIBAOBJS-$(ARCH) :=
|
|
|
|
LIBAOBJS-$(CPU) :=
|
|
|
|
LIBAOBJS-ppc += $(ARCH)_longjmp.o $(ARCH)_setjmp.o
|
|
|
|
LIBAOBJS-mpc8xx += test_burst_lib.o
|
|
|
|
LIBAOBJS := $(LIBAOBJS-$(ARCH)) $(LIBAOBJS-$(CPU))
|
|
|
|
|
|
|
|
LIBCOBJS = stubs.o
|
2006-09-01 17:49:50 +00:00
|
|
|
|
|
|
|
LIBOBJS = $(addprefix $(obj),$(LIBAOBJS) $(LIBCOBJS))
|
|
|
|
|
2009-09-04 23:54:45 +00:00
|
|
|
SRCS := $(COBJS:.o=.c) $(LIBCOBJS:.o=.c) $(LIBAOBJS:.o=.S)
|
2006-09-01 17:49:50 +00:00
|
|
|
OBJS := $(addprefix $(obj),$(COBJS))
|
2006-10-24 11:55:18 +00:00
|
|
|
ELF := $(addprefix $(obj),$(ELF))
|
2006-09-01 17:49:50 +00:00
|
|
|
BIN := $(addprefix $(obj),$(BIN))
|
|
|
|
SREC := $(addprefix $(obj),$(SREC))
|
2002-04-27 11:09:31 +00:00
|
|
|
|
2003-08-29 20:57:53 +00:00
|
|
|
gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
|
|
|
|
|
2002-04-27 11:09:31 +00:00
|
|
|
CPPFLAGS += -I..
|
|
|
|
|
2010-06-15 19:48:25 +00:00
|
|
|
# For PowerPC there's no need to compile standalone applications as a
|
|
|
|
# relocatable executable. The relocation data is not needed, and
|
|
|
|
# also causes the entry point of the standalone application to be
|
|
|
|
# inconsistent.
|
|
|
|
ifeq ($(ARCH),powerpc)
|
|
|
|
AFLAGS := $(filter-out $(RELFLAGS),$(AFLAGS))
|
|
|
|
CFLAGS := $(filter-out $(RELFLAGS),$(CFLAGS))
|
|
|
|
CPPFLAGS := $(filter-out $(RELFLAGS),$(CPPFLAGS))
|
|
|
|
endif
|
|
|
|
|
2006-10-24 11:55:18 +00:00
|
|
|
all: $(obj).depend $(OBJS) $(LIB) $(SREC) $(BIN) $(ELF)
|
2002-04-27 11:09:31 +00:00
|
|
|
|
|
|
|
#########################################################################
|
2006-09-01 17:49:50 +00:00
|
|
|
$(LIB): $(obj).depend $(LIBOBJS)
|
2006-10-08 23:02:05 +00:00
|
|
|
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
|
2002-04-27 11:09:31 +00:00
|
|
|
|
2006-10-24 11:55:18 +00:00
|
|
|
$(ELF):
|
2006-09-01 17:49:50 +00:00
|
|
|
$(obj)%: $(obj)%.o $(LIB)
|
2009-09-04 03:12:47 +00:00
|
|
|
$(LD) -g -Ttext $(STANDALONE_LOAD_ADDR) \
|
2008-02-05 00:26:55 +00:00
|
|
|
-o $@ -e $(SYM_PREFIX)$(notdir $(<:.o=)) $< $(LIB) \
|
2006-09-01 17:49:50 +00:00
|
|
|
-L$(gcclibdir) -lgcc
|
2006-10-24 11:55:18 +00:00
|
|
|
|
|
|
|
$(SREC):
|
2006-09-01 17:49:50 +00:00
|
|
|
$(obj)%.srec: $(obj)%
|
|
|
|
$(OBJCOPY) -O srec $< $@ 2>/dev/null
|
2002-04-27 11:09:31 +00:00
|
|
|
|
2006-10-24 11:55:18 +00:00
|
|
|
$(BIN):
|
2006-09-01 17:49:50 +00:00
|
|
|
$(obj)%.bin: $(obj)%
|
|
|
|
$(OBJCOPY) -O binary $< $@ 2>/dev/null
|
2003-03-26 06:55:25 +00:00
|
|
|
|
2002-04-27 11:09:31 +00:00
|
|
|
#########################################################################
|
|
|
|
|
2006-09-01 17:49:50 +00:00
|
|
|
# defines $(obj).depend target
|
|
|
|
include $(SRCTREE)/rules.mk
|
2002-04-27 11:09:31 +00:00
|
|
|
|
2006-09-01 17:49:50 +00:00
|
|
|
sinclude $(obj).depend
|
2002-04-27 11:09:31 +00:00
|
|
|
|
|
|
|
#########################################################################
|