makefile 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ifndef FILESYSTEM_MK
  2. FILESYSTEM_MK := 1
  3. ifndef PRAWNOS_ROOT
  4. PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel)
  5. endif
  6. include $(PRAWNOS_ROOT)/scripts/BuildScripts/BuildCommon.mk
  7. FS_BUILD_LOG := $(PRAWNOS_BUILD_LOGS)/fs-log.txt
  8. PRAWNOS_FILESYSTEM_PACKAGES := $(PRAWNOS_FILESYSTEM)/packages
  9. PACKAGES_BUILT := $(PRAWNOS_FILESYSTEM_PACKAGES)/.packages_built
  10. .PHONY: filesystem \
  11. pbuilder_create \
  12. pbuilder_update \
  13. filesystem_packages \
  14. filesystem_packages_clean \
  15. filesystem_packages_install
  16. ### Filesystem Image
  17. filesystem: $(PRAWNOS_IMAGE_BASE)
  18. ### Packages
  19. filesystem_packages: $(PRAWNOS_BUILD)
  20. filesystem_packages_clean:
  21. $(MAKE) -C $(PRAWNOS_FILESYSTEM_PACKAGES) clean
  22. rm -f $(PRAWNOS_PACKAGES_BUILT)
  23. filesystem_packages_install:
  24. ifndef INSTALL_TARGET
  25. $(error INSTALL_TARGET is not set)
  26. endif
  27. $(MAKE) -C $(PRAWNOS_FILESYSTEM_PACKAGES) INSTALL_TARGET=$(INSTALL_TARGET) install
  28. ### Pbuilder
  29. pbuilder_create: $(PBUILDER_CHROOT)
  30. #TODO: should only update if not updated for a day
  31. pbuilder_update: $(PBUILDER_CHROOT)
  32. @echo UPDATING $(PBUILDER_CHROOT)
  33. pbuilder update --basetgz $(PBUILDER_CHROOT) --configfile $(PBUILDER_RC)
  34. ### REAL TARGETS
  35. $(PACKAGES_BUILT): $(PRAWNOS_BUILD) $(PBUILDER_CHROOT)
  36. $(MAKE) -C $(PRAWNOS_FILESYSTEM_PACKAGES) all
  37. touch $(PACKAGES_BUILT)
  38. $(PBUILDER_CHROOT): $(PRAWNOS_BUILD)
  39. @echo BUILDING $(PBUILDER_CHROOT)
  40. pbuilder create --basetgz $(PBUILDER_CHROOT) --configfile $(PBUILDER_RC)
  41. $(PRAWNOS_IMAGE_BASE): $(PRAWNOS_BUILD) $(PACKAGES_BUILT)
  42. rm -rf $(FS_BUILD_LOG)
  43. $(PRAWNOS_FILESYSTEM_SCRIPTS_BUILD) $(KVER) $(DEBIAN_SUITE) $(PRAWNOS_IMAGE_BASE) $(PRAWNOS_ROOT) $(PRAWNOS_SHARED_SCRIPTS) $(PRAWNOS_FILESYSTEM_RESOURCES) 2>&1 | tee $(FS_BUILD_LOG)
  44. endif