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.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. # EFI requires -fshort-wchar, and nothing else currently uses wchar_t
  14. #
  15. CFLAGS += -fshort-wchar
  16. # We need to undefine the default macro "i386" when compiling .S
  17. # files, otherwise ".arch i386" translates to ".arch 1"...
  18. #
  19. CFLAGS += -Ui386
  20. # Add -maccumulate-outgoing-args if required by this version of gcc
  21. #
  22. ifeq ($(CCTYPE),gcc)
  23. MS_ABI_TEST_CODE := extern void __attribute__ (( ms_abi )) ms_abi(); \
  24. void sysv_abi ( void ) { ms_abi(); }
  25. MS_ABI_TEST = $(ECHO) '$(MS_ABI_TEST_CODE)' | \
  26. $(CC) -m64 -mno-accumulate-outgoing-args -x c -c - -o /dev/null \
  27. >/dev/null 2>&1
  28. MS_ABI_FLAGS := $(shell $(MS_ABI_TEST) || $(ECHO) '-maccumulate-outgoing-args')
  29. WORKAROUND_CFLAGS += $(MS_ABI_FLAGS)
  30. endif
  31. # x86_64-specific directories containing source files
  32. #
  33. SRCDIRS += arch/x86_64/core
  34. SRCDIRS += arch/x86_64/prefix
  35. # Include common x86 Makefile
  36. #
  37. MAKEDEPS += arch/x86/Makefile
  38. include arch/x86/Makefile
  39. # Include platform-specific Makefile
  40. #
  41. MAKEDEPS += arch/x86_64/Makefile.$(PLATFORM)
  42. include arch/x86_64/Makefile.$(PLATFORM)