Changeset 41f7564 in mainline for boot


Ignore:
Timestamp:
2006-07-17T00:53:53Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
231fcb2
Parents:
41c4444
Message:

cleanup and unify the build system

Location:
boot
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • boot/Makefile

    r41c4444 r41f7564  
    3030#
    3131
     32-include ../version
    3233-include Makefile.config
    3334
    34 ## Common flags
     35## Paths
    3536#
    3637
     
    3839KERNELDIR = $(BASE)/kernel
    3940USPACEDIR = $(BASE)/uspace
    40 
    41 ## Setup arch configuration
    42 #
    43 
    44 -include arch/$(ARCH)/Makefile.inc
    45 
    46 ifeq ($(ARCH),xen32)
    47         UARCH = ia32
    48 else
    49         UARCH = $(ARCH)
    50 endif
    5141
    5242ifeq ($(CONFIG_DEBUG),y)
     
    5848endif
    5949
    60 .PHONY: all build config distclean arch_distclean clean kernel uspace clean_kernel clean_uspace distclean_kernel distclean_uspace
     50.PHONY: all build config distclean clean generic_clean
    6151
    6252all:
    63         tools/config.py default
    64         $(MAKE) -C . build $(ARCH)
     53        ../tools/config.py boot.config default $(ARCH) $(COMPILER) $(CONFIG_DEBUG) $(IMAGE)
     54        $(MAKE) -C . build
     55
     56-include arch/$(ARCH)/Makefile.inc
    6557
    6658config:
    67         tools/config.py
     59        ../tools/config.py boot.config
    6860
    69 distclean: clean arch_distclean
     61distclean: clean
    7062        -rm Makefile.config
    7163
    72 kernel:
    73         $(MAKE) -C $(KERNELDIR) NARCH=$(ARCH)
    74 
    75 uspace:
    76         $(MAKE) -C $(USPACEDIR) NARCH=$(UARCH)
    77 
    78 clean_kernel:
    79         $(MAKE) -C $(KERNELDIR) clean ARCH=$(ARCH)
    80 
    81 clean_uspace:
    82         $(MAKE) -C $(USPACEDIR) clean ARCH=$(UARCH)
    83 
    84 clean_boot_gen:
     64generic_clean:
    8565        -rm generic/*.o genarch/*.o
    86 
    87 distclean_kernel:
    88         $(MAKE) -C $(KERNELDIR) distclean ARCH=$(ARCH)
    89 
    90 distclean_uspace:
    91         $(MAKE) -C $(USPACEDIR) distclean ARCH=$(UARCH)
  • boot/arch/amd64/Makefile.inc

    r41c4444 r41f7564  
    2727#
    2828
    29 build: image.iso
     29TASKS = \
     30        $(USPACEDIR)/init/init \
     31        $(USPACEDIR)/ns/ns \
     32        $(USPACEDIR)/pci/pci \
     33        $(USPACEDIR)/fb/fb \
     34        $(USPACEDIR)/kbd/kbd \
     35        $(USPACEDIR)/console/console \
     36        $(USPACEDIR)/tetris/tetris \
     37        $(USPACEDIR)/ipcc/ipcc \
     38        $(USPACEDIR)/klog/klog
    3039
    31 image.iso: kernel uspace
     40build: $(BASE)/image.iso
     41
     42$(BASE)/image.iso: arch/$(ARCH)/grub/stage2_eltorito arch/$(ARCH)/grub/menu.lst $(KERNELDIR)/kernel.bin $(TASKS)
    3243        mkdir -p arch/$(ARCH)/iso/boot/grub
    3344        cp arch/$(ARCH)/grub/stage2_eltorito arch/$(ARCH)/iso/boot/grub/
    3445        cp arch/$(ARCH)/grub/menu.lst arch/$(ARCH)/iso/boot/grub/
    3546        cp $(KERNELDIR)/kernel.bin arch/$(ARCH)/iso/boot/
    36         cp $(USPACEDIR)/init/init arch/$(ARCH)/iso/boot/
    37         cp $(USPACEDIR)/ns/ns arch/$(ARCH)/iso/boot/
    38         cp $(USPACEDIR)/pci/pci arch/$(ARCH)/iso/boot/
    39         cp $(USPACEDIR)/fb/fb arch/$(ARCH)/iso/boot/
    40         cp $(USPACEDIR)/kbd/kbd arch/$(ARCH)/iso/boot/
    41         cp $(USPACEDIR)/console/console arch/$(ARCH)/iso/boot/
    42         cp $(USPACEDIR)/tetris/tetris arch/$(ARCH)/iso/boot/
    43         cp $(USPACEDIR)/ipcc/ipcc arch/$(ARCH)/iso/boot/
    44         cp $(USPACEDIR)/klog/klog arch/$(ARCH)/iso/boot/
    45         mkisofs -J -r -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o image.iso arch/$(ARCH)/iso/
     47        for task in $(TASKS) ; do \
     48                cp $$task arch/$(ARCH)/iso/boot/ ; \
     49        done
     50        mkisofs -J -r -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o $(BASE)/image.iso arch/$(ARCH)/iso/
    4651
    47 clean: clean_kernel clean_uspace
     52clean:
    4853        -rm -fr arch/$(ARCH)/iso
    49         -rm -f image.iso
    50 
    51 arch_distclean: distclean_kernel distclean_uspace
     54        -rm -f $(BASE)/image.iso
  • boot/arch/ia32/Makefile.inc

    r41c4444 r41f7564  
    2727#
    2828
    29 build: image.iso
     29TASKS = \
     30        $(USPACEDIR)/init/init \
     31        $(USPACEDIR)/ns/ns \
     32        $(USPACEDIR)/pci/pci \
     33        $(USPACEDIR)/fb/fb \
     34        $(USPACEDIR)/kbd/kbd \
     35        $(USPACEDIR)/console/console \
     36        $(USPACEDIR)/tetris/tetris \
     37        $(USPACEDIR)/ipcc/ipcc \
     38        $(USPACEDIR)/klog/klog
    3039
    31 image.iso: kernel uspace
     40build: $(BASE)/image.iso
     41
     42$(BASE)/image.iso: arch/$(ARCH)/grub/stage2_eltorito arch/$(ARCH)/grub/menu.lst $(KERNELDIR)/kernel.bin $(TASKS)
    3243        mkdir -p arch/$(ARCH)/iso/boot/grub
    3344        cp arch/$(ARCH)/grub/stage2_eltorito arch/$(ARCH)/iso/boot/grub/
    3445        cp arch/$(ARCH)/grub/menu.lst arch/$(ARCH)/iso/boot/grub/
    3546        cp $(KERNELDIR)/kernel.bin arch/$(ARCH)/iso/boot/
    36         cp $(USPACEDIR)/init/init arch/$(ARCH)/iso/boot/
    37         cp $(USPACEDIR)/ns/ns arch/$(ARCH)/iso/boot/
    38         cp $(USPACEDIR)/pci/pci arch/$(ARCH)/iso/boot/
    39         cp $(USPACEDIR)/fb/fb arch/$(ARCH)/iso/boot/
    40         cp $(USPACEDIR)/kbd/kbd arch/$(ARCH)/iso/boot/
    41         cp $(USPACEDIR)/console/console arch/$(ARCH)/iso/boot/
    42         cp $(USPACEDIR)/tetris/tetris arch/$(ARCH)/iso/boot/
    43         cp $(USPACEDIR)/ipcc/ipcc arch/$(ARCH)/iso/boot/
    44         cp $(USPACEDIR)/klog/klog arch/$(ARCH)/iso/boot/
    45         mkisofs -J -r -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o image.iso arch/$(ARCH)/iso/
     47        for task in $(TASKS) ; do \
     48                cp $$task arch/$(ARCH)/iso/boot/ ; \
     49        done
     50        mkisofs -J -r -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o $(BASE)/image.iso arch/$(ARCH)/iso/
    4651
    47 clean: clean_kernel clean_uspace
     52clean:
    4853        -rm -fr arch/$(ARCH)/iso
    49         -rm -f image.iso
    50 
    51 arch_distclean: distclean_kernel distclean_uspace
     54        -rm -f $(BASE)/image.iso
  • boot/arch/ia64/Makefile.inc

    r41c4444 r41f7564  
    2727#
    2828
    29 VMAXLMA_SRC=$(KERNELDIR)/contrib/arch/ia64/vmaxlma.c
     29VMAXLMA_SRC = tools/ia64/vmaxlma.c
    3030
    31 build: kernel.bin
     31build: $(BASE)/kernel.bin
    3232
    33 kernel.bin: kernel uspace vmaxlma
    34         cp $(KERNELDIR)/kernel.bin .
    35         ./vmaxlma kernel.bin
     33$(BASE)/kernel.bin: $(KERNELDIR)/kernel.bin vmaxlma
     34        cp $(KERNELDIR)/kernel.bin $(BASE)/kernel.bin
     35        ./vmaxlma $(BASE)/kernel.bin
    3636
    3737vmaxlma: $(VMAXLMA_SRC)
    38         gcc $(VMAXLMA_SRC) -o $@
     38        $(CC) $(VMAXLMA_SRC) -o $@
    3939
    40 clean: clean_kernel clean_uspace
    41         -rm -f kernel.bin vmaxlma
    42 
    43 arch_distclean: distclean_kernel distclean_uspace
     40clean:
     41        -rm -f $(BASE)/kernel.bin vmaxlma
  • boot/arch/mips32/Makefile.inc

    r41c4444 r41f7564  
    2727#
    2828
    29 build: image.boot
     29build: $(BASE)/image.boot
    3030
    31 image.boot: kernel uspace
    32         make -C arch/$(ARCH)/loader COMPILER=$(COMPILER) KERNELDIR=../../../$(KERNELDIR) USPACEDIR=../../../$(USPACEDIR) IMAGE=$(CONFIG_IMAGE)
    33         cp arch/$(ARCH)/loader/image.boot image.boot
     31$(BASE)/image.boot: depend arch/$(ARCH)/loader/image.boot
     32        cp arch/$(ARCH)/loader/image.boot $(BASE)/image.boot
    3433
    35 clean: clean_boot_gen clean_kernel clean_uspace
    36         make -C arch/$(ARCH)/loader clean
    37         -rm -f image.boot
     34depend:
     35        -rm arch/$(ARCH)/loader/image.boot
    3836
    39 arch_distclean: distclean_kernel distclean_uspace
     37arch/$(ARCH)/loader/image.boot:
     38        make -C arch/$(ARCH)/loader COMPILER=$(COMPILER) KERNELDIR=../../../$(KERNELDIR) USPACEDIR=../../../$(USPACEDIR) IMAGE=$(IMAGE)
     39
     40clean:
     41        make -C arch/$(ARCH)/loader clean COMPILER=$(COMPILER) KERNELDIR=../../../$(KERNELDIR) USPACEDIR=../../../$(USPACEDIR) IMAGE=$(IMAGE)
     42        -rm -f $(BASE)/image.boot
  • boot/arch/ppc32/Makefile.inc

    r41c4444 r41f7564  
    2727#
    2828
    29 build: image.boot
     29build: $(BASE)/image.boot
    3030
    31 image.boot: kernel uspace
     31$(BASE)/image.boot: depend arch/$(ARCH)/loader/image.boot
     32        cp arch/$(ARCH)/loader/image.boot $(BASE)/image.boot
     33
     34depend:
     35        -rm arch/$(ARCH)/loader/image.boot
     36
     37arch/$(ARCH)/loader/image.boot:
    3238        make -C arch/$(ARCH)/loader COMPILER=$(COMPILER) KERNELDIR=../../../$(KERNELDIR) USPACEDIR=../../../$(USPACEDIR) "DEFS=$(DEFS)"
    33         cp arch/$(ARCH)/loader/image.boot image.boot
    3439
    35 clean: clean_boot_gen clean_kernel clean_uspace
    36         make -C arch/$(ARCH)/loader clean KERNELDIR=../../../$(KERNELDIR) USPACEDIR=../../../$(USPACEDIR)
    37         -rm -f image.boot
    38 
    39 arch_distclean: distclean_kernel distclean_uspace
     40clean: generic_clean
     41        make -C arch/$(ARCH)/loader clean COMPILER=$(COMPILER) KERNELDIR=../../../$(KERNELDIR) USPACEDIR=../../../$(USPACEDIR) "DEFS=$(DEFS)"
     42        -rm -f $(BASE)/image.boot
  • boot/arch/ppc64/Makefile.inc

    r41c4444 r41f7564  
    2727#
    2828
    29 build: image.boot
     29build: $(BASE)/image.boot
    3030
    31 image.boot: kernel uspace
     31$(BASE)/image.boot: depend arch/$(ARCH)/loader/image.boot
     32        cp arch/$(ARCH)/loader/image.boot $(BASE)/image.boot
     33
     34depend:
     35        -rm arch/$(ARCH)/loader/image.boot
     36
     37arch/$(ARCH)/loader/image.boot:
    3238        make -C arch/$(ARCH)/loader COMPILER=$(COMPILER) KERNELDIR=../../../$(KERNELDIR) USPACEDIR=../../../$(USPACEDIR)
    33         cp arch/$(ARCH)/loader/image.boot image.boot
    3439
    35 clean: clean_boot_gen clean_kernel clean_uspace
    36         make -C arch/$(ARCH)/loader clean KERNELDIR=../../../$(KERNELDIR) USPACEDIR=../../../$(USPACEDIR)
    37         -rm -f image.boot
    38 
    39 arch_distclean: distclean_kernel distclean_uspace
     40clean: generic_clean
     41        make -C arch/$(ARCH)/loader clean COMPILER=$(COMPILER) KERNELDIR=../../../$(KERNELDIR) USPACEDIR=../../../$(USPACEDIR)
     42        -rm -f $(BASE)/image.boot
  • boot/arch/sparc64/Makefile.inc

    r41c4444 r41f7564  
    2929TMP=distroot
    3030
    31 build: image.iso
     31build: $(BASE)/image.iso
    3232
    33 image.iso: kernel
    34         make -C arch/$(ARCH)/loader COMPILER=$(COMPILER) KERNELDIR=../../../$(KERNELDIR) USPACEDIR=../../../$(USPACEDIR) IMAGE=$(CONFIG_IMAGE)
     33$(BASE)/image.iso: depend arch/$(ARCH)/loader/image.boot
    3534        mkdir -p $(TMP)/boot
    3635        mkdir -p $(TMP)/HelenOS
     
    3837        cp arch/$(ARCH)/silo/README arch/$(ARCH)/silo/COPYING arch/$(ARCH)/silo/silo.conf $(TMP)/boot
    3938        cp arch/$(ARCH)/loader/image.boot $(TMP)/HelenOS/image.boot
    40         mkisofs -f -G $(TMP)/boot/isofs.b -B ... -r -o image.iso $(TMP)/
     39        mkisofs -f -G $(TMP)/boot/isofs.b -B ... -r -o $(BASE)/image.iso $(TMP)/
    4140
    42 clean: clean_boot_gen clean_kernel
    43          make -C arch/$(ARCH)/loader clean
     41depend:
     42        -rm arch/$(ARCH)/loader/image.boot
     43
     44arch/$(ARCH)/loader/image.boot:
     45        make -C arch/$(ARCH)/loader COMPILER=$(COMPILER) KERNELDIR=../../../$(KERNELDIR) USPACEDIR=../../../$(USPACEDIR)
     46
     47clean: generic_clean
     48        make -C arch/$(ARCH)/loader clean COMPILER=$(COMPILER) KERNELDIR=../../../$(KERNELDIR) USPACEDIR=../../../$(USPACEDIR)
    4449        -rm -fr $(TMP)
    45         -rm -f image.iso
    46 
    47 arch_distclean: distclean_kernel
     50        -rm -f $(BASE)/image.iso
  • boot/arch/xen32/Makefile.inc

    r41c4444 r41f7564  
    2727#
    2828
    29 build: image.iso
     29TASKS = \
     30        $(USPACEDIR)/init/init \
     31        $(USPACEDIR)/ns/ns \
     32        $(USPACEDIR)/pci/pci \
     33        $(USPACEDIR)/fb/fb \
     34        $(USPACEDIR)/kbd/kbd \
     35        $(USPACEDIR)/console/console \
     36        $(USPACEDIR)/tetris/tetris \
     37        $(USPACEDIR)/ipcc/ipcc \
     38        $(USPACEDIR)/klog/klog
    3039
    31 image.iso: kernel uspace
     40build: $(BASE)/image.iso
     41
     42$(BASE)/image.iso: arch/$(ARCH)/grub/stage2_eltorito arch/$(ARCH)/grub/menu.lst arch/$(ARCH)/grub/xen.gz $(KERNELDIR)/kernel.bin $(TASKS)
    3243        mkdir -p arch/$(ARCH)/iso/boot/grub
    3344        cp arch/$(ARCH)/grub/stage2_eltorito arch/$(ARCH)/iso/boot/grub/
     
    3546        cp arch/$(ARCH)/grub/xen.gz arch/$(ARCH)/iso/boot/
    3647        cp $(KERNELDIR)/kernel.bin arch/$(ARCH)/iso/boot/
    37         cp $(USPACEDIR)/init/init arch/$(ARCH)/iso/boot/
    38         cp $(USPACEDIR)/ns/ns arch/$(ARCH)/iso/boot/
    39         cp $(USPACEDIR)/pci/pci arch/$(ARCH)/iso/boot/
    40         cp $(USPACEDIR)/fb/fb arch/$(ARCH)/iso/boot/
    41         cp $(USPACEDIR)/kbd/kbd arch/$(ARCH)/iso/boot/
    42         cp $(USPACEDIR)/console/console arch/$(ARCH)/iso/boot/
    43         cp $(USPACEDIR)/tetris/tetris arch/$(ARCH)/iso/boot/
    44         cp $(USPACEDIR)/ipcc/ipcc arch/$(ARCH)/iso/boot/
    45         cp $(USPACEDIR)/klog/klog arch/$(ARCH)/iso/boot/
    46         mkisofs -J -r -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o image.iso arch/$(ARCH)/iso/
     48        for task in $(TASKS) ; do \
     49                cp $$task arch/$(ARCH)/iso/boot/ ; \
     50        done
     51        mkisofs -J -r -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o $(BASE)/image.iso arch/$(ARCH)/iso/
    4752
    48 clean: clean_kernel clean_uspace
     53clean:
    4954        -rm -fr arch/$(ARCH)/iso
    50         -rm -f image.iso
    51 
    52 arch_distclean: distclean_kernel distclean_uspace
     55        -rm -f $(BASE)/image.iso
  • boot/boot.config

    r41c4444 r41f7564  
    1212! ARCH (choice)
    1313
    14 # PPC32 Compiler
     14# Compiler
    1515@ "cross" Cross-compiler
    1616@ "native" Native
    17 ! [ARCH=ppc32] PPC32_COMPILER (choice)
    18 % [ARCH=ppc32] SAVEAS PPC32_COMPILER COMPILER
    19 
    20 # PPC64 Compiler
    21 @ "cross" Cross-compiler
    22 @ "native" Native
    23 ! [ARCH=ppc64] PPC64_COMPILER (choice)
    24 % [ARCH=ppc64] SAVEAS PPC64_COMPILER COMPILER
    25 
    26 # MIPS32 Compiler
    27 @ "cross" Cross-compiler
    28 @ "native" Native
    29 ! [ARCH=mips32] MIPS32_COMPILER (choice)
    30 % [ARCH=mips32] SAVEAS MIPS32_COMPILER COMPILER
     17! COMPILER (choice)
    3118
    3219# Debug bootloader
     
    3926@ "binary" Binary image (MSIM)
    4027@ "ecoff" Ecoff image (GXEmul)
    41 ! [ARCH=mips32] CONFIG_IMAGE (choice)
     28! [ARCH=mips32] IMAGE (choice)
Note: See TracChangeset for help on using the changeset viewer.