diff --git a/Makefile b/Makefile index 1bd7762..ca841ef 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ version = "39" base_dir = $(shell pwd) image_repo = "ghcr.io/ublue-os" image_name = "base-main" +subdir = "lorax_templates xorriso" deploy.iso: boot.iso xorriso/input.txt $(image_name)-$(version) xorriso -dialog on < xorriso/input.txt @@ -25,3 +26,12 @@ $(image_name)-$(version): install-deps: dnf install -y lorax xorriso podman git rpm-ostree + +clean: + rm -f boot.iso + rm -f deploy.iso + rm -Rf $(image_name)-$(version) + for dir in $(subdir) ; do \ + $(MAKE) -C $$dir clean ; \ + done + diff --git a/lorax_templates/Makefile b/lorax_templates/Makefile index 8607fe5..3e165b1 100644 --- a/lorax_templates/Makefile +++ b/lorax_templates/Makefile @@ -1,4 +1,7 @@ %.tmpl: - sed -i 's/@IMAGE_NAME@/$(image_name)' $* - sed -i 's/@IMAGE_REPO@/$(image_repo)' $* - sed -i 's/@VERSION@/$(version)' $* \ No newline at end of file + sed 's/@IMAGE_NAME@/$(image_name)' $*.in > $* + sed 's/@IMAGE_REPO@/$(image_repo)' $* > $* + sed 's/@VERSION@/$(version)' $* $* + +clean: + rm *.tmpl \ No newline at end of file diff --git a/lorax_templates/configure_upgrades.tmpl b/lorax_templates/configure_upgrades.tmpl.in similarity index 100% rename from lorax_templates/configure_upgrades.tmpl rename to lorax_templates/configure_upgrades.tmpl.in diff --git a/lorax_templates/set_installer.tmpl b/lorax_templates/set_installer.tmpl.in similarity index 100% rename from lorax_templates/set_installer.tmpl rename to lorax_templates/set_installer.tmpl.in diff --git a/xorriso/Makefile b/xorriso/Makefile index 7dbdba9..8d78fb3 100644 --- a/xorriso/Makefile +++ b/xorriso/Makefile @@ -1,4 +1,9 @@ -input.txt: - sed -i 's/@IMAGE_NAME@/$(image_name)-$(version)/' gen_input.sh - cd $(base_dir) - bash gen_input.sh > input.txt \ No newline at end of file +input.txt: gen_input.sh + bash gen_input.sh "$(base_dir)" > input.txt + +%.sh: + sed 's/@IMAGE_NAME@/$(image_name)-$(version)/' $*.in > $* + +clean: + rm input.txt + rm gen_input.sh \ No newline at end of file diff --git a/xorriso/gen_input.sh b/xorriso/gen_input.sh.in similarity index 98% rename from xorriso/gen_input.sh rename to xorriso/gen_input.sh.in index bf06031..e230ab7 100644 --- a/xorriso/gen_input.sh +++ b/xorriso/gen_input.sh.in @@ -6,6 +6,7 @@ echo "-boot_image any replay" echo "-volid Fedora-S-dvd-x86_64-39" echo "-joliet on" echo "-compliance joliet_long_names" +cd $1 for file in $(find @IMAGE_NAME@) do echo "-map $(pwd)/${file} ${file}"