re-worked ndis to do device detection from a win2k-style registry enum database,...
[reactos.git] / freeldr / bootsect / Makefile
1 #
2 # FreeLoader
3 # Copyright (C) 1999, 2000, 2001 Brian Palmer <brianp@sginet.com>
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 #
19
20 # Windows is default host environment
21 ifeq ($(HOST),)
22 HOST = mingw32-windows
23 endif
24
25 #
26 # Choose various options
27 #
28 ifeq ($(HOST),mingw32-linux)
29 RM = rm -f
30 CP = cp -f
31 MKDIR = mkdir
32 SEP = /
33 else
34 RM = cmd /C del
35 CP = copy /Y
36 MKDIR = md
37 SEP = \$(EMPTY_VAR)
38 endif
39
40 NASM_CMD = nasm
41 NFLAGS = -fwin32 -dwin32
42 BIN2C = ..$(SEP)tools$(SEP)bin2c
43 TOOLSDIR = ..$(SEP)tools
44 BOOTCD_DIR = ..$(SEP)..$(SEP)bootcd
45
46 .PHONY : clean bootcd
47
48 all: $(BIN2C) dosmbr.bin fat.bin fat32.bin isoboot.bin ext2.bin
49
50
51 $(BIN2C) :
52 @$(MAKE) --no-print-directory -C $(TOOLSDIR)
53
54 dosmbr.bin : dosmbr.asm
55 @echo ===================================================== Assembling dosmbr
56 @$(NASM_CMD) $(NFLAGS) -o dosmbr.bin -f bin dosmbr.asm
57
58 fat.bin : fat.asm $(BIN2C)
59 @echo ===================================================== Assembling fat
60 @$(NASM_CMD) $(NFLAGS) -o fat.bin -f bin fat.asm
61 @$(BIN2C) fat.bin fat.h fat_data
62
63
64 fat32.bin : fat32.asm $(BIN2C)
65 @echo ===================================================== Assembling fat32
66 @$(NASM_CMD) $(NFLAGS) -o fat32.bin -f bin fat32.asm
67 @$(BIN2C) fat32.bin fat32.h fat32_data
68
69 isoboot.bin : isoboot.asm
70 @echo ===================================================== Assembling isoboot
71 @$(NASM_CMD) $(NFLAGS) -o isoboot.bin -f bin isoboot.asm
72
73 ext2.bin : ext2.asm
74 @echo ===================================================== Assembling ext2
75 @$(NASM_CMD) $(NFLAGS) -o ext2.bin -f bin ext2.asm
76 @$(BIN2C) ext2.bin ext2.h ext2_data
77
78
79 .PHONY : bootcd
80 bootcd: bootcd_dirs isoboot.bin
81 $(CP) isoboot.bin $(BOOTCD_DIR)
82 $(CP) dosmbr.bin $(BOOTCD_DIR)$(SEP)disk$(SEP)loader
83 $(CP) ext2.bin $(BOOTCD_DIR)$(SEP)disk$(SEP)loader
84 $(CP) fat.bin $(BOOTCD_DIR)$(SEP)disk$(SEP)loader
85 $(CP) fat32.bin $(BOOTCD_DIR)$(SEP)disk$(SEP)loader
86 $(CP) isoboot.bin $(BOOTCD_DIR)$(SEP)disk$(SEP)loader
87
88 .PHONY : bootcd_dirs
89 bootcd_dirs:
90 $(MKDIR) $(BOOTCD_DIR)
91 $(MKDIR) $(BOOTCD_DIR)$(SEP)disk
92 $(MKDIR) $(BOOTCD_DIR)$(SEP)disk$(SEP)reactos
93 $(MKDIR) $(BOOTCD_DIR)$(SEP)disk$(SEP)install
94 $(MKDIR) $(BOOTCD_DIR)$(SEP)disk$(SEP)bootdisk
95 $(MKDIR) $(BOOTCD_DIR)$(SEP)disk$(SEP)loader
96
97 clean:
98 @-$(RM) *.bin
99 @-$(RM) *.h
100 @echo Clean ALL done.