# A Makefile going to a new dimension - a combination of stuff borrowed from # buildroot by Erik Andersen , UML, and gbootroot. ##all: install BASE_DIR=${shell pwd} TARGET_DIR=$(BASE_DIR)/root BUILD_DIR=$(BASE_DIR)/staging_dir SOURCE_DIR=$(BASE_DIR)/sources ##TARGET_CC=$(BUILD_DIR)/bin/gcc ##TARGET_CC1=$(BUILD_DIR)/usr/bin/$(ARCH)-uclibc-gcc ##TARGET_CROSS=$(BUILD_DIR)/usr/bin/$(ARCH)-uclibc- ##TARGET_PATH=$(BUILD_DIR)/usr/bin:$(BUILD_DIR)/bin:/bin:/sbin:/usr/bin:/usr/sbin KERNEL=$(BASE_DIR)/user-mode-linux/usr/bin/linuxbr IMAGE=$(BASE_DIR)/root_filesystem/root_fs_helper KERNEL_DIR=$(BASE_DIR)/linux KERNEL_SOURCE=linux-2.4.19.tar.bz2 KERNEL_SITE=http://www.uk.kernel.org/pub/linux/kernel/v2.4 PATCH_1=uml-patch-2.4.19-37.bz2 PATCH_1_SITE=http://jdike.stearns.org/mirror PATCH_2=$(BASE_DIR)/user-mode-linux/usr/lib/uml/cramfs-vfs-order.patch KCONFIG=$(BASE_DIR)/user-mode-linux/usr/lib/uml/config ##UCLIBC_DIR=$(BASE_DIR)/uClibc ##UCLIBC_SOURCE=uClibc-snapshot.tar.gz ##UCLIBC_PATCH=$(SOURCE_DIR)/uClibc.patch ##UCLIBC_SITE=ftp://oss.lineo.com ##BUSYBOX_DIR=$(BASE_DIR)/busybox ##BUSYBOX_SOURCE=busybox.tar.gz ##BUSYBOX_PATCH=$(SOURCE_DIR)/busybox.patch ##BUSYBOX_SITE=http://busybox.lineo.com GENEXT2_DIR=$(BASE_DIR)/genext2fs all: world world: kernel target kernel: $(BASE_DIR) @if [ ! -d $(KERNEL_DIR) ] ; then \ while [ ! -f $(SOURCE_DIR)/$(KERNEL_SOURCE) ] ; do \ wget -P $(SOURCE_DIR) --passive $(KERNEL_SITE)/$(KERNEL_SOURCE); \ done; \ while [ ! -f $(SOURCE_DIR)/$(PATCH_1) ] ; do \ wget -P $(SOURCE_DIR) --passive $(PATCH_1_SITE)/$(PATCH_1); \ done; \ bunzip2 -c $(SOURCE_DIR)/$(KERNEL_SOURCE) | tar -xv; \ bzcat $(SOURCE_DIR)/$(PATCH_1) | patch -d $(KERNEL_DIR) -p1; \ perl -i -p -e "s/^ARCH :=.*/ARCH=um/g" $(KERNEL_DIR)/Makefile; \ fi; # @if [ ! -f $(KERNEL_DIR)/.config ] ; then \ # cp $(KCONFIG) $(KERNEL_DIR)/.config; \ # (cd $(KERNEL_DIR); make oldconfig; make dep); \ # fi; # @if [ ! -f $(KERNEL_DIR)/linux ] ; then \ # (cd $(KERNEL_DIR); make linux); \ # fi; # @cmp -s $(KERNEL) $(KERNEL_DIR)/linux; \ # if [ $$? != 0 ] ; then \ # cp -fa $(KERNEL_DIR)/linux $(KERNEL); \ # fi; mkfs: @if [ ! -f $(GENEXT2_DIR)/genext2fs ] ; then \ $(MAKE) -C $(GENEXT2_DIR); \ fi; install: install -d $(DESTDIR)/usr/bin cp -fa gbootroot $(DESTDIR)/usr/bin/gbootroot install -d $(DESTDIR)/usr/lib/bootroot cp -fa yard_chrooted_tests $(DESTDIR)/usr/lib/bootroot/yard_chrooted_tests cp -fa genext2fs/genext2fs $(DESTDIR)/usr/lib/bootroot/genext2fs cp -fa expect_uml $(DESTDIR)/usr/lib/bootroot/expect_uml install -d $(DESTDIR)/usr/lib/bootroot/root_filesystem cp -fa root_filesystem/root_fs_helper $(DESTDIR)/usr/lib/bootroot/root_filesystem cp -fa root_filesystem/Initrd.gz $(DESTDIR)/usr/lib/bootroot/root_filesystem cp -fa yard/scripts/make_debian $(DESTDIR)/usr/bin/make_debian install -d $(DESTDIR)/usr/share/perl5/BootRoot cp -fa BootRoot/*.pm $(DESTDIR)/usr/share/perl5/BootRoot install -d $(DESTDIR)/usr/share/gbootroot/yard/Replacements cp -fa yard/replacements/* $(DESTDIR)/usr/share/gbootroot/yard/Replacements install -d $(DESTDIR)/usr/lib/bootroot/yard/Replacements/lib/modules cp -fa user-mode-linux/usr/lib/uml/modules* $(DESTDIR)/usr/lib/bootroot/yard/Replacements/lib/modules cp -fa user-mode-linux/usr/lib/uml/config $(DESTDIR)/usr/lib/bootroot/yard/Replacements/lib/modules cp -fa user-mode-linux/usr/lib/uml/CVS $(DESTDIR)/usr/lib/bootroot/yard/Replacements/lib/modules/CVS install -d $(DESTDIR)/usr/lib/uml cp -fa user-mode-linux/usr/lib/uml/port-helper $(DESTDIR)/usr/lib/uml/port-helper install -d $(DESTDIR)/usr/share/gbootroot/yard/templates cp -fa yard/templates/Example* $(DESTDIR)/usr/share/gbootroot/yard/templates cp -fa yard/templates/Helper.yard $(DESTDIR)/usr/share/gbootroot/yard/templates install -d $(DESTDIR)/usr/share/gbootroot/genext2fs cp -fa genext2fs/genext2fs.c $(DESTDIR)/usr/share/gbootroot/genext2fs cp -fa genext2fs/Makefile $(DESTDIR)/usr/share/gbootroot/genext2fs cp -fa genext2fs/dev* $(DESTDIR)/usr/share/gbootroot/genext2fs cp -fa user-mode-linux/usr/bin/uml_* $(DESTDIR)/usr/bin cp -fa user-mode-linux/usr/bin/tunctl $(DESTDIR)/usr/bin/tunctl cp -fa user-mode-linux/usr/bin/linuxbr $(DESTDIR)/usr/bin/linuxbr install -d $(DESTDIR)/etc/gbootroot cp -fa gbootrootrc $(DESTDIR)/etc/gbootroot/gbootrootrc install -d $(DESTDIR)/usr/X11R6/include/X11/pixmaps cp -fa gbootroot.xpm $(DESTDIR)/usr/X11R6/include/X11/pixmaps/gbootroot.xpm install -d $(DESTDIR)/usr/share/doc/gbootroot/html/images cp -fa doc/html/{*html,*4} $(DESTDIR)/usr/share/doc/gbootroot/html cp -fa doc/html/images/{*jpg,*gif} $(DESTDIR)/usr/share/doc/gbootroot/html/images cp -fa Changes $(DESTDIR)/usr/share/doc/gbootroot/Changes remove: rm /usr/bin/gbootroot rm -rf /usr/lib/bootroot rm -rf /usr/lib/uml rm /usr/bin/make_debian rm /usr/share/perl5/BootRoot/* rmdir /usr/share/perl5/BootRoot rm -rf /usr/share/gbootroot rm /usr/bin/uml_* rm /usr/bin/tunctl rm /usr/bin/linuxbr rm /etc/gbootroot/gbootrootrc rmdir /etc/gbootroot rm /usr/X11R6/include/X11/pixmaps/gbootroot.xpm rm -rf /usr/share/doc/gbootroot