Makefile 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # SPDX-License-Identifier: GPL-2.0
  2. #
  3. # linux/arch/arm/boot/bootp/Makefile
  4. #
  5. # This file is included by the global makefile so that you can add your own
  6. # architecture-specific flags and dependencies.
  7. #
  8. ifdef PHYS_OFFSET
  9. add_hex = $(shell printf 0x%x $$(( $(1) + $(2) )) )
  10. # If PHYS_OFFSET is set, INITRD_PHYS and PARAMS_PHYS can be derived,
  11. # otherwise they must be passed on the command line.
  12. #
  13. # Note: the following conditions must always be true:
  14. # PARAMS_PHYS must be within 4MB of ZRELADDR
  15. # INITRD_PHYS must be in RAM
  16. PARAMS_PHYS := $(call add_hex, $(PHYS_OFFSET), 0x100)
  17. # guess an initrd location if possible
  18. initrd_offset-$(CONFIG_ARCH_FOOTBRIDGE) += 0x00800000
  19. initrd_offset-$(CONFIG_ARCH_SA1100) += 0x00800000
  20. initrd_offset-$(CONFIG_ARCH_RPC) += 0x08000000
  21. INITRD_OFFSET := $(initrd_offset-y)
  22. ifdef INITRD_OFFSET
  23. INITRD_PHYS := $(call add_hex, $(PHYS_OFFSET), $(INITRD_OFFSET))
  24. endif
  25. endif
  26. PHONY += initrd
  27. initrd:
  28. @test "$(PARAMS_PHYS)" != "" || \
  29. (echo bootpImage: You must specify PHYS_OFFSET of PARAMS_PHYS ; exit -1)
  30. @test "$(INITRD_PHYS)" != "" || \
  31. (echo bootpImage: You must specify INITRD_OFFSET or INITRD_PHYS ; exit -1)
  32. @test "$(INITRD)" != "" || \
  33. (echo bootpImage: You must specify INITRD; exit -1)
  34. LDFLAGS_bootp := --no-undefined -X \
  35. --defsym initrd_phys=$(INITRD_PHYS) \
  36. --defsym params_phys=$(PARAMS_PHYS) -T
  37. AFLAGS_initrd.o :=-DINITRD=\"$(INITRD)\"
  38. targets := bootp init.o kernel.o initrd.o
  39. # Note that bootp.lds picks up kernel.o and initrd.o
  40. $(obj)/bootp: $(src)/bootp.lds $(addprefix $(obj)/,init.o kernel.o initrd.o) FORCE
  41. $(call if_changed,ld)
  42. # kernel.o and initrd.o includes a binary image using
  43. # .incbin, a dependency which is not tracked automatically
  44. $(obj)/kernel.o: arch/arm/boot/zImage FORCE
  45. $(obj)/initrd.o: initrd $(INITRD) FORCE
  46. PHONY += $(INITRD)