mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-18 13:26:27 +00:00
7ac46dd621
Debian has dropped mkisofs long time ago, hence hardcoding it prevents Genode from being built on Debian easily. This patch makes the tool configurable (defaulting to mkisofs). Building on Debian can then be done by something like: ISOTOOL=genisoimage make run/foobar Fixes #2234 Fixes #2235
71 lines
2.0 KiB
Makefile
Executable File
71 lines
2.0 KiB
Makefile
Executable File
#!/usr/bin/make -f
|
|
#
|
|
# \brief ISO image creation tool
|
|
# \author Christian Helmuth
|
|
# \date 2009-02-05
|
|
|
|
ISO ?= genode
|
|
ISOTOOL ?= mkisofs
|
|
ISODIR = $(abspath $(ISO))
|
|
ISOIMG = $(abspath $(ISO).iso)
|
|
|
|
default help:
|
|
@echo "--- available commands ---"
|
|
@echo "iso - create ISO image of directory \"$(ISO)\""
|
|
@echo "tiny.iso - create tiny ISO image of directory \"$(ISO)\""
|
|
@echo "compress - create bzip2 compressed ISO image"
|
|
@echo "clean - cleanup everything"
|
|
@echo
|
|
@echo "--- configuration options ---"
|
|
@echo "ISO=<name> Overwrites basename of cd image file."
|
|
@echo
|
|
@echo "Please, place your binaries and config files in appropriate subdirectories in"
|
|
@echo " $(ISODIR)"
|
|
@echo "and adapt"
|
|
@echo " $(ISODIR)/boot/grub/menu.lst"
|
|
@echo "to your configuration's needs."
|
|
|
|
#
|
|
# Function to generate bootable ISO images
|
|
#
|
|
# parameter 1 filename of ISO image
|
|
# parameter 2 path of directory containing file tree for the ISO image
|
|
#
|
|
gen_iso_image = $(ISOTOOL) -f -l -R -hide-rr-moved -jcharset utf-8 \
|
|
-no-emul-boot -boot-load-size 4 -boot-info-table \
|
|
-b boot/isolinux/isolinux.bin \
|
|
-o $(1) $(2)
|
|
|
|
$(ISOIMG) iso:
|
|
@$(call gen_iso_image, $(ISOIMG) $(ISODIR))
|
|
@isohybrid $(ISOIMG)
|
|
|
|
STRIP_FILES = $(wildcard genode/*) $(wildcard pistachio/*)
|
|
|
|
#
|
|
# Compact all files in a directory using strip and gzip
|
|
#
|
|
# parameter 1 directory containing the files to strip and gzip
|
|
#
|
|
compact_files = for f in `find $(1) -type f`; do \
|
|
strip $$f -o strip.tmp; \
|
|
gzip -c strip.tmp > $$f; \
|
|
done; rm -f strip.tmp
|
|
|
|
tiny.iso:
|
|
@rm -rf $(@:.iso=.dir)
|
|
@cp -Lrp $(ISODIR) $(@:.iso=.dir)
|
|
@$(call compact_files, $(@:.iso=.dir)/fiasco)
|
|
@$(call compact_files, $(@:.iso=.dir)/pistachio)
|
|
@$(call compact_files, $(@:.iso=.dir)/genode)
|
|
@$(call gen_iso_image, $@ $(@:.iso=.dir))
|
|
@rm -rf $(@:.iso=.dir)
|
|
|
|
compress: $(ISOIMG)
|
|
@bzip2 -f -c $< > $).bz2
|
|
|
|
clean:
|
|
@rm -rf tiny.dir tiny.iso $(ISOIMG)
|
|
|
|
.PHONY: $(ISOIMG) tiny.iso clean
|