You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. # -*- makefile -*- : Force emacs to use Makefile mode
  2. # BIOS-specific directories containing source files
  3. #
  4. SRCDIRS += arch/x86/drivers/net
  5. # The i386 linker script
  6. #
  7. LDSCRIPT = arch/x86/scripts/pcbios.lds
  8. # Stop ld from complaining about our customised linker script
  9. #
  10. LDFLAGS += -N --no-check-sections
  11. # Prefix always starts at address zero
  12. #
  13. LDFLAGS += --section-start=.prefix=0
  14. # Media types.
  15. #
  16. MEDIA += rom
  17. MEDIA += mrom
  18. MEDIA += pcirom
  19. MEDIA += isarom
  20. MEDIA += pxe
  21. MEDIA += kpxe
  22. MEDIA += kkpxe
  23. MEDIA += kkkpxe
  24. MEDIA += lkrn
  25. MEDIA += dsk
  26. MEDIA += nbi
  27. MEDIA += hd
  28. MEDIA += raw
  29. MEDIA += exe
  30. # Padding rules
  31. #
  32. PAD_rom = $(PERL) $(PADIMG) --blksize=512 --byte=0xff
  33. PAD_mrom = $(PAD_rom)
  34. PAD_pcirom = $(PAD_rom)
  35. PAD_isarom = $(PAD_rom)
  36. PAD_dsk = $(PERL) $(PADIMG) --blksize=512
  37. PAD_hd = $(PERL) $(PADIMG) --blksize=32768
  38. PAD_exe = $(PERL) $(PADIMG) --blksize=512
  39. # Finalisation rules
  40. #
  41. FINALISE_rom = $(PERL) $(FIXROM)
  42. FINALISE_mrom = $(FINALISE_rom)
  43. FINALISE_pcirom = $(FINALISE_rom)
  44. FINALISE_isarom = $(FINALISE_rom)
  45. # Use $(ROMS) rather than $(DRIVERS) for "allroms", "allmroms", etc.
  46. #
  47. LIST_NAME_rom := ROMS
  48. LIST_NAME_mrom := ROMS
  49. LIST_NAME_pcirom := ROMS
  50. LIST_NAME_isarom := ROMS
  51. # Locations of isolinux files
  52. #
  53. SYSLINUX_DIR_LIST := \
  54. /usr/lib/syslinux \
  55. /usr/lib/syslinux/bios \
  56. /usr/lib/syslinux/modules/bios \
  57. /usr/share/syslinux \
  58. /usr/share/syslinux/bios \
  59. /usr/share/syslinux/modules/bios \
  60. /usr/local/share/syslinux \
  61. /usr/local/share/syslinux/bios \
  62. /usr/local/share/syslinux/modules/bios \
  63. /usr/lib/ISOLINUX
  64. ISOLINUX_BIN_LIST := \
  65. $(ISOLINUX_BIN) \
  66. $(patsubst %,%/isolinux.bin,$(SYSLINUX_DIR_LIST))
  67. LDLINUX_C32_LIST := \
  68. $(LDLINUX_C32) \
  69. $(patsubst %,%/ldlinux.c32,$(SYSLINUX_DIR_LIST))
  70. ISOLINUX_BIN = $(firstword $(wildcard $(ISOLINUX_BIN_LIST)))
  71. LDLINUX_C32 = $(firstword $(wildcard $(LDLINUX_C32_LIST)))
  72. # rule to make a non-emulation ISO boot image
  73. NON_AUTO_MEDIA += iso
  74. %iso: %lkrn util/geniso
  75. $(QM)$(ECHO) " [GENISO] $@"
  76. $(Q)ISOLINUX_BIN=$(ISOLINUX_BIN) LDLINUX_C32=$(LDLINUX_C32) \
  77. VERSION="$(VERSION)" bash util/geniso -o $@ $<
  78. # rule to make a floppy emulation ISO boot image
  79. NON_AUTO_MEDIA += liso
  80. %liso: %lkrn util/geniso
  81. $(QM)$(ECHO) " [GENISO] $@"
  82. $(Q)VERSION="$(VERSION)" bash util/geniso -l -o $@ $<
  83. # rule to make a syslinux floppy image (mountable, bootable)
  84. NON_AUTO_MEDIA += sdsk
  85. %sdsk: %lkrn util/gensdsk
  86. $(QM)$(ECHO) " [GENSDSK] $@"
  87. $(Q)bash util/gensdsk $@ $<
  88. # rule to write disk images to /dev/fd0
  89. NON_AUTO_MEDIA += fd0
  90. %fd0 : %dsk
  91. $(QM)$(ECHO) " [DD] $@"
  92. $(Q)dd if=$< bs=512 conv=sync of=/dev/fd0
  93. $(Q)sync
  94. # Special target for building Master Boot Record binary
  95. $(BIN)/mbr.tmp : $(BIN)/mbr.o
  96. $(QM)$(ECHO) " [LD] $@"
  97. $(Q)$(LD) $(LDFLAGS) -o $@ -e mbr $<
  98. # rule to make a USB disk image
  99. $(BIN)/usbdisk.tmp : $(BIN)/usbdisk.o
  100. $(QM)$(ECHO) " [LD] $@"
  101. $(Q)$(LD) $(LDFLAGS) -o $@ -e mbr $<
  102. NON_AUTO_MEDIA += usb
  103. %usb: $(BIN)/usbdisk.bin %hd
  104. $(QM)$(ECHO) " [FINISH] $@"
  105. $(Q)cat $^ > $@
  106. NON_AUTO_MEDIA += vhd
  107. %vhd: %usb
  108. $(QM)$(ECHO) " [FINISH] $@"
  109. $(Q)$(QEMUIMG) convert -f raw -O vpc $< $@
  110. # Padded floppy image (e.g. for iLO)
  111. NON_AUTO_MEDIA += pdsk
  112. %pdsk : %dsk
  113. $(Q)cp $< $@
  114. $(Q)$(PADIMG) --blksize=1474560 $@