]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/boot/amd64/Makerules.BOOT.amd64
cdafb985e20cf8ff88152c888398c99474444d5c
[l4.git] / kernel / fiasco / src / boot / amd64 / Makerules.BOOT.amd64
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_img.o:     boot_img.x2 boot_img.ren_syms
8         $(LINK_MESSAGE)
9         $(VERBOSE)$(OBJCOPY) --redefine-syms=boot_img.ren_syms $< $@
10
11 boot_img.ren_syms: boot_img.x2
12         $(LINK_MESSAGE)
13         $(VERBOSE)$(NM) -u $^ | perl -n -e 'if (/^\s*U\s+bootstrap_(.*)$$/) { print "bootstrap_$$1 $$1\n"; }' > $@
14
15 boot_img.x1:    $(OBJ_BOOT) $(DRIVERS) $(MINILIBC) 
16         $(LINK_MESSAGE)
17         $(VERBOSE)$(LD) -m $(LD_EMULATION) -r -s -o $@ \
18         -T $(srcdir)/boot/amd64/bootstrap.ld $^ $(LIBGCC)
19
20 boot_img.x2:    boot_img.x1
21         $(LINK_MESSAGE)
22         $(VERBOSE)$(OBJCOPY) --prefix-alloc-sections=.bootstrap --prefix-symbols=bootstrap_ -G bootstrap__boot_start $^ $@
23
24
25
26 kernel.amd64.lds: linking.h
27
28 $(KERNEL):      kernel.amd64.lds boot_img.o $(CRT0) $(OBJ_KERNEL) $(JDB) $(LIBK) $(KERNEL_EXTRA_LIBS) $(ABI) $(JABI) libdrivers.a $(CXXLIB) $(LIBKERN) $(MINILIBC) libgluedriverslibc.a
29                 $(LINK_MESSAGE)
30                 $(VERBOSE)$(LD) -m elf_x86_64 -N -T $< -gc-sections \
31                 -o $@ $(filter-out $<,$+) $(LIBGCC) $(KERNEL_UNRES_SYMS)
32
33 $(BOOT): $(KERNEL)
34                 $(LINK_MESSAGE)
35                 $(VERBOSE)$(STRIP) -o $@ $<
36                 $(VERBOSE)chmod 755 $@
37                 $(VERBOSE)ln -sf $@ fiasco