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 | dbf9f14 | 2007-11-30 16:28:26 +0100 | [diff] [blame^] | 6 | EXTRA_CFLAGS = -O2 |
| 7 | AFLAGS += -I $(TOPDIR)/include/asm/arch/mach/ -I $(TOPDIR)/include/asm/arch |
| 8 | EXTRA_CFLAGS += -I $(TOPDIR)/include/asm/arch/mach/ -I $(TOPDIR)/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 | dbf9f14 | 2007-11-30 16:28:26 +0100 | [diff] [blame^] | 10 | LDFLAGS = -T $(obj)/rescue.ld |
| 11 | LDPOSTFLAGS = -lgcc |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 12 | OBJCOPY = objcopy-cris |
| 13 | OBJCOPYFLAGS = -O binary --remove-section=.bss |
Jesper Nilsson | dbf9f14 | 2007-11-30 16:28:26 +0100 | [diff] [blame^] | 14 | obj-$(CONFIG_ETRAX_AXISFLASHMAP) = head.o |
| 15 | OBJECT := $(obj)/head.o |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 16 | |
Jesper Nilsson | dbf9f14 | 2007-11-30 16:28:26 +0100 | [diff] [blame^] | 17 | targets := rescue.o rescue.bin |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 18 | |
Jesper Nilsson | dbf9f14 | 2007-11-30 16:28:26 +0100 | [diff] [blame^] | 19 | quiet_cmd_ldlibgcc = LD $@ |
| 20 | cmd_ldlibgcc = $(LD) $(LDFLAGS) $(filter-out FORCE,$^) $(LDPOSTFLAGS) -o $@ |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 21 | |
Jesper Nilsson | dbf9f14 | 2007-11-30 16:28:26 +0100 | [diff] [blame^] | 22 | $(obj)/rescue.o: $(OBJECTS) FORCE |
| 23 | $(call if_changed,ldlibgcc) |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 24 | |
Jesper Nilsson | dbf9f14 | 2007-11-30 16:28:26 +0100 | [diff] [blame^] | 25 | $(obj)/rescue.bin: $(obj)/rescue.o FORCE |
| 26 | $(call if_changed,objcopy) |
| 27 | cp -p $(obj)/rescue.bin $(objtree) |