Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

Makefile 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. # Force i386-only instructions
  2. #
  3. CFLAGS += -march=i386
  4. # Code size reduction.
  5. #
  6. CFLAGS += -fomit-frame-pointer
  7. # Code size reduction.
  8. #
  9. ifeq ($(CCTYPE),gcc)
  10. CFLAGS += -fstrength-reduce
  11. endif
  12. # Code size reduction. gcc3 needs a different syntax to gcc2 if you
  13. # want to avoid spurious warnings.
  14. #
  15. ifeq ($(CCTYPE),gcc)
  16. GCC_VERSION := $(subst ., ,$(shell $(CC) -dumpversion))
  17. GCC_MAJOR := $(firstword $(GCC_VERSION))
  18. ifeq ($(GCC_MAJOR),2)
  19. CFLAGS += -malign-jumps=1 -malign-loops=1 -malign-functions=1
  20. else
  21. CFLAGS += -falign-jumps=1 -falign-loops=1 -falign-functions=1
  22. endif # gcc2
  23. endif # gcc
  24. # Code size reduction. This is almost always a win. The kernel uses
  25. # it, too.
  26. #
  27. ifeq ($(CCTYPE),gcc)
  28. CFLAGS += -mpreferred-stack-boundary=2
  29. endif
  30. # Code size reduction. Use regparm for all functions - C functions
  31. # called from assembly (or vice versa) need __asmcall now
  32. #
  33. CFLAGS += -mregparm=3
  34. # Code size reduction. Use -mrtd (same __asmcall requirements as above)
  35. ifeq ($(CCTYPE),gcc)
  36. CFLAGS += -mrtd
  37. endif
  38. # Code size reduction. This is the logical complement to -mregparm=3.
  39. # It doesn't currently buy us anything, but if anything ever tries to
  40. # return small structures, let's be prepared
  41. #
  42. CFLAGS += -freg-struct-return
  43. # Force 32-bit code even on an x86-64 machine
  44. #
  45. CFLAGS += -m32
  46. ASFLAGS += --32
  47. ifeq ($(HOST_OS),FreeBSD)
  48. LDFLAGS += -m elf_i386_fbsd
  49. else ifeq ($(HOST_OS),OpenBSD)
  50. LDFLAGS += -m elf_i386_obsd
  51. else
  52. LDFLAGS += -m elf_i386
  53. endif
  54. # EFI requires -fshort-wchar, and nothing else currently uses wchar_t
  55. #
  56. CFLAGS += -fshort-wchar
  57. # We need to undefine the default macro "i386" when compiling .S
  58. # files, otherwise ".arch i386" translates to ".arch 1"...
  59. #
  60. CFLAGS += -Ui386
  61. # Some widespread patched versions of gcc include -fPIE -Wl,-pie by
  62. # default. Note that gcc will exit *successfully* if it fails to
  63. # recognise an option that starts with "no", so we have to test for
  64. # output on stderr instead of checking the exit status.
  65. #
  66. ifeq ($(CCTYPE),gcc)
  67. PIE_TEST = [ -z "`$(CC) -fno-PIE -nopie -x c -c /dev/null -o /dev/null 2>&1`" ]
  68. PIE_FLAGS := $(shell $(PIE_TEST) && $(ECHO) '-fno-PIE -nopie')
  69. WORKAROUND_CFLAGS += $(PIE_FLAGS)
  70. endif
  71. # Define version string for lkrnprefix.S
  72. #
  73. CFLAGS_lkrnprefix += -DVERSION="\"$(VERSION)\""
  74. # Locations of utilities
  75. #
  76. ISOLINUX_BIN_LIST := \
  77. $(ISOLINUX_BIN) \
  78. /usr/lib/syslinux/isolinux.bin \
  79. /usr/lib/syslinux/bios/isolinux.bin \
  80. /usr/share/syslinux/isolinux.bin \
  81. /usr/share/syslinux/bios/isolinux.bin \
  82. /usr/local/share/syslinux/isolinux.bin \
  83. /usr/local/share/syslinux/bios/isolinux.bin \
  84. /usr/lib/ISOLINUX/isolinux.bin
  85. ISOLINUX_BIN = $(firstword $(wildcard $(ISOLINUX_BIN_LIST)))
  86. # i386-specific directories containing source files
  87. #
  88. SRCDIRS += arch/i386/core arch/i386/transitions arch/i386/prefix
  89. SRCDIRS += arch/i386/firmware/pcbios
  90. SRCDIRS += arch/i386/image
  91. SRCDIRS += arch/i386/interface/pcbios
  92. SRCDIRS += arch/i386/interface/pxe
  93. SRCDIRS += arch/i386/interface/pxeparent
  94. SRCDIRS += arch/i386/interface/syslinux
  95. SRCDIRS += arch/i386/interface/vmware
  96. SRCDIRS += arch/i386/hci/commands
  97. # Include common x86 Makefile
  98. #
  99. MAKEDEPS += arch/x86/Makefile
  100. include arch/x86/Makefile
  101. # Include platform-specific Makefile
  102. #
  103. MAKEDEPS += arch/i386/Makefile.$(PLATFORM)
  104. include arch/i386/Makefile.$(PLATFORM)