Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 1 | # |
Jesper Nilsson | dbf9f14 | 2007-11-30 16:28:26 +0100 | [diff] [blame] | 2 | # Makefile for rescue (bootstrap) code |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 3 | # |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 4 | |
| 5 | CC = gcc-cris -mlinux -march=v32 $(LINUXINCLUDE) |
Jesper Nilsson | a77dba6 | 2008-01-24 13:07:34 +0100 | [diff] [blame] | 6 | ccflags-y += -O2 -I $(srctree)/include/asm/arch/mach/ \ |
| 7 | -I $(srctree)/include/asm/arch |
| 8 | asflags-y += -I $(srctree)/include/asm/arch/mach/ -I $(srctree)/include/asm/arch |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 9 | LD = gcc-cris -mlinux -march=v32 -nostdlib |
Jesper Nilsson | 4045715 | 2008-07-14 08:59:48 +0200 | [diff] [blame] | 10 | ldflags-y += -T $(srctree)/$(src)/rescue.lds |
Jesper Nilsson | dbf9f14 | 2007-11-30 16:28:26 +0100 | [diff] [blame] | 11 | LDPOSTFLAGS = -lgcc |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 12 | OBJCOPYFLAGS = -O binary --remove-section=.bss |
Jesper Nilsson | dbf9f14 | 2007-11-30 16:28:26 +0100 | [diff] [blame] | 13 | obj-$(CONFIG_ETRAX_AXISFLASHMAP) = head.o |
| 14 | OBJECT := $(obj)/head.o |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 15 | |
Jesper Nilsson | dbf9f14 | 2007-11-30 16:28:26 +0100 | [diff] [blame] | 16 | targets := rescue.o rescue.bin |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 17 | |
Jesper Nilsson | dbf9f14 | 2007-11-30 16:28:26 +0100 | [diff] [blame] | 18 | quiet_cmd_ldlibgcc = LD $@ |
| 19 | cmd_ldlibgcc = $(LD) $(LDFLAGS) $(filter-out FORCE,$^) $(LDPOSTFLAGS) -o $@ |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 20 | |
Jesper Nilsson | dbf9f14 | 2007-11-30 16:28:26 +0100 | [diff] [blame] | 21 | $(obj)/rescue.o: $(OBJECTS) FORCE |
| 22 | $(call if_changed,ldlibgcc) |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 23 | |
Jesper Nilsson | dbf9f14 | 2007-11-30 16:28:26 +0100 | [diff] [blame] | 24 | $(obj)/rescue.bin: $(obj)/rescue.o FORCE |
| 25 | $(call if_changed,objcopy) |
| 26 | cp -p $(obj)/rescue.bin $(objtree) |