2 include $(TOP)/config/make.cfg
4 TARGETDIR := $(GENDIR)/$(CURDIR)
6 FILES := bootstrap screen elfloader support
8 #MM kernel-bootstrap-x86_64: kernel-kernel-pc-x86_64-kobj kernel-exec-kobj kernel-utility-kobj kernel-expansion-kobj kernel-oop-kobj kernel-hidd-kobj kernel-pc-x86_64-irq-kobj kernel-pc-i386-kbd-kobj kernel-pc-i386-mouse-kobj
9 kernel-bootstrap-x86_64: $(BINDIR)/boot/kernel $(TARGETDIR)/vesa.bin.o $(BINDIR)/boot/aros-x86_64
12 %mkdirs_q $(BINDIR)/boot $(OSGENDIR)/boot $(TARGETDIR)
14 $(BINDIR)/boot/aros-x86_64: $(KOBJSDIR)/bootstrap.o $(TARGETDIR)/vesa.bin.o
15 $(HOST_LD) -melf_i386 -N -e kernel_bootstrap -Map $(OSGENDIR)/boot/aros.map -T ldscript.lds \
17 @strip --strip-unneeded -R .note -R .comment $@
19 $(KOBJSDIR)/bootstrap.o: $(foreach f, $(FILES), $(TARGETDIR)/$(f).o $(TARGETDIR)/$(f).d) $(TARGETDIR)/vesa.bin.o
20 $(HOST_LD) -melf_i386 -r $(foreach f, $(FILES), $(TARGETDIR)/$(f).o) $(TARGETDIR)/vesa.bin.o -o $@
22 $(BINDIR)/boot/kernel: setup-pc-x86_64 $(KOBJSDIR)/kernel_resource.o $(KOBJSDIR)/exec_library.o $(KOBJSDIR)/utility_library.o $(KOBJSDIR)/expansion_library.o $(KOBJSDIR)/oop_library.o $(KOBJSDIR)/hiddclass_hidd.o $(KOBJSDIR)/irq_hidd.o $(KOBJSDIR)/kbd_hidd.o $(KOBJSDIR)/mouse_hidd.o
23 $(TARGET_LD) -Map $(OSGENDIR)/boot/kernel.map -T kernel.lds -o $@ $(KOBJSDIR)/kernel_resource.o $(KOBJSDIR)/exec_library.o $(KOBJSDIR)/utility_library.o $(KOBJSDIR)/expansion_library.o $(KOBJSDIR)/oop_library.o $(KOBJSDIR)/hiddclass_hidd.o $(KOBJSDIR)/irq_hidd.o $(KOBJSDIR)/kbd_hidd.o $(KOBJSDIR)/mouse_hidd.o -L$(LIBDIR) -lautoinit -llibinit -lamiga -larossupport -lrom -larosm -lhiddstubs
25 $(TARGETDIR)/aros.bin.o: setup-pc-x86_64 $(KOBJSDIR)/kernel.o $(foreach f, $(KOBJS), $(KOBJSDIR)/$(f).o)
26 $(LD) -melf_x86_64 -r \
27 -o $(TARGETDIR)/aros.o $(KOBJSDIR)/kernel.o $(foreach f, $(KOBJS), $(KOBJSDIR)/$(f).o)
28 cd $(TARGETDIR) && $(HOST_LD) -r --format binary --oformat elf32-i386 aros.o -o aros.bin.o
30 $(TARGETDIR)/vesa.bin.o: setup-pc-x86_64 $(TARGETDIR)/vesa.o
31 $(HOST_LD) -melf_i386 -e 0x1000 -Ttext 0x1000 -N -d -nostdlib \
32 -o $(TARGETDIR)/vesa $(TARGETDIR)/vesa.o
33 $(OBJCOPY) -O binary $(TARGETDIR)/vesa
34 cd $(TARGETDIR) && $(HOST_LD) -r --format binary --oformat elf32-i386 vesa -o vesa.bin.o
40 $(TARGETDIR)/%.o : %.c
41 %compile_q opt="$(CFLAGS) -m32 -fomit-frame-pointer -nostdinc -nostdlib"
43 $(TARGETDIR)/%.o : %.S
44 %compile_q opt="$(CFLAGS) -m32 -fomit-frame-pointer -nostdinc -nostdlib"
46 $(TARGETDIR)/%.d : %.c
49 DEPS := $(foreach f, $(FILES), $(TARGETDIR)/$(f).d)