Makefile 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #
  2. # Builds test programs. This is launched from elf_test.BuildElfTestFiles()
  3. #
  4. # Copyright (C) 2017 Google, Inc
  5. # Written by Simon Glass <sjg@chromium.org>
  6. #
  7. # SPDX-License-Identifier: GPL-2.0+
  8. #
  9. VPATH := $(SRC)
  10. CFLAGS := -march=i386 -m32 -nostdlib -I $(SRC)../../../include \
  11. -Wl,--no-dynamic-linker
  12. LDS_UCODE := -T $(SRC)u_boot_ucode_ptr.lds
  13. LDS_BINMAN := -T $(SRC)u_boot_binman_syms.lds
  14. LDS_BINMAN_BAD := -T $(SRC)u_boot_binman_syms_bad.lds
  15. LDS_BINMAN_X86 := -T $(SRC)u_boot_binman_syms_x86.lds
  16. TARGETS = u_boot_ucode_ptr u_boot_no_ucode_ptr bss_data \
  17. u_boot_binman_syms u_boot_binman_syms.bin u_boot_binman_syms_bad \
  18. u_boot_binman_syms_size u_boot_binman_syms_x86
  19. all: $(TARGETS)
  20. u_boot_no_ucode_ptr: CFLAGS += $(LDS_UCODE)
  21. u_boot_no_ucode_ptr: u_boot_no_ucode_ptr.c
  22. u_boot_ucode_ptr: CFLAGS += $(LDS_UCODE)
  23. u_boot_ucode_ptr: u_boot_ucode_ptr.c
  24. bss_data: CFLAGS += $(SRC)bss_data.lds
  25. bss_data: bss_data.c
  26. u_boot_binman_syms.bin: u_boot_binman_syms
  27. objcopy -O binary $< -R .note.gnu.build-id $@
  28. u_boot_binman_syms: CFLAGS += $(LDS_BINMAN)
  29. u_boot_binman_syms: u_boot_binman_syms.c
  30. u_boot_binman_syms_x86: CFLAGS += $(LDS_BINMAN_X86)
  31. u_boot_binman_syms_x86: u_boot_binman_syms_x86.c
  32. u_boot_binman_syms_bad: CFLAGS += $(LDS_BINMAN_BAD)
  33. u_boot_binman_syms_bad: u_boot_binman_syms_bad.c
  34. u_boot_binman_syms_size: CFLAGS += $(LDS_BINMAN)
  35. u_boot_binman_syms_size: u_boot_binman_syms_size.c
  36. clean:
  37. rm -f $(TARGETS)
  38. help:
  39. @echo "Makefile for binman test programs"
  40. @echo
  41. @echo "Intended for use on x86 hosts"
  42. @echo
  43. @echo "Targets:"
  44. @echo
  45. @echo -e "\thelp - Print help (this is it!)"
  46. @echo -e "\tall - Builds test programs (default targget)"
  47. @echo -e "\tclean - Delete output files"