Makefile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #
  2. # This file is subject to the terms and conditions of the GNU General Public
  3. # License. See the file "COPYING" in the main directory of this archive
  4. # for more details.
  5. #
  6. # Copyright (C) 1995, 1998, 2001, 2002 by Ralf Baechle
  7. # Copyright (C) 2004 Maciej W. Rozycki
  8. #
  9. #
  10. # Some DECstations need all possible sections of an ECOFF executable
  11. #
  12. ifdef CONFIG_MACH_DECSTATION
  13. E2EFLAGS = -a
  14. else
  15. E2EFLAGS =
  16. endif
  17. #
  18. # Drop some uninteresting sections in the kernel.
  19. # This is only relevant for ELF kernels but doesn't hurt a.out
  20. #
  21. drop-sections = .reginfo .mdebug .comment .note .pdr .options .MIPS.options
  22. strip-flags = $(addprefix --remove-section=,$(drop-sections))
  23. VMLINUX = vmlinux
  24. all: vmlinux.ecoff vmlinux.srec addinitrd
  25. vmlinux.ecoff: $(obj)/elf2ecoff $(VMLINUX)
  26. $(obj)/elf2ecoff $(VMLINUX) vmlinux.ecoff $(E2EFLAGS)
  27. $(obj)/elf2ecoff: $(obj)/elf2ecoff.c
  28. $(HOSTCC) -o $@ $^
  29. vmlinux.bin: $(VMLINUX)
  30. $(OBJCOPY) -O binary $(strip-flags) $(VMLINUX) $(obj)/vmlinux.bin
  31. vmlinux.srec: $(VMLINUX)
  32. $(OBJCOPY) -S -O srec $(strip-flags) $(VMLINUX) $(obj)/vmlinux.srec
  33. $(obj)/addinitrd: $(obj)/addinitrd.c
  34. $(HOSTCC) -o $@ $^
  35. clean-files += addinitrd \
  36. elf2ecoff \
  37. vmlinux.bin \
  38. vmlinux.ecoff \
  39. vmlinux.srec