]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/boot/ia32/Makerules.BOOT.ia32
update
[l4.git] / kernel / fiasco / src / boot / ia32 / Makerules.BOOT.ia32
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 # Don't link against libgcc because of -mregparm=3. The library
8 # would only be necessary for 64-bit arithmetics. These functions
9 # can be replaced by using div32/mod32 from lib/libk (and should
10 # for efficency reasons).
11
12 boot_img.o:     boot_img.x2 boot_img.ren_syms
13         $(LINK_MESSAGE)
14         $(VERBOSE)$(OBJCOPY) --redefine-syms=boot_img.ren_syms $< $@
15
16 boot_img.ren_syms: boot_img.x2
17         $(LINK_MESSAGE)
18         $(VERBOSE)$(NM) -u $^ | perl -n -e 'if (/^\s*U\s+bootstrap_(.*)$$/) { print "bootstrap_$$1 $$1\n"; }' > $@
19
20 boot_img.x1:    $(OBJ_BOOT) $(DRIVERS) $(MINILIBC) 
21         $(LINK_MESSAGE)
22         $(VERBOSE)$(LD) -m $(LD_EMULATION) -r -s -o $@ \
23         -T $(srcdir)/boot/ia32/bootstrap.ld $^ $(LIBGCC)
24
25 boot_img.x2:    boot_img.x1
26         $(LINK_MESSAGE)
27         $(VERBOSE)$(OBJCOPY) --prefix-alloc-sections=.bootstrap --prefix-symbols=bootstrap_ -G bootstrap__boot_start $^ $@
28
29
30
31 kernel.ia32.lds: linking.h
32
33 $(KERNEL):      kernel.ia32.lds boot_img.o $(CRT0) $(OBJ_KERNEL) $(JDB) $(LIBK) $(KERNEL_EXTRA_LIBS) $(ABI) $(JABI) libdrivers.a $(CXXLIB) $(LIBKERN) $(MINILIBC) libgluedriverslibc.a
34                 $(LINK_MESSAGE)
35                 $(VERBOSE)$(LD) -m $(LD_EMULATION) -N -o $@ \
36                    -T $< -gc-sections $(filter-out $<,$+) \
37                    $(KERNEL_UNRES_SYMS)
38
39 # '$(RM) main' should be removed later - Late 2012
40 $(BOOT): $(KERNEL)
41                 $(LINK_MESSAGE)
42                 $(VERBOSE)$(STRIP) -o $@ $<
43                 $(VERBOSE)chmod 755 $@
44                 $(VERBOSE)$(RM) main