1# $Id: Makefile,v 1.10 2000/02/23 08:17:46 jj Exp $ 2# Makefile for the Sparc boot stuff. 3# 4# Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 5# Copyright (C) 1997,1998 Jakub Jelinek (jj@ultra.linux.cz) 6 7ROOT_IMG := /usr/src/root.img 8ELFTOAOUT := elftoaout 9 10hostprogs-y := piggyback btfixupprep 11targets := tftpboot.img btfix.o btfix.S image 12 13quiet_cmd_elftoaout = ELFTOAOUT $@ 14 cmd_elftoaout = $(ELFTOAOUT) $(obj)/image -o $@ 15quiet_cmd_piggy = PIGGY $@ 16 cmd_piggy = $(obj)/piggyback $@ $(obj)/System.map $(ROOT_IMG) 17quiet_cmd_btfix = BTFIX $@ 18 cmd_btfix = $(OBJDUMP) -x vmlinux | $(obj)/btfixupprep > $@ 19quiet_cmd_sysmap = SYSMAP $(obj)/System.map 20 cmd_sysmap = $(CONFIG_SHELL) $(srctree)/scripts/mksysmap 21quiet_cmd_image = LD $@ 22 cmd_image = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) -o $@ 23 24define rule_image 25 $(if $($(quiet)cmd_image), \ 26 echo ' $($(quiet)cmd_image)' &&) \ 27 $(cmd_image); \ 28 $(if $($(quiet)cmd_sysmap), \ 29 echo ' $($(quiet)cmd_sysmap)' &&) \ 30 $(cmd_sysmap) $@ $(obj)/System.map; \ 31 if [ $$? -ne 0 ]; then \ 32 rm -f $@; \ 33 /bin/false; \ 34 fi; \ 35 echo 'cmd_$@ := $(cmd_image)' > $(@D)/.$(@F).cmd 36endef 37 38BTOBJS := $(HEAD_Y) $(INIT_Y) 39BTLIBS := $(CORE_Y) $(LIBS_Y) $(DRIVERS_Y) $(NET_Y) 40LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds $(BTOBJS) \ 41 --start-group $(BTLIBS) --end-group \ 42 $(kallsyms.o) $(obj)/btfix.o 43 44# Link the final image including btfixup'ed symbols. 45# This is a replacement for the link done in the top-level Makefile. 46# Note: No dependency on the prerequisite files since that would require 47# make to try check if they are updated - and due to changes 48# in gcc options (path for example) this would result in 49# these files being recompiled for each build. 50$(obj)/image: $(obj)/btfix.o FORCE 51 $(call if_changed_rule,image) 52 53$(obj)/tftpboot.img: $(obj)/piggyback $(obj)/System.map $(obj)/image FORCE 54 $(call if_changed,elftoaout) 55 $(call if_changed,piggy) 56 57$(obj)/btfix.S: $(obj)/btfixupprep vmlinux FORCE 58 $(call if_changed,btfix) 59