makefile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # This file is part of PrawnOS (https://www.prawnos.com)
  2. # Copyright (c) 2018 Hal Emmerich <hal@halemmerich.com>
  3. # PrawnOS is free software: you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License version 2
  5. # as published by the Free Software Foundation.
  6. # PrawnOS is distributed in the hope that it will be useful,
  7. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. # GNU General Public License for more details.
  10. # You should have received a copy of the GNU General Public License
  11. # along with PrawnOS. If not, see <https://www.gnu.org/licenses/>.
  12. .DEFAULT_GOAL := image
  13. PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel)
  14. include $(PRAWNOS_ROOT)/scripts/BuildScripts/BuildCommon.mk
  15. include $(PRAWNOS_ROOT)/initramfs/makefile
  16. include $(PRAWNOS_ROOT)/kernel/makefile
  17. include $(PRAWNOS_ROOT)/filesystem/makefile
  18. #Usage:
  19. #run make image
  20. #this will generate two images named PRAWNOS_IMAGE and PRAWNOS_IMAGE-BASE
  21. #-BASE is only the filesystem with no kernel.
  22. #if you make any changes to the kernel or kernel config with make kernel_config
  23. #run kernel_inject
  24. #:::::::::::::::::::::::::::::: cleaning ::::::::::::::::::::::::::::::
  25. .PHONY: clean
  26. clean:
  27. @echo "Enter one of:"
  28. #TODO
  29. .PHONY: clean_image
  30. clean_image:
  31. rm -f $(PRAWNOS_IMAGE)
  32. .PHONY: clean_basefs
  33. clean_basefs:
  34. rm -f $(PRAWNOS_IMAGE_BASE)
  35. .PHONY: clean_pbuilder
  36. clean_pbuilder:
  37. rm -r build/prawnos-pbuilder-armhf-base.tgz
  38. .PHONY: clean_all
  39. clean_all: clean_kernel clean_ath9k clean_image clean_basefs clean_pbuilder
  40. #:::::::::::::::::::::::::::::: premake prep ::::::::::::::::::::::::::::::
  41. .PHONY: build_dirs
  42. build_dirs: $(PRAWNOS_BUILD)
  43. #:::::::::::::::::::::::::::::: kernel ::::::::::::::::::::::::::::::::::::
  44. #included from kernel/makefile
  45. #:::::::::::::::::::::::::::::: initramfs :::::::::::::::::::::::::::::::::
  46. #included from initramfs/makefile
  47. #:::::::::::::::::::::::::::::: filesystem ::::::::::::::::::::::::::::::::
  48. #makes the base filesystem image without kernel. Only make a new one if the base image isnt present
  49. #included from filesystem/makefile
  50. #:::::::::::::::::::::::::::::: packages ::::::::::::::::::::::::::::::::
  51. #included from filesystem/makefile
  52. #:::::::::::::::::::::::::::::: image management ::::::::::::::::::::::::::
  53. .PHONY: kernel_install
  54. kernel_install: #Targets an already built .img and swaps the old kernel with the newly compiled kernel
  55. $(PRAWNOS_IMAGE_SCRIPTS_INSTALL_KERNEL) $(KVER) $(PRAWNOS_IMAGE)
  56. .PHONY: kernel_update
  57. kernel_update:
  58. $(MAKE) clean_image
  59. $(MAKE) initramfs
  60. $(MAKE) kernel
  61. cp $(PRAWNOS_IMAGE_BASE) $(PRAWNOS_IMAGE)
  62. $(MAKE) kernel_install
  63. .PHONY: image
  64. image:
  65. $(MAKE) clean_image
  66. $(MAKE) filesystem
  67. $(MAKE) initramfs
  68. $(MAKE) kernel
  69. cp $(PRAWNOS_IMAGE_BASE) $(PRAWNOS_IMAGE)
  70. $(MAKE) kernel_install