Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #
  2. # Builds test programs
  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. CFLAGS := -march=i386 -m32 -nostdlib -I ../../../include
  10. LDS_UCODE := -T u_boot_ucode_ptr.lds
  11. LDS_BINMAN := -T u_boot_binman_syms.lds
  12. LDS_BINMAN_BAD := -T u_boot_binman_syms_bad.lds
  13. TARGETS = u_boot_ucode_ptr u_boot_no_ucode_ptr bss_data \
  14. u_boot_binman_syms u_boot_binman_syms.bin u_boot_binman_syms_bad \
  15. u_boot_binman_syms_size
  16. all: $(TARGETS)
  17. u_boot_no_ucode_ptr: CFLAGS += $(LDS_UCODE)
  18. u_boot_no_ucode_ptr: u_boot_no_ucode_ptr.c
  19. u_boot_ucode_ptr: CFLAGS += $(LDS_UCODE)
  20. u_boot_ucode_ptr: u_boot_ucode_ptr.c
  21. bss_data: CFLAGS += bss_data.lds
  22. bss_data: bss_data.c
  23. u_boot_binman_syms.bin: u_boot_binman_syms
  24. objcopy -O binary $< -R .note.gnu.build-id $@
  25. u_boot_binman_syms: CFLAGS += $(LDS_BINMAN)
  26. u_boot_binman_syms: u_boot_binman_syms.c
  27. u_boot_binman_syms_bad: CFLAGS += $(LDS_BINMAN_BAD)
  28. u_boot_binman_syms_bad: u_boot_binman_syms_bad.c
  29. u_boot_binman_syms_size: CFLAGS += $(LDS_BINMAN)
  30. u_boot_binman_syms_size: u_boot_binman_syms_size.c
  31. clean:
  32. rm -f $(TARGETS)
  33. help:
  34. @echo "Makefile for binman test programs"
  35. @echo
  36. @echo "Intended for use on x86 hosts"
  37. @echo
  38. @echo "Targets:"
  39. @echo
  40. @echo -e "\thelp - Print help (this is it!)"
  41. @echo -e "\tall - Builds test programs (default targget)"
  42. @echo -e "\tclean - Delete output files"