2 BOOT_SRCDIR
:= boot
/$(ARCH
)
3 BOOT_TARGETDIR
:= $(call TOBUILDDIR
, boot
)
5 STAGE2
= $(BOOT_TARGETDIR
)/stage2
7 ifeq ($(OSTYPE
),cygwin
)
8 BOOT_IMAGE_TARGET ?
= a
:
9 else ifeq ($(OSTYPE
),linux
)
10 BOOT_IMAGE_TARGET ?
= /dev
/fd0
13 # make a rule for the stage2
14 MY_TARGETDIR
:= $(BOOT_TARGETDIR
)
15 MY_SRCDIR
:= $(BOOT_SRCDIR
)
16 MY_TARGET
:= $(STAGE2
)
24 MY_INCLUDES
:= $(STDINCLUDE
)
25 MY_CFLAGS
:= $(KERNEL_CFLAGS
)
27 MY_LIBS
:= $(LIBS_BUILD_DIR
)/libc.a
30 MY_LINKSCRIPT
:= $(MY_SRCDIR
)/stage2.
ld
33 include templates
/app.mk
35 STAGE1
= $(BOOT_TARGETDIR
)/stage1
38 MY_TARGETDIR
:= $(BOOT_TARGETDIR
)
39 MY_SRCDIR
:= $(BOOT_SRCDIR
)
40 MY_TARGET
:= $(STAGE1
).elf
45 MY_INCLUDES
:= $(STDINCLUDE
)
46 MY_CFLAGS
:= $(KERNEL_CFLAGS
)
48 MY_LIBS
:= $(LIBS_BUILD_DIR
)/libc.a
51 MY_LINKSCRIPT
:= $(MY_SRCDIR
)/stage1.
ld
54 include templates
/app.mk
56 BOOTBLOCK
:= $(BOOT_SRCDIR
)/bootblock.bin
57 BOOTBLOCK_VESA
:= $(BOOT_SRCDIR
)/bootblock.bin.vesa
58 MAKEFLOP
:= $(BOOT_SRCDIR
)/makeflop
59 CONFIG_FILE
:= $(BOOT_SRCDIR
)/config.ini
61 $(FINAL
): $(STAGE1
) $(STAGE2
) $(ALL
) $(TOOLS
) $(MAKEFLOP
) $(CONFIG_FILE
) $(BOOTBLOCK
)
62 $(BOOTMAKER
) --strip-debug
--strip-binary
$(STRIP
) $(CONFIG_FILE
) -o
$(FINAL
).prepre
63 gzip
-f
-9 $(FINAL
).prepre
64 cat
$(STAGE1
) $(FINAL
).prepre.gz
> $(FINAL
).pre
65 $(MAKEFLOP
) -p
$(shell expr
18 \
* 2 \
* 512) $(BOOTBLOCK
) $(FINAL
).pre
$(FINAL
)
66 @
rm -f
$(FINAL
).pre
$(FINAL
).prepre
$(FINAL
).prepre.gz
68 $(FINAL
).v
: $(STAGE1
) $(STAGE2
) $(ALL
) $(TOOLS
) $(MAKEFLOP
) $(CONFIG_FILE
) $(BOOTBLOCK_VESA
)
69 $(BOOTMAKER
) --strip-debug
--strip-binary
$(STRIP
) $(CONFIG_FILE
) -o
$(FINAL
).prepre
70 gzip
-f
-9 $(FINAL
).prepre
71 cat
$(STAGE1
) $(FINAL
).prepre.gz
> $(FINAL
).pre
72 $(MAKEFLOP
) -p
$(shell expr
18 \
* 2 \
* 512) $(BOOTBLOCK_VESA
) $(FINAL
).pre
$(FINAL
).v
73 @
rm -f
$(FINAL
).pre
$(FINAL
).prepre
$(FINAL
).prepre.gz
75 $(STAGE1
): $(STAGE1
).elf
76 $(OBJCOPY
) -O binary
$(STAGE1
).elf
$(STAGE1
)
79 ifeq ($(OSTYPE
),cygwin
)
80 fdimage
-q
$(FINAL
) $(BOOT_IMAGE_TARGET
)
82 dd if
=$(FINAL
) of
=$(BOOT_IMAGE_TARGET
) bs
=18k
86 ifeq ($(OSTYPE
),cygwin
)
87 fdimage
-q
$(FINAL
).v
$(BOOT_IMAGE_TARGET
)
89 dd if
=$(FINAL
).v of
=$(BOOT_IMAGE_TARGET
) bs
=18k
92 $(MAKEFLOP
): $(MAKEFLOP
).c
93 $(HOST_CC
) -O
$(MAKEFLOP
).c
-o
$@