]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/boot/arm/Makerules.BOOT.arm
035f3247dd7283df3940a2067f41b338e5585efd
[l4.git] / kernel / fiasco / src / boot / arm / Makerules.BOOT.arm
1 # -*- makefile -*-
2 # Boot Makefile
3
4 # Add future prerequisites somewhere among the list of libraries.
5 # You really should not have to add anything in the $(LD) line.
6
7 $(BOOT): $(BOOT).elf
8         $(OBJCOPY) -O binary $< $@ 
9         chmod 755 $@
10         ln -sf $@ fiasco
11         $(call INSTALLFILE_RULE,fiasco,fiasco)
12
13 $(BOOT).elf: $(KERNEL)
14         cp $(KERNEL) $(BOOT).elf
15         $(STRIP) $(BOOT).elf
16
17
18 ifeq (a,b)
19 $(BOOT).elf: $(srcdir)/boot.arm.ld $(CRT0) kernel.o $(OBJ_BOOT) $(ABI) $(DRIVERS) $(CXXLIB) $(MINILIBC) 
20         @echo "  ... Building boot image"
21         $(LINK_MESSAGE) 
22         $(VERBOSE)$(LD) $(LDFLAGS) -T $< -Ttext $(CONFIG_BOOT_LOAD_ADDR) \
23         -o $@.unstripped $(filter-out $< libgluedriverslibc.a, $^) libgluedriverslibc.a $(LIBGCC)
24         $(VERBOSE)$(LD) $(LDFLAGS) -T $< -Ttext $(CONFIG_BOOT_LOAD_ADDR) \
25         -o $@ $(filter-out $< libgluedriverslibc.a, $^) libgluedriverslibc.a $(LIBGCC) -s --gc-sections
26 endif
27
28 %.img.o: %.elf
29         $(OBJCOPY) -S $< $*
30         $(OBJCOPY) -B arm -I binary -O elf32-littlearm $* $@
31
32
33 #%.img.o: %.elf
34 #       $(OBJCOPY) -S $< $*
35 #       $(OBJCOPY) -B arm -I binary -O elf32-littlearm $* $@.ex
36 #       echo 'asm(".section .rodata.modules;      '\
37 #            '_bin_$(basename $*)_name:           '\
38 #            '.ascii \"$(basename $*)\"; .byte 0; '\
39 #            '.section .modules; .word _binary_$(basename $*)_start; '\
40 #            '.word _binary_$(basename $*)_size; '\
41 #            '.word _bin_$(basename $*)_name; ");' > $@.ex.c
42 #       $(CC) -c $@.ex.c -o $@.ex.o
43 #       $(LD) -r $@.ex.o $@.ex -o $@    
44 #       #$(RM) -f $@.ex $@.ex.c $@.ex.o
45
46 kernel.o: $(KERNEL) 
47         $(OBJCOPY) -S $(KERNEL) $(@:.o=)
48         $(OBJCOPY) -B arm -I binary -O elf32-littlearm $(@:.o=) $@