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 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Code size reduction.
  2. #
  3. CFLAGS += -fstrength-reduce -fomit-frame-pointer
  4. # Code size reduction. gcc3 needs a different syntax to gcc2 if you
  5. # want to avoid spurious warnings.
  6. #
  7. CFLAGS += -falign-jumps=1 -falign-loops=1 -falign-functions=1
  8. # Force 64-bit code
  9. #
  10. CFLAGS += -m64
  11. ASFLAGS += --64
  12. LDFLAGS += -m elf_x86_64
  13. # Prevent use of MMX and SSE registers
  14. #
  15. CFLAGS += -mno-mmx -mno-sse
  16. # EFI requires -fshort-wchar, and nothing else currently uses wchar_t
  17. #
  18. CFLAGS += -fshort-wchar
  19. # We need to undefine the default macro "i386" when compiling .S
  20. # files, otherwise ".arch i386" translates to ".arch 1"...
  21. #
  22. CFLAGS += -Ui386
  23. # Add -maccumulate-outgoing-args if required by this version of gcc
  24. #
  25. ifeq ($(CCTYPE),gcc)
  26. MS_ABI_TEST_CODE := extern void __attribute__ (( ms_abi )) ms_abi(); \
  27. void sysv_abi ( void ) { ms_abi(); }
  28. MS_ABI_TEST = $(ECHO) '$(MS_ABI_TEST_CODE)' | \
  29. $(CC) -m64 -mno-accumulate-outgoing-args -x c -c - -o /dev/null \
  30. >/dev/null 2>&1
  31. MS_ABI_FLAGS := $(shell $(MS_ABI_TEST) || $(ECHO) '-maccumulate-outgoing-args')
  32. WORKAROUND_CFLAGS += $(MS_ABI_FLAGS)
  33. endif
  34. # x86_64-specific directories containing source files
  35. #
  36. SRCDIRS += arch/x86_64/core
  37. SRCDIRS += arch/x86_64/prefix
  38. # Include common x86 Makefile
  39. #
  40. MAKEDEPS += arch/x86/Makefile
  41. include arch/x86/Makefile
  42. # Include platform-specific Makefile
  43. #
  44. MAKEDEPS += arch/x86_64/Makefile.$(PLATFORM)
  45. include arch/x86_64/Makefile.$(PLATFORM)