blob: 43260e7720071e2ae30ca8bf2ea53a78be6f7a18 [file] [log] [blame]
Mikael Starvik51533b62005-07-27 11:44:44 -07001#
Jesper Nilssondbf9f142007-11-30 16:28:26 +01002# Makefile for rescue (bootstrap) code
Mikael Starvik51533b62005-07-27 11:44:44 -07003#
Mikael Starvik51533b62005-07-27 11:44:44 -07004
5CC = gcc-cris -mlinux -march=v32 $(LINUXINCLUDE)
Jesper Nilssondbf9f142007-11-30 16:28:26 +01006EXTRA_CFLAGS = -O2
7AFLAGS += -I $(TOPDIR)/include/asm/arch/mach/ -I $(TOPDIR)/include/asm/arch
8EXTRA_CFLAGS += -I $(TOPDIR)/include/asm/arch/mach/ -I $(TOPDIR)/include/asm/arch
Mikael Starvik51533b62005-07-27 11:44:44 -07009LD = gcc-cris -mlinux -march=v32 -nostdlib
Jesper Nilssondbf9f142007-11-30 16:28:26 +010010LDFLAGS = -T $(obj)/rescue.ld
11LDPOSTFLAGS = -lgcc
Mikael Starvik51533b62005-07-27 11:44:44 -070012OBJCOPY = objcopy-cris
13OBJCOPYFLAGS = -O binary --remove-section=.bss
Jesper Nilssondbf9f142007-11-30 16:28:26 +010014obj-$(CONFIG_ETRAX_AXISFLASHMAP) = head.o
15OBJECT := $(obj)/head.o
Mikael Starvik51533b62005-07-27 11:44:44 -070016
Jesper Nilssondbf9f142007-11-30 16:28:26 +010017targets := rescue.o rescue.bin
Mikael Starvik51533b62005-07-27 11:44:44 -070018
Jesper Nilssondbf9f142007-11-30 16:28:26 +010019quiet_cmd_ldlibgcc = LD $@
20cmd_ldlibgcc = $(LD) $(LDFLAGS) $(filter-out FORCE,$^) $(LDPOSTFLAGS) -o $@
Mikael Starvik51533b62005-07-27 11:44:44 -070021
Jesper Nilssondbf9f142007-11-30 16:28:26 +010022$(obj)/rescue.o: $(OBJECTS) FORCE
23 $(call if_changed,ldlibgcc)
Mikael Starvik51533b62005-07-27 11:44:44 -070024
Jesper Nilssondbf9f142007-11-30 16:28:26 +010025$(obj)/rescue.bin: $(obj)/rescue.o FORCE
26 $(call if_changed,objcopy)
27 cp -p $(obj)/rescue.bin $(objtree)