blob: 566aac663a38515108c78920204149f388354761 [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 Nilssona77dba62008-01-24 13:07:34 +01006ccflags-y += -O2 -I $(srctree)/include/asm/arch/mach/ \
7 -I $(srctree)/include/asm/arch
8asflags-y += -I $(srctree)/include/asm/arch/mach/ -I $(srctree)/include/asm/arch
Mikael Starvik51533b62005-07-27 11:44:44 -07009LD = gcc-cris -mlinux -march=v32 -nostdlib
Jesper Nilsson40457152008-07-14 08:59:48 +020010ldflags-y += -T $(srctree)/$(src)/rescue.lds
Jesper Nilssondbf9f142007-11-30 16:28:26 +010011LDPOSTFLAGS = -lgcc
Mikael Starvik51533b62005-07-27 11:44:44 -070012OBJCOPYFLAGS = -O binary --remove-section=.bss
Jesper Nilssondbf9f142007-11-30 16:28:26 +010013obj-$(CONFIG_ETRAX_AXISFLASHMAP) = head.o
14OBJECT := $(obj)/head.o
Mikael Starvik51533b62005-07-27 11:44:44 -070015
Jesper Nilssondbf9f142007-11-30 16:28:26 +010016targets := rescue.o rescue.bin
Mikael Starvik51533b62005-07-27 11:44:44 -070017
Jesper Nilssondbf9f142007-11-30 16:28:26 +010018quiet_cmd_ldlibgcc = LD $@
19cmd_ldlibgcc = $(LD) $(LDFLAGS) $(filter-out FORCE,$^) $(LDPOSTFLAGS) -o $@
Mikael Starvik51533b62005-07-27 11:44:44 -070020
Jesper Nilssondbf9f142007-11-30 16:28:26 +010021$(obj)/rescue.o: $(OBJECTS) FORCE
22 $(call if_changed,ldlibgcc)
Mikael Starvik51533b62005-07-27 11:44:44 -070023
Jesper Nilssondbf9f142007-11-30 16:28:26 +010024$(obj)/rescue.bin: $(obj)/rescue.o FORCE
25 $(call if_changed,objcopy)
26 cp -p $(obj)/rescue.bin $(objtree)