Makefile.arm 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # Makefile.arm -- with config changes.
  2. # Copyright 1990 W. Jolitz
  3. # from: @(#)Makefile.i386 7.1 5/10/91
  4. # $FreeBSD$
  5. #
  6. # Makefile for FreeBSD
  7. #
  8. # This makefile is constructed from a machine description:
  9. # config machineid
  10. # Most changes should be made in the machine description
  11. # /sys/arm/conf/``machineid''
  12. # after which you should do
  13. # config machineid
  14. # Generic makefile changes should be made in
  15. # /sys/conf/Makefile.arm
  16. # after which config should be rerun for all machines.
  17. #
  18. # Which version of config(8) is required.
  19. %VERSREQ= 600013
  20. STD8X16FONT?= iso
  21. .if !defined(S)
  22. .if exists(./@/.)
  23. S= ./@
  24. .else
  25. S= ../../..
  26. .endif
  27. .endif
  28. .include "$S/conf/kern.pre.mk"
  29. INCLUDES+= -I$S/contrib/libfdt -I$S/contrib/device-tree/include
  30. LINUX_DTS_VERSION!= awk '/freebsd,dts-version/ { sub(/;$$/,"", $$NF); print $$NF }' $S/dts/freebsd-compatible.dts
  31. CFLAGS += -DLINUX_DTS_VERSION=\"${LINUX_DTS_VERSION}\"
  32. .if !defined(DEBUG) && !defined(PROFLEVEL)
  33. STRIP_FLAGS = -S
  34. .endif
  35. # We don't support gcc's thump interwork stuff, so disable it
  36. CFLAGS.gcc += -mno-thumb-interwork
  37. # We generally don't want fpu instructions in the kernel.
  38. CFLAGS.clang += -mfpu=none
  39. .if !empty(DDB_ENABLED)
  40. CFLAGS += -funwind-tables
  41. .endif
  42. # "makeoptions KERNVIRTADDR=" is now optional, supply the default value.
  43. .if empty(KERNVIRTADDR)
  44. KERNVIRTADDR= 0xc0000000
  45. .endif
  46. # Use a custom SYSTEM_LD command to generate the elf kernel, so we can
  47. # set the text segment start address, and also strip the "arm mapping
  48. # symbols" which have names like $a.0 and $d.2; see the document
  49. # "ELF for the ARM architecture" for more info on the mapping symbols.
  50. SYSTEM_LD= \
  51. ${SYSTEM_LD_BASECMD} \
  52. --defsym='text_start=kernbase + SIZEOF_HEADERS' \
  53. -o ${.TARGET} ${SYSTEM_OBJS} vers.o; \
  54. $(OBJCOPY) \
  55. --wildcard \
  56. --strip-symbol='$$[adt]*' \
  57. ${.TARGET}
  58. # Generate the .bin (no elf headers) kernel as an extra build output.
  59. # We must relink to generate the .bin kernel, because without headers the
  60. # location of everything changes. We also strip the ARM marker symbols.
  61. KERNEL_EXTRA+= ${KERNEL_KO}.bin
  62. KERNEL_EXTRA_INSTALL+= ${KERNEL_KO}.bin
  63. ${KERNEL_KO}.bin: ${SYSTEM_DEP} vers.o
  64. @echo "linking ${.TARGET}"
  65. @${SYSTEM_LD_BASECMD} \
  66. --defsym='text_start=kernbase' \
  67. -o ${.TARGET} ${SYSTEM_OBJS} vers.o
  68. ${SIZE} ${.TARGET}
  69. @${OBJCOPY} \
  70. --wildcard \
  71. --strip-symbol='$$[adt]*' \
  72. --output-target=binary \
  73. ${.TARGET}
  74. @chmod 755 ${.TARGET}
  75. # hack because genassym.c includes sys/bus.h which includes these.
  76. genassym.o: bus_if.h device_if.h
  77. %BEFORE_DEPEND
  78. %OBJS
  79. %FILES.c
  80. %FILES.s
  81. %FILES.m
  82. %CLEAN
  83. CLEAN+= ${KERNEL_KO}.bin
  84. %RULES
  85. .include "$S/conf/kern.post.mk"