Makefile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # Makefile for FunKey-OS
  2. #
  3. # Copyright (C) 2020 by Michel Stempin <michel.stempin@funkey-project.com>
  4. #
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. # General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. #
  19. BRMAKE = buildroot/utils/brmake -C buildroot
  20. BR = make -C buildroot
  21. .PHONY: fun source image clean distclean
  22. .IGNORE: Makefile
  23. all: fun image
  24. fun: download Recovery/output/.config FunKey/output/.config
  25. @echo "*** Making fun"
  26. $(BRMAKE) BR2_EXTERNAL=../Recovery O=../Recovery/output
  27. $(BRMAKE) BR2_EXTERNAL=../FunKey O=../FunKey/output
  28. FunKey/%: download FunKey/output/.config
  29. @echo "*** Making $(notdir $@) in $(subst /,,$(dir $@))"
  30. $(BR) BR2_EXTERNAL=../FunKey O=../FunKey/output $(notdir $@)
  31. Recovery/%: download Recovery/output/.config
  32. @echo "*** Making $(notdir $@) in $(subst /,,$(dir $@))"
  33. $(BR) BR2_EXTERNAL=../Recovery O=../Recovery/output $(notdir $@)
  34. %: download FunKey/output/.config
  35. @echo "*** Making $* in FunKey"
  36. $(BR) BR2_EXTERNAL=../FunKey O=../FunKey/output $*
  37. source:
  38. @echo "*** Getting sources"
  39. $(BR) BR2_EXTERNAL=../Recovery O=../Recovery/output source
  40. $(BR) BR2_EXTERNAL=../FunKey O=../FunKey/output source
  41. image:
  42. mkdir -p root tmp
  43. ./Recovery/output/host/bin/genimage --inputpath .
  44. rm -rf root tmp
  45. clean:
  46. @echo "*** Clean everything"
  47. $(BR) BR2_EXTERNAL=../Recovery O=../Recovery/output distclean
  48. $(BR) BR2_EXTERNAL=../FunKey O=../FunKey/output distclean
  49. distclean: clean
  50. @echo "*** Really clean everything"
  51. rm -rf download images
  52. download:
  53. @echo "*** Making download directory"
  54. mkdir -rf download
  55. FunKey/output/.config:
  56. @echo "*** Configure FunKey"
  57. $(BR) BR2_EXTERNAL=../FunKey O=../FunKey/output funkey_defconfig
  58. Recovery/output/.config:
  59. @echo "*** Configure Recovery"
  60. $(BR) BR2_EXTERNAL=../Recovery O=../Recovery/output recovery_defconfig