summaryrefslogtreecommitdiffstats
path: root/private/ntos/boot/makefil0
blob: 9bcbdbaf905527344082a22865449c95f700f4a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
!INCLUDE $(NTMAKEENV)\makefile.plt

#
# Only want to build the boot code on x86 machines.
# Even on x86 machines, don't bother building on standard US builds
# (just use the pre-built us version).
#

BUILD_BOOTCODE=1

!IFNDEF LANGUAGE
LANGUAGE=usa
BUILD_BOOTCODE=0
!ENDIF

#
# Boot code header file generation.
# Boot code for each filesystem is placed in a header file
# in sdk\inc.
#

FATFILE=$(BASEDIR)\public\sdk\inc\bootfat.h
HPFSFILE=$(BASEDIR)\public\sdk\inc\boothpfs.h
NTFSFILE=$(BASEDIR)\public\sdk\inc\bootntfs.h
ETFSFILE=$(BASEDIR)\public\sdk\inc\bootetfs.h
MBRFILE=$(BASEDIR)\public\sdk\inc\bootmbr.h

FATCODE=bootcode\fat\i386
HPFSCODE=bootcode\hpfs\i386
NTFSCODE=bootcode\ntfs\i386
ETFSCODE=bootcode\etfs\i386
MBRCODE=bootcode\mbr\i386

#
# Targets
#
all: $(FATFILE) $(HPFSFILE) $(NTFSFILE) $(ETFSFILE) $(MBRFILE)
!IF "$(BUILDMSG)" != ""
    echo $(BUILDMSG)
!ENDIF

clean: cleansub all

cleansub:
    -erase $(FATFILE)
    -erase $(HPFSFILE)
    -erase $(NTFSFILE)
    -erase $(MBRFILE)
    -erase $(ETFSFILE)

!IF $(BUILD_BOOTCODE)

$(FATFILE): $(FATCODE)\fatboot.asm $(FATCODE)\$(LANGUAGE)\fatboot.inc
    masm -I$(FATCODE)\$(LANGUAGE) $(FATCODE)\fatboot.asm;
    link_60 /tiny fatboot.obj;
    bin2c fatboot.com 512 0 512 $(FATFILE) FatBootCode
    del fatboot.obj fatboot.com

$(HPFSFILE): $(HPFSCODE)\pinboot.asm $(HPFSCODE)\$(LANGUAGE)\pinboot.inc           \
             $(HPFSCODE)\buf.inc $(HPFSCODE)\chain.inc $(HPFSCODE)\const.inc       \
             $(HPFSCODE)\dir.inc $(HPFSCODE)\dirent.inc $(HPFSCODE)\fnode.inc      \
             $(HPFSCODE)\filemode.inc $(HPFSCODE)\fsstat.inc $(HPFSCODE)\macro.inc \
             $(HPFSCODE)\misc.inc $(HPFSCODE)\superb.inc $(HPFSCODE)\tables.inc    \
             $(HPFSCODE)\volume.inc
    masm -I$(HPFSCODE)\$(LANGUAGE) -I$(HPFSCODE) $(HPFSCODE)\pinboot.asm;
    link_60 /tiny pinboot.obj;
    bin2c pinboot.com 8192 0 8192 $(HPFSFILE) HpfsBootCode
    del pinboot.obj pinboot.com

$(NTFSFILE): $(NTFSCODE)\ntfsboot.asm $(NTFSCODE)\ntfs.inc $(NTFSCODE)\$(LANGUAGE)\ntfsboot.inc
    masm -I$(NTFSCODE)\$(LANGUAGE) -I$(NTFSCODE) $(NTFSCODE)\ntfsboot.asm;
    link_60 /tiny ntfsboot.obj;
    bin2c ntfsboot.com 8192 0 8192 $(NTFSFILE) NtfsBootCode
    del ntfsboot.obj ntfsboot.com

$(ETFSFILE): $(ETFSCODE)\etfsboot.asm $(ETFSCODE)\$(LANGUAGE)\etfsboot.inc
    masm -I$(ETFSCODE)\$(LANGUAGE) $(ETFSCODE)\etfsboot.asm;
    link_60 /tiny etfsboot.obj;
    bin2c etfsboot.com 2048 0 2048 $(ETFSFILE) EtfsBootCode
    del etfsboot.obj

$(MBRFILE): $(MBRCODE)\x86mboot.asm $(MBRCODE)\$(LANGUAGE)\x86mboot.msg
    masm -I$(MBRCODE)\$(LANGUAGE) $(MBRCODE)\x86mboot.asm;
    link_60 /tiny x86mboot.obj;
    bin2c x86mboot.com 512 0 512 $(MBRFILE) x86BootCode
    del x86mboot.obj x86mboot.com

!ELSE

$(FATFILE): $(FATCODE)\$(LANGUAGE)\bootfat.h
    copy $(FATCODE)\$(LANGUAGE)\bootfat.h $(FATFILE)

$(HPFSFILE): $(HPFSCODE)\$(LANGUAGE)\boothpfs.h
    copy $(HPFSCODE)\$(LANGUAGE)\boothpfs.h $(HPFSFILE)

$(NTFSFILE): $(NTFSCODE)\$(LANGUAGE)\bootntfs.h
    copy $(NTFSCODE)\$(LANGUAGE)\bootntfs.h $(NTFSFILE)

$(ETFSFILE): $(ETFSCODE)\$(LANGUAGE)\bootetfs.h
    copy $(ETFSCODE)\$(LANGUAGE)\bootetfs.h $(ETFSFILE)

$(MBRFILE): $(MBRCODE)\$(LANGUAGE)\bootmbr.h
    copy $(MBRCODE)\$(LANGUAGE)\bootmbr.h $(MBRFILE)

!ENDIF