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.

Makefile 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. # Locations of utilities
  2. #
  3. ISOLINUX_BIN = /usr/lib/syslinux/isolinux.bin
  4. # i386-specific directories containing source files
  5. #
  6. SRCDIRS += arch/i386/core arch/i386/transitions arch/i386/prefix
  7. SRCDIRS += arch/i386/firmware/pcbios
  8. SRCDIRS += arch/i386/image
  9. SRCDIRS += arch/i386/drivers/bus
  10. SRCDIRS += arch/i386/drivers/net
  11. SRCDIRS += arch/i386/drivers/disk
  12. SRCDIRS += arch/i386/interface/pcbios
  13. SRCDIRS += arch/i386/interface/pxe
  14. # The various xxx_loader.c files are #included into core/loader.c and
  15. # should not be compiled directly.
  16. #
  17. NON_AUTO_SRCS += arch/i386/core/aout_loader.c
  18. NON_AUTO_SRCS += arch/i386/core/freebsd_loader.c
  19. NON_AUTO_SRCS += arch/i386/core/wince_loader.c
  20. # unnrv2b.S is used to generate a 16-bit as well as a 32-bit object.
  21. #
  22. OBJS_unnrv2b = unnrv2b unnrv2b16
  23. CFLAGS_unnrv2b16 = -DCODE16
  24. # We need to undefine the default macro "i386" when compiling .S
  25. # files, otherwise ".arch i386" translates to ".arch 1"...
  26. #
  27. CFLAGS_S += -Ui386
  28. # The i386 linker script
  29. #
  30. LDSCRIPT = arch/i386/scripts/i386.lds
  31. # Media types.
  32. #
  33. # It's ugly that we have to define these repetitive combinations by
  34. # hand. Unforunately, $(eval ...) is available only in make >= 3.80,
  35. # and using an external Makefile fragment doesn't work because
  36. # OBJS_xxx need to be defined *before* the external Makefile fragments
  37. # for the source files are generated...
  38. CFLAGS_ZPREFIX = -DCOMPRESS
  39. MEDIA += rom
  40. OBJS_romprefix = romprefix zromprefix
  41. CFLAGS_zromprefix = $(CFLAGS_ZPREFIX)
  42. MEDIA += pxe
  43. OBJS_pxeprefix = pxeprefix zpxeprefix
  44. CFLAGS_zpxeprefix = $(CFLAGS_ZPREFIX)
  45. MEDIA += elf
  46. OBJS_elfprefix = elfprefix zelfprefix
  47. CFLAGS_zelfprefix = $(CFLAGS_ZPREFIX)
  48. MEDIA += elfd
  49. OBJS_elfdprefix = elfdprefix zelfdprefix
  50. CFLAGS_zelfdprefix = $(CFLAGS_ZPREFIX)
  51. MEDIA += lmelf
  52. OBJS_lmelfprefix = lmelfprefix zlmelfprefix
  53. CFLAGS_zlmelfprefix = $(CFLAGS_ZPREFIX)
  54. MEDIA += lmelfd
  55. OBJS_lmelfdprefix = lmelfdprefix zlmelfdprefix
  56. CFLAGS_zlmelfdprefix = $(CFLAGS_ZPREFIX)
  57. MEDIA += lilo
  58. OBJS_liloprefix = liloprefix zliloprefix
  59. CFLAGS_zliloprefix = $(CFLAGS_ZPREFIX)
  60. MEDIA += bImage
  61. OBJS_bImageprefix = bImageprefix zbImageprefix
  62. CFLAGS_zbImageprefix = $(CFLAGS_ZPREFIX)
  63. MEDIA += dsk
  64. OBJS_dskprefix = dskprefix zdskprefix
  65. CFLAGS_zdskprefix = $(CFLAGS_ZPREFIX)
  66. MEDIA += nbi
  67. OBJS_nbiprefix = nbiprefix znbiprefix
  68. CFLAGS_znbiprefix = $(CFLAGS_ZPREFIX)
  69. MEDIA += hd
  70. OBJS_hdprefix = hdprefix zhdprefix
  71. CFLAGS_zhdprefix = $(CFLAGS_ZPREFIX)
  72. MEDIA += raw
  73. OBJS_rawprefix = rawprefix zrawprefix
  74. CFLAGS_zrawprefix = $(CFLAGS_ZPREFIX)
  75. # These media cannot handle compressed payloads
  76. MEDIA += com
  77. MEDIA += exe
  78. # Special target for building Master Boot Record binary
  79. $(BIN)/mbr.bin : $(BIN)/mbr.o
  80. $(OBJCOPY) -O binary $< $@
  81. # Some suffixes (e.g. %.zfd0) are generated directly from other
  82. # finished files (e.g. %.zdsk), rather than having their own prefix.
  83. # rule to write disk images to /dev/fd0
  84. NON_AUTO_MEDIA += fd0
  85. %fd0 : %dsk
  86. dd if=$< bs=512 conv=sync of=/dev/fd0
  87. sync
  88. # rule to create padded disk images
  89. NON_AUTO_MEDIA += pdsk
  90. %pdsk : %dsk
  91. cp $< $@
  92. $(PERL) ./util/dskpad.pl $@
  93. # rule to make a non-emulation ISO boot image
  94. NON_AUTO_MEDIA += iso
  95. %iso: %lilo util/geniso
  96. ISOLINUX_BIN=$(ISOLINUX_BIN) bash util/geniso $@ $<
  97. # rule to make a floppy emulation ISO boot image
  98. NON_AUTO_MEDIA += liso
  99. %liso: %lilo util/genliso
  100. bash util/genliso $@ $<
  101. # rule to make a USB disk image
  102. $(BIN)/usbdisk.bin : $(BIN)/usbdisk.o
  103. $(OBJCOPY) -O binary $< $@
  104. NON_AUTO_MEDIA += usb
  105. %usb: $(BIN)/usbdisk.bin %hd
  106. cat $^ > $@
  107. # Add NON_AUTO_MEDIA to the media list, so that they show up in the
  108. # output of "make"
  109. #
  110. MEDIA += $(NON_AUTO_MEDIA)
  111. # Shortcut to allow typing just
  112. # make bin-kir/%
  113. # rather than
  114. # make -f arch/i386/kir-Makefile bin-kir/%
  115. # for building a KEEP_IT_REAL flavour.
  116. #
  117. $(BIN)-kir/% : kir-target
  118. $(MAKE) -f arch/i386/kir-Makefile $(MAKECMDGOALS)
  119. .PHONY : kir-target