build-tf.mak 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. CROSS_COMPILE := aarch64-linux-gnu-
  2. output_dir := $(PWD)/../bin
  3. makejobs := $(nproc)
  4. makethreads := $(shell dc -e "$(makejobs) 1 + p")
  5. make_options := GCC49_AARCH64_PREFIX=$CROSS_COMPILE \
  6. -j$(makethreads) -l$(makejobs)
  7. BL30_HIKEY := $(output_dir)/mcuimage.bin
  8. BL33_HIKEY := $(output_dir)/u-boot-hikey.bin
  9. .PHONY: help
  10. help:
  11. @echo "**** Common Makefile ****"
  12. @echo "example:"
  13. @echo "make -f build-tf.mak build"
  14. .PHONY: have-crosscompiler
  15. have-crosscompiler:
  16. @echo -n "Check that $(CROSS_COMPILE)gcc is available..."
  17. @which $(CROSS_COMPILE)gcc > /dev/null ; \
  18. if [ ! $$? -eq 0 ] ; then \
  19. echo "ERROR: cross-compiler $(CROSS_COMPILE)gcc not in PATH=$$PATH!" ; \
  20. echo "ABORTING." ; \
  21. exit 1 ; \
  22. else \
  23. echo "OK" ;\
  24. fi
  25. build: have-crosscompiler FORCE
  26. @echo "Build TF for Hikey..."
  27. rm -rf build/
  28. CROSS_COMPILE=$(CROSS_COMPILE) \
  29. make all fip \
  30. BL30=$(BL30_HIKEY) \
  31. BL33=$(BL33_HIKEY) \
  32. DEBUG=1 \
  33. PLAT=hikey
  34. @echo "Copy resulting binaries..."
  35. cp build/hikey/debug/bl1.bin $(output_dir)/bl1-hikey.bin
  36. cp build/hikey/debug/fip.bin $(output_dir)/fip-hikey.bin
  37. FORCE: