2020-06-30 05:39:56 +02:00
i f n d e f F I L E S Y S T E M _ M K
FILESYSTEM_MK := 1
i f n d e f P R A W N O S _ R O O T
PRAWNOS_ROOT := $( shell git rev-parse --show-toplevel)
e n d i f
i n c l u d e $( PRAWNOS_ROOT ) / s c r i p t s / B u i l d S c r i p t s / B u i l d C o m m o n . m k
FS_BUILD_LOG := $( PRAWNOS_BUILD_LOGS) /fs-log.txt
PRAWNOS_FILESYSTEM_PACKAGES := $( PRAWNOS_FILESYSTEM) /packages
PACKAGES_BUILT := $( PRAWNOS_FILESYSTEM_PACKAGES) /.packages_built
.PHONY : filesystem \
pbuilder_create \
pbuilder_update \
filesystem_packages \
filesystem_packages_clean \
filesystem_packages_install
### Filesystem Image
filesystem : $( PRAWNOS_IMAGE_BASE )
### Packages
filesystem_packages : $( PRAWNOS_BUILD )
2020-06-21 09:28:45 +02:00
filesystem_packages_clean :
2020-06-30 05:39:56 +02:00
$( MAKE) -C $( PRAWNOS_FILESYSTEM_PACKAGES) clean
rm -f $( PRAWNOS_PACKAGES_BUILT)
2020-06-21 09:28:45 +02:00
filesystem_packages_install :
2020-06-30 05:39:56 +02:00
i f n d e f I N S T A L L _ T A R G E T
$( error INSTALL_TARGET is not set )
e n d i f
$( MAKE) -C $( PRAWNOS_FILESYSTEM_PACKAGES) INSTALL_TARGET = $( INSTALL_TARGET) install
### Pbuilder
pbuilder_create : $( PBUILDER_CHROOT )
#TODO: should only update if not updated for a day
pbuilder_update : $( PBUILDER_CHROOT )
@echo UPDATING $( PBUILDER_CHROOT)
pbuilder update --basetgz $( PBUILDER_CHROOT) --configfile $( PBUILDER_RC)
### REAL TARGETS
2020-07-01 04:27:49 +02:00
$(PACKAGES_BUILT) : $( PRAWNOS_BUILD ) $( PBUILDER_CHROOT )
2020-06-30 05:39:56 +02:00
$( MAKE) -C $( PRAWNOS_FILESYSTEM_PACKAGES) all
touch $( PACKAGES_BUILT)
$(PBUILDER_CHROOT) : $( PRAWNOS_BUILD )
@echo BUILDING $( PBUILDER_CHROOT)
pbuilder create --basetgz $( PBUILDER_CHROOT) --configfile $( PBUILDER_RC)
$(PRAWNOS_IMAGE_BASE) : $( PRAWNOS_BUILD ) $( PACKAGES_BUILT )
rm -rf $( FS_BUILD_LOG)
$( PRAWNOS_FILESYSTEM_SCRIPTS_BUILD) $( KVER) $( DEBIAN_SUITE) $( PRAWNOS_IMAGE_BASE) $( PRAWNOS_ROOT) $( PRAWNOS_SHARED_SCRIPTS) $( PRAWNOS_FILESYSTEM_RESOURCES) 2>& 1 | tee $( FS_BUILD_LOG)
e n d i f