1 ifneq ($(_BOOT_MAKE
),1)
4 # include targets we depend on
6 include kernel
/kernel.mk
10 BOOT_DIR
= boot
/$(ARCH
)
11 BOOT_OBJ_DIR
= $(BOOT_DIR
)/$(OBJ_DIR
)
13 $(BOOT_OBJ_DIR
)/stage2.o \
14 $(BOOT_OBJ_DIR
)/smp_boot.o \
15 $(BOOT_OBJ_DIR
)/smp_trampoline.o
16 DEPS
+= $(STAGE2_OBJS
:.o
=.d
)
18 STAGE2
= $(BOOT_OBJ_DIR
)/stage2
20 $(STAGE2
): $(STAGE2_OBJS
) $(KLIBS
)
21 $(LD
) -dN
--script
=$(BOOT_DIR
)/stage2.
ld -L
$(LIBGCC_PATH
) $(STAGE2_OBJS
) $(KLIBS
) $(LIBGCC
) -o
$@
26 rm -f
$(STAGE2_OBJS
) $(STAGE2
)
30 FINAL
= $(BOOT_DIR
)/final
31 BOOTBLOCK
= $(BOOT_DIR
)/bootblock.bin
32 MAKEFLOP
= $(BOOT_DIR
)/makeflop
39 $(MAKEFLOP
): $(MAKEFLOP
).c
40 $(HOST_CC
) -O3
$(MAKEFLOP
).c
-o
$@
42 $(FINAL
): $(STAGE2
) $(KERNEL
) $(KERNEL_ADDONS
) $(APPS
) tools
43 $(BOOTMAKER
) $(BOOT_DIR
)/config.ini
-o
$(FINAL
)
45 floppy
: $(STAGE2
) $(KERNEL
) $(KERNEL_ADDONS
) $(APPS
) tools
$(MAKEFLOP
)
46 $(BOOTMAKER
) $(BOOT_DIR
)/config.ini
-o
$(FINAL
).pre
47 $(MAKEFLOP
) $(BOOTBLOCK
) $(FINAL
).pre
$(FINAL
)
49 rm -f final.
$(ARCH
);ln
-sf
$(FINAL
) final.
$(ARCH
)
50 rm -f system.
$(ARCH
);ln
-sf
$(KERNEL
) system.
$(ARCH
)
53 ifeq ($(OSTYPE
),cygwin
)
54 fdimage
-q
$(FINAL
) a
:
56 dd if
=$(FINAL
) of
=/dev
/disk
/floppy
/raw bs
=18k
60 dd if
=$(FINAL
) of
=/dev
/fd0 bs
=18k
63 $(BOOT_OBJ_DIR
)/%.o
: $(BOOT_DIR
)/%.c
64 @mkdir
-p
$(BOOT_OBJ_DIR
)
65 $(CC
) -c
$< $(GLOBAL_CFLAGS
) $(KERNEL_CFLAGS
) -Iinclude
-I
$(BOOT_DIR
) -o
$@
67 $(BOOT_OBJ_DIR
)/%.d
: $(BOOT_DIR
)/%.c
68 @mkdir
-p
$(BOOT_OBJ_DIR
)
69 @echo
"making deps for $<..."
70 @
($(ECHO
) -n
$(dir $@
);$(CC
) $(GLOBAL_CFLAGS
) $(KERNEL_CFLAGS
) -Iinclude
-I
$(BOOT_DIR
) -M
-MG
$<) > $@
72 $(BOOT_OBJ_DIR
)/%.d
: $(BOOT_DIR
)/%.S
73 @mkdir
-p
$(BOOT_OBJ_DIR
)
74 @echo
"making deps for $<..."
75 @
($(ECHO
) -n
$(dir $@
);$(CC
) $(GLOBAL_CFLAGS
) $(KERNEL_CFLAGS
) -Iinclude
-I
$(BOOT_DIR
) -M
-MG
$<) > $@
77 $(BOOT_OBJ_DIR
)/%.o
: $(BOOT_DIR
)/%.S
78 @mkdir
-p
$(BOOT_OBJ_DIR
)
79 $(CC
) -c
$< $(GLOBAL_CFLAGS
) $(KERNEL_CFLAGS
) -Iinclude
-I
$(BOOT_DIR
) -o
$@