4 # Add future prerequisites somewhere among the list of libraries.
5 # You really should not have to add anything in the $(LD) line.
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).
12 boot_img.o: boot_img.x2 boot_img.ren_syms
14 $(VERBOSE)$(OBJCOPY) --redefine-syms=boot_img.ren_syms $< $@
16 boot_img.ren_syms: boot_img.x2
18 $(VERBOSE)$(NM) -u $^ | perl -n -e 'if (/^\s*U\s+bootstrap_(.*)$$/) { print "bootstrap_$$1 $$1\n"; }' > $@
20 boot_img.x1: $(OBJ_BOOT) $(DRIVERS) $(MINILIBC)
22 $(VERBOSE)$(LD) -m $(LD_EMULATION) -r -s -o $@ \
23 -T $(srcdir)/boot/ia32/bootstrap.ld $^ $(LIBGCC)
25 boot_img.x2: boot_img.x1
27 $(VERBOSE)$(OBJCOPY) --prefix-alloc-sections=.bootstrap --prefix-symbols=bootstrap_ -G bootstrap__boot_start $^ $@
31 kernel.ia32.lds: linking.h
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
35 $(VERBOSE)$(LD) -m $(LD_EMULATION) -N -o $@ \
36 -T $< -gc-sections $(filter-out $<,$+) \
39 # '$(RM) main' should be removed later - Late 2012
42 $(VERBOSE)$(STRIP) -o $@ $<
43 $(VERBOSE)chmod 755 $@